import { DesignDocument, DesignElement, DesignNode } from "./types.js"; import { SceneGraph, SceneNode } from "@open-pencil/scene-graph"; //#region src/export/projection.d.ts /** * Draws a vector-shaped layer as an inline `` element sized to the layer, from the * engine's own SVG export. dom-css cannot depend on that engine, so it comes in as an option. */ type VectorElementRenderer = (graph: SceneGraph, node: SceneNode) => DesignElement | null; interface SceneGraphToDesignOptions { rootId?: string; includeSourceIds?: boolean; /** Write variable-bound values as `var(--name)` where CSS resolves them as drawn. Default true. */ tokens?: boolean; /** Vector, boolean, star, polygon, and icon layers as inline SVG; without it they project as boxes. */ vectorElement?: VectorElementRenderer; /** Hidden layers to project as shown, such as the tab panels a component reveals itself. */ shown?: ReadonlySet; } declare function sceneGraphToDesignDocument(graph: SceneGraph, options?: SceneGraphToDesignOptions): DesignDocument; /** Project one node, including its own box, instead of the children of a root. */ declare function sceneNodeToDesignDocument(graph: SceneGraph, nodeId: string, options?: Omit): DesignDocument; /** * Project several nodes, each with its own box, as one document: the tokens any of them * references are the document's, so its stylesheet defines them all. */ declare function sceneNodesToDesignDocument(graph: SceneGraph, nodeIds: readonly string[], options?: Omit): DesignDocument; //#endregion //#region src/export/bundle.d.ts /** A font face the exported text uses. */ interface WebFontFaceRequest { family: string; weight: number; style?: 'normal' | 'italic'; } /** A font file to ship next to the page, described as an `@font-face` rule. */ interface WebFontFaceAsset { family: string; weight: string | number | [number, number]; style: string; display?: string; stretch?: string; unicodeRange?: string[]; format: 'woff2' | 'woff' | 'opentype' | 'truetype'; path: string; content: Uint8Array; } /** Finds font files for the requested faces; paths start with `assetBasePath`. */ type WebFontFaceResolver = (fonts: WebFontFaceRequest[], assetBasePath: string) => Promise; interface ExportHTMLBundleOptions { html?: 'fragment' | 'standalone'; style?: 'inline' | 'tailwind'; assets?: 'inline' | 'external'; /** Resolves font files to include with external assets; `none` includes no fonts. */ fonts?: 'none' | WebFontFaceResolver; assetBasePath?: string; } interface ExportHTMLFile { path: string; content: string | Uint8Array; } interface ExportHTMLBundle { entrypoint: string; files: ExportHTMLFile[]; } declare function exportHTMLBundle(document: DesignDocument, options?: ExportHTMLBundleOptions): Promise; //#endregion //#region src/export/html.d.ts interface SerializeHTMLOptions { style?: 'inline' | 'tailwind'; /** Custom properties declared in `@theme`; a `var()` naming one becomes its utility. */ themeVariables?: readonly string[]; /** * Put each child of an element that holds only elements on its own indented line, for code * people read. Text keeps its whitespace; whitespace between elements in a projected layer * changes nothing, since its children are placed by flex, grid, or absolute position. */ indent?: boolean; } declare function serializeNode(node: DesignNode, options?: SerializeHTMLOptions, depth?: number): string; declare function serializeHTML(document: DesignDocument, options?: SerializeHTMLOptions): string; //#endregion //#region src/export/components/styling.d.ts /** How a generated component is styled: a stylesheet, or Tailwind utilities in its markup. */ declare const COMPONENT_STYLINGS: readonly ["css", "tailwind"]; type ComponentStyling = (typeof COMPONENT_STYLINGS)[number]; //#endregion export { COMPONENT_STYLINGS, ComponentStyling, ExportHTMLBundle, ExportHTMLBundleOptions, ExportHTMLFile, SceneGraphToDesignOptions, SerializeHTMLOptions, VectorElementRenderer, WebFontFaceAsset, WebFontFaceRequest, WebFontFaceResolver, exportHTMLBundle, sceneGraphToDesignDocument, sceneNodeToDesignDocument, sceneNodesToDesignDocument, serializeHTML, serializeNode }; //# sourceMappingURL=styling.d.ts.map