21 lines
654 B
TypeScript
21 lines
654 B
TypeScript
import type { DocumentLimits, JsonObject } from "./types.ts";
|
|
import type { ValueSchema } from "./schema.ts";
|
|
import type { BlockDefinition } from "./registry.ts";
|
|
|
|
export interface DocumentKindDefinition {
|
|
kind: string;
|
|
version: number;
|
|
metadata: ValueSchema<JsonObject>;
|
|
rootTypes: string[];
|
|
blocks: readonly BlockDefinition[];
|
|
variables: Record<string, "string" | "number" | "date" | "boolean">;
|
|
breakpoints: Record<string, number>;
|
|
capabilities: string[];
|
|
targets: string[];
|
|
limits: DocumentLimits;
|
|
urlSchemes: string[];
|
|
}
|
|
|
|
export const defineDocumentKind = <T extends DocumentKindDefinition>(definition: T): T =>
|
|
definition;
|