/** * Compile generated source into Web and Native assets in an isolated Node.js process. * * @param source - Complete two-file source validated by {@link parseReactLynxSource}. * @param signal - Cancels queued or running compilation. * @param onStatus - Receives queue and compiler progress. * @returns Every emitted asset, including `main.web.js` and `main.lynx.js`. * @remarks Keep this entry external when bundling your server so its adjacent worker remains available. */ export declare function buildReactLynx(source: ReactLynxSource, signal: AbortSignal, onStatus: (status: ReactLynxBuildStatus) => void): Promise; /** Validate generated source and serialize it as canonical two-file JSON. */ export declare function normalizeReactLynxSource(text: string): string; /** * Parse JSON or a JSON code fence and validate the two-file source contract. * * @throws When JSON is invalid, files are missing or extra, or source limits are exceeded. */ export declare function parseReactLynxSource(text: string): ReactLynxSource; /** Model instructions for generating complete ReactLynx TSX and CSS source. */ export declare const REACTLYNX_SYSTEM_PROMPT = "Create or revise a complete ReactLynx interface.\nReturn only JSON: {\"files\":{\"App.tsx\":\"...\",\"App.css\":\"...\"}}. Encode newlines and quotes correctly.\nApp.tsx must default-export the App function component. The host supplies root.render(), imports App.css, and builds Web and Native bundles. Always return both complete files on edits.\nOnly import from @lynx-js/react. Do not provide package.json, build configuration, entrypoints, additional files, external modules, dynamic imports, require, or import.meta. Do not import the CSS; the host does that.\nFor example, use import { useState, useEffect } from '@lynx-js/react'; never import from 'react' or './App.css'. Define all components and helpers in App.tsx rather than importing local files or third-party libraries.\nOnly permitted module specifier is exactly '@lynx-js/react', with a hyphen between lynx and js. The spelling '@lynxjs/react' is invalid.\nUse Lynx elements: view, text, image and scroll-view. All text belongs inside text. Never use HTML elements, react-dom, browser DOM APIs or Node APIs.\nUse useState for interactions and bindtap/catchtap for taps, not onClick. Normal event handlers and useEffect run on the background thread. Keep side effects out of rendering; useLayoutEffect is unsupported.\nGive every layout container explicit display:flex and flex-direction. Box sizing is border-box. Use px, rem, vw and vh rather than rpx. A scroll-view needs scroll-y and a bounded height. Use deterministic local sample data.\nCSS must be plain CSS, without @import, external stylesheets or locally resolved assets. Do not use fetch, native bridges, eval, storage, parent windows, or scripted network access.\nImages may use only user/host supplied URLs or URLs returned by available image tools. Omit images if none are available. Use text and CSS for other visuals.\nBuild a polished, responsive and interactive interface that fits the requested content."; /** One emitted Web or Native build asset, ready for host-owned publication. */ export declare interface ReactLynxBuildAsset { /** Output-relative asset path with forward slashes. */ name: string; /** Complete emitted asset bytes. */ data: Buffer; } /** Build progress reported while waiting for a slot or running the compiler. */ export declare type ReactLynxBuildStatus = 'queued' | 'building'; /** Complete generated ReactLynx source containing only `App.tsx` and `App.css`. */ export declare interface ReactLynxSource { /** The complete component and stylesheet files. */ files: { /** Non-empty TSX source that default-exports the App function component. */ 'App.tsx': string; /** Plain CSS loaded by the host entry point; may be empty. */ 'App.css': string; }; } export { }