Files
supabase/apps/docs/resources/guide/guideModel.ts
Charis badcf17f70 feat(content api): add client library api reference search results (#35484)
* 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
2025-05-06 13:11:29 -04:00

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
}
}