File
Blob: src/sites/types.ts
| 1 | import type { ReactNode } from "react"; |
| 2 | |
| 3 | import type { PageMentionPresentationProps } from "@/shared/editor/presentation/page-mention"; |
| 4 | import type { OutlineItem } from "@/shared/editor/presentation/outline"; |
| 5 | import type { EditorTextMetrics } from "@/shared/editor/schema/metrics"; |
| 6 | |
| 7 | export interface SiteIdentity { |
| 8 | workspaceName: string; |
| 9 | workspaceIcon: string | null; |
| 10 | currentIsHome: boolean; |
| 11 | homeHref: string; |
| 12 | } |
| 13 | |
| 14 | export interface SiteNotFoundIdentity { |
| 15 | workspaceName: string; |
| 16 | workspaceIcon: string | null; |
| 17 | homeHref: string; |
| 18 | } |
| 19 | |
| 20 | export interface SiteDocumentAssets { |
| 21 | stylesheetHref: string; |
| 22 | fontStylesheetHref: string; |
| 23 | scriptSrc: string | null; |
| 24 | modulePreloadHrefs: string[]; |
| 25 | } |
| 26 | |
| 27 | export interface SitePageRenderState { |
| 28 | title: string; |
| 29 | icon: string | null; |
| 30 | coverUrl: string | null; |
| 31 | ogImage: SiteOgImage | null; |
| 32 | outline: OutlineItem[]; |
| 33 | metrics: EditorTextMetrics; |
| 34 | description?: string | null; |
| 35 | site: SiteIdentity; |
| 36 | canonicalUrl: string; |
| 37 | } |
| 38 | |
| 39 | export interface SitePageDocumentProps { |
| 40 | children: ReactNode; |
| 41 | } |
| 42 | |
| 43 | export interface SiteOgImage { |
| 44 | url: string; |
| 45 | type: string; |
| 46 | width: number; |
| 47 | height: number; |
| 48 | } |
| 49 | |
| 50 | export interface NotFoundDocumentProps { |
| 51 | site: SiteNotFoundIdentity | null; |
| 52 | assets: SiteDocumentAssets; |
| 53 | } |
| 54 | |
| 55 | export interface ApexDocumentProps { |
| 56 | assets: SiteDocumentAssets; |
| 57 | } |
| 58 | |
| 59 | export type SitesPageMentionRenderInfo = Pick<PageMentionPresentationProps, "ariaLabel" | "href" | "icon" | "kind"> & { |
| 60 | label: string; |
| 61 | }; |
| 62 | |
| 63 | export type SitesPageMentionResolver = (pageId: string) => SitesPageMentionRenderInfo; |