import { CSSComputeOptions as CSSComputeOptions$1, CSSFontFaceRule, CSSRuntime as CSSRuntime$1, DesignDocument as DesignDocument$1, DesignElement as DesignElement$1, DesignLayout as DesignLayout$1, DesignNode as DesignNode$1, DesignResource as DesignResource$1, DesignResourceFetch as DesignResourceFetch$1, DesignStyleDeclaration as DesignStyleDeclaration$1, DesignStyleSheet as DesignStyleSheet$1, DesignText as DesignText$1, DesignViewport as DesignViewport$1, parseFontFaceRules, parseStylesheetImports } from "./types.js"; import { CompileTailwindCSSOptions, JSXStyleObject, JSXStyleValue, compileTailwindCSS } from "./tailwind.js"; import { DesignDocumentToSceneGraphOptions } from "./scene-graph.js"; import { BrowserCSSRuntimeOptions, createBrowserCSSRuntime } from "./browser.js"; import { ComponentStyling, ExportHTMLFile, SerializeHTMLOptions, VectorElementRenderer, WebFontFaceResolver } from "./styling.js"; import { JSXToDesignDocumentOptions, JSXToSceneGraphOptions, TailwindJSXToDesignDocumentOptions, TailwindJSXToSceneGraphOptions, jsxToDesignDocument, jsxToSceneGraph, tailwindJSXToDesignDocument, tailwindJSXToSceneGraph } from "./jsx-runtime.js"; import { es } from "@open-pencil/emit"; import { SceneGraph } from "@open-pencil/scene-graph"; //#region src/export/storybook/module.d.ts declare const STORYBOOK_FRAMEWORKS: readonly ["react", "vue", "html"]; type StorybookFramework = (typeof STORYBOOK_FRAMEWORKS)[number]; //#endregion //#region src/export/storybook/export.d.ts interface ExportStorybookOptions { framework?: StorybookFramework; /** * How Vue and React components are styled: a stylesheet beside each, by default, or Tailwind * utilities in their markup, which needs Tailwind set up in the Storybook project. */ styling?: ComponentStyling; /** Limit the export to one page. Defaults to every page. */ pageId?: string; /** * The document's name, which titles its stories, such as `Pricing/Plan picker`, with each * page's name between when it has several. Without it, stories are titled by page. */ document?: string; /** Repository-relative `.fig`/`.pen` path; adds an `openpencil://` design link to stories. */ linkPath?: string; /** Renders a variant to PNG; each story then shows it next to the link as its design. */ renderDesignImage?: (nodeId: string) => Promise; /** Draws vector layers as inline SVG, from the engine's SVG export. */ vectorElement?: VectorElementRenderer; /** * How each story file is written, which a caller decides, such as from rules a user wrote: * which stories it has and its title. Every file is written as `variants` by default. */ plan?: (target: StoryTarget) => StoryPlan; /** * Finds the font files the stories' text uses, which ship with them in `fonts/` and load * before a story shows, so its text draws in the document's fonts. Without it, text uses * whatever fonts Storybook's page has. */ fonts?: WebFontFaceResolver; /** * The folder a document's shared files go in, its fonts and design tokens, which must differ * for each document exported into the same place; `openpencil/` by default. */ folder?: string; } /** How a story file shows its component: every variant, Default alone, a gallery, or not. */ declare const STORY_MODES: readonly ["variants", "single", "gallery", "none"]; type StoryMode = (typeof STORY_MODES)[number]; /** A story file the export would write, as a plan reads it. */ interface StoryTarget { /** The document's name, when the export knows it. */ document: string | undefined; page: string; /** The component set's or component's name, or a slash-named group's prefix. */ name: string; /** The title the file has unless the plan gives another. */ title: string; } /** What a plan says about a story file; anything it leaves out stays as it would be. */ interface StoryPlan { stories?: StoryMode; title?: string; /** * Whether a Vue or React export generates a component for the file, as it does by default, * or keeps static stories of its variants. */ generate?: boolean; } interface StorybookFile extends ExportHTMLFile { /** Name of the page the file was generated from. */ page: string; } /** * Generate one CSF3 `.stories.ts` file per component or component set, plus a * `.design/` folder of variant images when `renderDesignImage` is given. */ declare function exportStorybook(graph: SceneGraph, options?: ExportStorybookOptions): Promise; //#endregion //#region src/runtime/index.d.ts /** * The browser's CSS runtime. Outside a browser there is none to default to: pass a runtime, such * as `createHTMLEngineRuntime()` from `@open-pencil/html-engine`, which styles and lays documents * out as a browser does. */ declare function createCSSRuntime(): CSSRuntime$1; //#endregion //#region src/runtime/resources.d.ts /** * Reads the pictures elements show with `fetch` and puts them on the elements: an ``'s from * the address it loaded, and each `background-image` layer's from its computed `url()`. Each * address is read once, a few at a time, and one that cannot be read is left out. */ declare function attachImages(images: readonly [DesignElement$1, string][], fetch: DesignResourceFetch$1 | undefined, backgrounds?: readonly DesignElement$1[]): Promise; /** The addresses an element's computed `background-image` layers name, as computed, absolute. */ declare function backgroundImageURLs(element: DesignElement$1): string[]; //#endregion //#region src/import/markup.d.ts /** * The elements and text of an HTML fragment as a design document, without a browser: what a CSS * runtime that styles documents elsewhere, such as the HTML engine, parses them into. Leaves out * what draws nothing (``, `