import { Node as ProsemirrorNode } from "prosemirror-model"; export interface StackSnippetOptions { /** The async function to render the preview */ renderer: (meta: SnippetMetadata, js?: string, css?: string, html?: string) => Promise; /** Function to trigger opening of the snippets Modal */ openSnippetsModal: (updateDocumentCallback: (markdown: string, id?: SnippetMetadata["id"]) => void, meta?: SnippetMetadata, js?: string, css?: string, html?: string) => void; /** Function to handle any required marshalling of components to render fullscreen correctly */ onFullscreenExpand?: () => void; /** Function to handle any required marshalling of components to return from fullscreen correctly */ onFullscreenReturn?: () => void; } export interface SnippetMetadata { id: string; hide: string; console: string; babel: string; babelPresetReact: string; babelPresetTS: string; langNodes: LanguageNode[]; } export interface LanguageMetadata { language: string; } export interface LanguageNode { metaData: LanguageMetadata; content: string; } export declare const assertAttrValue: (node: ProsemirrorNode, attrName: string) => string; export declare const getSnippetMetadata: (node: ProsemirrorNode) => SnippetMetadata | null; export declare const validSnippetRegex: RegExp; export interface RawContext { line: string; index: number; } interface BaseMetaLine { type: "begin" | "end" | "lang"; index: number; } export interface BeginMetaLine extends BaseMetaLine { type: "begin"; babel: string; babelPresetReact: string; babelPresetTS: string; console: string; hide: string; } export interface EndMetaLine extends BaseMetaLine { type: "end"; } export interface LangMetaLine extends BaseMetaLine { type: "lang"; language: string; } export type MetaLine = BeginMetaLine | EndMetaLine | LangMetaLine; export declare const mapMetaLine: (rawContext: RawContext) => MetaLine | null; interface ValidationResult { valid: boolean; beginIndex?: number; endIndex?: number; htmlIndex?: number; cssIndex?: number; jsIndex?: number; reason?: string; } export declare const validateMetaLines: (metaLines: MetaLine[]) => ValidationResult; export {};