mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 01:34:31 +08:00
Add models and GraphQL interface definitions for search results and guides (representing Markdown documents such as tutorials, etc.). These aren't connected to anything yet, but putting them in a separate PR to keep the review short and relatively simple. Towards DOCS-214
38 lines
923 B
TypeScript
38 lines
923 B
TypeScript
import { 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
|
|
}
|
|
}
|