//#region src/types.d.ts /** * Transform options for the Dathra transformer. */ interface TransformOptions { /** * Transformation mode. * - 'csr': Client-side rendering (default) * - 'ssr': Server-side rendering */ mode?: "csr" | "ssr"; /** * Whether to generate source maps. */ sourceMap?: boolean; /** * The file name for source map generation. */ filename?: string; /** * The module to import runtime functions from. * Default: '@dathra/runtime' */ runtimeModule?: string; } /** * Result of a transformation. */ interface TransformResult { /** * The transformed code. */ code: string; /** * Source map (if requested). */ map?: string; } //#endregion //#region src/transform/implementation.d.ts /** * Transform source code containing JSX. */ declare function transform(code: string, options?: TransformOptions): TransformResult; //#endregion //#region src/transform/ast/implementation.d.ts /** A generic ESTree node with a `type` discriminant. */ interface ESTNode { type: string; [key: string]: unknown; } /** ESTree Literal (string, number, boolean, null). */ //#endregion //#region src/ssr/implementation.d.ts /** * Runtime imports specific to SSR. */ declare const SSR_IMPORTS: readonly ["renderToString", "renderTree", "serializeState", "createMarker", "MarkerType"]; type SSRImport = (typeof SSR_IMPORTS)[number]; /** * Check if an import is an SSR-specific import. */ declare function isSSRImport(name: string): name is SSRImport; /** * Generate SSR render code for a tree. * * Produces: renderToString([tree], state, new Map([[1, v1], [2, v2], ...])) */ declare function generateSSRRender(tree: ESTNode, dynamicValues: ESTNode[], stateExpr: ESTNode | null): ESTNode; /** * Generate state object expression from Signals. */ declare function generateStateObject(signals: Map): ESTNode; //#endregion export { type SSRImport, SSR_IMPORTS, type TransformOptions, type TransformResult, generateSSRRender, generateStateObject, isSSRImport, transform }; //# sourceMappingURL=index.d.cts.map