mirror of
https://github.com/supabase/supabase.git
synced 2026-05-21 04:48:04 +08:00
* feat(content api): add client library api reference search results Allow searchDocs results to also return function references from the client library APIs * fix(content api): refine language enum handling
38 lines
928 B
TypeScript
38 lines
928 B
TypeScript
import { type SearchResultInterface } from '../globalSearch/globalSearchInterface'
|
|
|
|
export class GuideModel implements SearchResultInterface {
|
|
public title?: string
|
|
public href?: string
|
|
public content?: string
|
|
public subsections: Array<SubsectionModel>
|
|
|
|
constructor({
|
|
title,
|
|
href,
|
|
content,
|
|
subsections,
|
|
}: {
|
|
title?: string
|
|
href?: string
|
|
content?: string
|
|
subsections?: Array<{ title?: string; href?: string; content?: string }>
|
|
}) {
|
|
this.title = title
|
|
this.href = href
|
|
this.content = content
|
|
this.subsections = subsections?.map((subsection) => new SubsectionModel(subsection)) ?? []
|
|
}
|
|
}
|
|
|
|
export class SubsectionModel {
|
|
public title?: string
|
|
public href?: string
|
|
public content?: string
|
|
|
|
constructor({ title, href, content }: { title?: string; href?: string; content?: string }) {
|
|
this.title = title
|
|
this.href = href
|
|
this.content = content
|
|
}
|
|
}
|