import { NgeMarkdownCodeActionProvider, NgeMarkdownFeature } from '@cisstech/nge/markdown'; /** * Options for opening fenced code in [StackBlitz](https://stackblitz.com). The * author owns the project scaffold (files and dependencies); the fenced snippet * is injected at {@link file}, so the example is whatever the author configures, * not a fragile generated one. */ interface NgeMarkdownStackblitzOptions { /** * Path the fenced snippet is written to in the project, e.g. `src/main.ts`. */ file: string; /** * StackBlitz template. `node` (default) runs a real npm project in * WebContainers, with dependencies declared in the `package.json` file. * EngineBlock templates (`angular-cli`, `typescript`...) use `dependencies`. */ template?: 'node' | 'angular-cli' | 'typescript' | 'javascript' | 'create-react-app' | 'vue' | 'html' | 'polymer'; /** Project title shown in StackBlitz. */ title?: string; /** Project description. */ description?: string; /** Scaffold files (package.json, index.html, ...), by path. The snippet is added to `file`. */ files?: Record; /** npm dependencies for EngineBlock templates; ignored for `node` (use `package.json`). */ dependencies?: Record; /** File opened in the editor. Default: {@link file}. */ openFile?: string; } /** A StackBlitz project payload plus the file to open, ready for the SDK. */ interface StackblitzProject { project: { title: string; description?: string; template: string; files: Record; dependencies?: Record; }; openFile: string; } /** Assembles the StackBlitz project from the scaffold and the snippet. Pure and testable. */ declare function buildStackblitzProject(code: string, options: NgeMarkdownStackblitzOptions): StackblitzProject; /** Opens the snippet in StackBlitz. Loads the SDK lazily, so it never ships in the initial bundle. */ declare function openInStackblitz(code: string, options: NgeMarkdownStackblitzOptions): Promise; /** * The "Open in StackBlitz" toolbar action, added to blocks flagged with the * `stackblitz` fence keyword. Contributed through the markdown code-action token * so the highlighter never references the StackBlitz SDK. */ declare function stackblitzCodeActionProvider(options: NgeMarkdownStackblitzOptions): NgeMarkdownCodeActionProvider; /** * Add an "Open in StackBlitz" action to fenced blocks marked with the * `stackblitz` flag. The snippet is injected into the project scaffold you * configure here (files and dependencies), so the example runs exactly as you * set it up. * * Import from `@cisstech/nge/markdown/stackblitz`: the StackBlitz SDK lives * behind this entry point, so only apps that use this feature pull it in and * need the `@stackblitz/sdk` dependency. */ declare function withStackblitz(options: NgeMarkdownStackblitzOptions): NgeMarkdownFeature; export { buildStackblitzProject, openInStackblitz, stackblitzCodeActionProvider, withStackblitz }; export type { NgeMarkdownStackblitzOptions, StackblitzProject };