//#region src/static/types.generated.d.ts
/** Attribute types for all Tiptap node extensions */
interface TiptapNodeAttributes {
  paragraph: {
    textAlign?: 'left' | 'center' | 'right' | 'justify' | null;
  };
  doc: Record<string, never>;
  text: Record<string, never>;
  blockquote: Record<string, never>;
  heading: {
    textAlign?: 'left' | 'center' | 'right' | 'justify' | null;
    level?: 1 | 2 | 3 | 4 | 5 | 6;
  };
  bullet_list: Record<string, never>;
  ordered_list: {
    start?: unknown;
    type?: unknown;
    order?: number;
  };
  list_item: Record<string, never>;
  code_block: {
    class?: string | null;
  };
  hard_break: Record<string, never>;
  horizontal_rule: Record<string, never>;
  image: {
    src?: string;
    alt?: string;
    title?: string | null;
    width?: number | string | null;
    height?: number | string | null;
  };
  emoji: {
    name?: string | null;
  };
  table: Record<string, never>;
  tableRow: Record<string, never>;
  tableCell: {
    colspan?: number;
    rowspan?: number;
    colwidth?: number[] | null;
    align?: unknown;
    backgroundColor?: string | null;
  };
  tableHeader: {
    colspan?: number;
    rowspan?: number;
    colwidth?: number[] | null;
    align?: unknown;
  };
  blok: {
    id?: string | null;
    body?: SbBlokData[];
  };
  details: Record<string, never>;
  detailsContent: Record<string, never>;
  detailsSummary: Record<string, never>;
}
/** Attribute types for all Tiptap mark extensions */
interface TiptapMarkAttributes {
  link: {
    href?: string;
    uuid?: string;
    anchor?: string;
    target?: '_self' | '_blank' | '_parent' | '_top' | null;
    linktype?: 'url' | 'story' | 'asset' | 'email';
    custom?: Record<string, string | null>;
  };
  bold: Record<string, never>;
  italic: Record<string, never>;
  strike: Record<string, never>;
  underline: Record<string, never>;
  code: Record<string, never>;
  superscript: Record<string, never>;
  subscript: Record<string, never>;
  highlight: {
    color?: string | null;
  };
  textStyle: {
    class?: string | null;
    id?: string | null;
    color?: string | null;
  };
  anchor: {
    id?: string | null;
  };
  styled: {
    class?: string | null;
  };
  reporter: Record<string, never>;
}
type TiptapNodeName = keyof TiptapNodeAttributes;
type TiptapMarkName = keyof TiptapMarkAttributes;
type TiptapComponentName = Exclude<TiptapNodeName | TiptapMarkName, 'text'>;
type PMNode = {
  type: 'paragraph';
  attrs?: TiptapNodeAttributes['paragraph'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'doc';
  attrs?: TiptapNodeAttributes['doc'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'text';
  attrs?: TiptapNodeAttributes['text'];
  content?: PMNode[];
  marks?: PMMark[];
  text: string;
} | {
  type: 'blockquote';
  attrs?: TiptapNodeAttributes['blockquote'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'heading';
  attrs?: TiptapNodeAttributes['heading'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'bullet_list';
  attrs?: TiptapNodeAttributes['bullet_list'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'ordered_list';
  attrs?: TiptapNodeAttributes['ordered_list'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'list_item';
  attrs?: TiptapNodeAttributes['list_item'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'code_block';
  attrs?: TiptapNodeAttributes['code_block'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'hard_break';
  attrs?: TiptapNodeAttributes['hard_break'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'horizontal_rule';
  attrs?: TiptapNodeAttributes['horizontal_rule'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'image';
  attrs?: TiptapNodeAttributes['image'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'emoji';
  attrs?: TiptapNodeAttributes['emoji'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'table';
  attrs?: TiptapNodeAttributes['table'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'tableRow';
  attrs?: TiptapNodeAttributes['tableRow'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'tableCell';
  attrs?: TiptapNodeAttributes['tableCell'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'tableHeader';
  attrs?: TiptapNodeAttributes['tableHeader'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'blok';
  attrs?: TiptapNodeAttributes['blok'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'details';
  attrs?: TiptapNodeAttributes['details'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'detailsContent';
  attrs?: TiptapNodeAttributes['detailsContent'];
  content?: PMNode[];
  marks?: PMMark[];
} | {
  type: 'detailsSummary';
  attrs?: TiptapNodeAttributes['detailsSummary'];
  content?: PMNode[];
  marks?: PMMark[];
};
type PMMark = {
  type: 'link';
  attrs?: TiptapMarkAttributes['link'];
} | {
  type: 'bold';
  attrs?: TiptapMarkAttributes['bold'];
} | {
  type: 'italic';
  attrs?: TiptapMarkAttributes['italic'];
} | {
  type: 'strike';
  attrs?: TiptapMarkAttributes['strike'];
} | {
  type: 'underline';
  attrs?: TiptapMarkAttributes['underline'];
} | {
  type: 'code';
  attrs?: TiptapMarkAttributes['code'];
} | {
  type: 'superscript';
  attrs?: TiptapMarkAttributes['superscript'];
} | {
  type: 'subscript';
  attrs?: TiptapMarkAttributes['subscript'];
} | {
  type: 'highlight';
  attrs?: TiptapMarkAttributes['highlight'];
} | {
  type: 'textStyle';
  attrs?: TiptapMarkAttributes['textStyle'];
} | {
  type: 'anchor';
  attrs?: TiptapMarkAttributes['anchor'];
} | {
  type: 'styled';
  attrs?: TiptapMarkAttributes['styled'];
} | {
  type: 'reporter';
  attrs?: TiptapMarkAttributes['reporter'];
};
//#endregion
//#region src/static/types.d.ts
/** Valid attribute values for DOM elements */
type AttrValue = string | number | boolean;
type HtmlTag = keyof HTMLElementTagNameMap;
interface SbBlokData {
  _key: string;
  component: string;
  [otherKey: string]: unknown;
}
interface RenderSpec {
  tag: string;
  attrs?: Record<string, AttrValue> & {
    style?: string;
  };
  content?: boolean;
  children?: RenderSpec[];
  resolve?: (attrs: unknown) => string;
}
/** Canonical type for a Storyblok RichText JSON root */
type StoryblokRichTextJson = PMNode;
/** Base props for node/mark components */
type RichTextBaseProps<T extends TiptapComponentName> = T extends PMNode['type'] ? Extract<PMNode, {
  type: T;
}> : T extends PMMark['type'] ? Extract<PMMark, {
  type: T;
}> : never;
/** Typed override map for node/mark components */
type RichTextComponentProps<T extends TiptapComponentName, TComponent = unknown, ExtraProps extends Record<string, unknown> = Record<string, never>> = RichTextBaseProps<T> & ExtraProps & {
  components?: StoryblokRichTextComponentMap<TComponent, ExtraProps>;
};
type StoryblokRichTextComponentMap<TComponent = unknown, ExtraProps extends Record<string, unknown> = Record<string, never>> = { [K in TiptapComponentName]?: (props: RichTextComponentProps<K, TComponent, ExtraProps>) => TComponent };
//#endregion
//#region src/static/attribute.d.ts
type AttrMap = Record<string, string>;
/**
 * Process Tiptap attributes into HTML attributes and inline styles.
 * Applies internal style mappings and allows extending or overriding
 * default attribute mappings via `extendAttrMap`.
 *
 * @param type - {@link TiptapComponentName}
 * @param attrs - Attributes from the node/mark
 * @param extendAttrMap - {@link AttrMap} Additional attribute mappings (overrides defaults)
 * @returns Processed attributes with optional `style` object
 */
declare function processAttrs(type: TiptapComponentName, attrs?: Record<string, unknown>, extendAttrMap?: AttrMap): {
  style?: Record<string, AttrValue> | undefined;
};
//#endregion
//#region src/static/richtext-renderer.d.ts
/**
 * Renders a Storyblok RichText JSON document to an HTML string.
 *
 * This is a framework-agnostic static renderer that supports Storyblok
 * richtext nodes and marks, applies attributes and styles, and safely
 * escapes text content. `blok` nodes are not rendered and will log a warning.
 *
 * @param document - The Storyblok RichText JSON document to render
 * @returns The rendered HTML string
 *  @example
 * ```ts
 * const html = richTextRenderer({
 *   type: 'doc',
 *   content: [
 *     {
 *       type: 'paragraph',
 *       content: [
 *         { type: 'text', text: 'Hello World' }
 *       ]
 *     }
 *   ]
 * });
 *
 * console.log(html);
 * // <p>Hello World</p>
 * ```
 */
declare function richTextRenderer(document: StoryblokRichTextJson): string;
//#endregion
//#region src/static/style.d.ts
/**
 * Converts a style object to a CSS string.
 * @param style - The style object to convert.
 * @returns A CSS string representation of the style object.
 * @example
 * const styleObj = { color: 'red', fontSize: '16px' };
 * const cssString = styleToString(styleObj);
 * console.log(cssString); // Output: "color: red; font-size: 16px"
 */
declare function styleToString(style: Record<string, AttrValue>): string;
/**
 * Converts a CSS string to a style object.
 * @param style - The CSS string to convert.
 * @returns A style object representation of the CSS string.
 * @example
 * const cssString = "color: red; font-size: 16px";
 * const styleObj = stringToStyle(cssString);
 * console.log(styleObj); // Output: { color: 'red', fontSize: '16px' }
 */
declare function stringToStyle(style: string): Record<string, string>;
//#endregion
//#region src/static/util.d.ts
/**
 * Resolves a component from the provided components map based on the type.
 * @param type - The type of the component to resolve.
 * @param components - The components map to search in.
 * @returns The resolved component or undefined if not found.
 * @example
 * const components = {
 *   'heading': MyCustomHeading,
 * };
 * const resolvedComponent = resolveComponent('heading', components);
 * console.log(resolvedComponent); // Output: MyCustomHeading
 */
declare function resolveComponent<K extends TiptapComponentName, TComponent, ExtraProps extends Record<string, unknown> = Record<string, unknown>>(type: K, components?: StoryblokRichTextComponentMap<TComponent, ExtraProps>): StoryblokRichTextComponentMap<TComponent, ExtraProps>[K] | undefined;
/**
 * Resolves the HTML tag for a given Richtext node or mark.
 * @param node - The Richtext node or mark to resolve the tag for.
 * @returns The resolved HTML tag as a string, or null if no tag could be resolved.
 * @example
 * const node = { type: 'paragraph', attrs: {} };
 * const tag = resolveTag(node);
 * console.log(tag); // Output: "p"
 */
declare function resolveTag(node: PMNode | PMMark): HtmlTag | null;
/**
 * Checks if a given HTML tag is self-closing.
 * @param tag - The HTML tag to check.
 * @returns True if the tag is self-closing, false otherwise.
 * @example
 * console.log(isSelfClosing('img')); // Output: true
 * console.log(isSelfClosing('div')); // Output: false
 *
 */
declare function isSelfClosing(tag: HtmlTag | string): boolean;
/**
 * Returns static child definitions for a given RichText node.
 *
 * @param node - The RichText node
 * @returns Static child render specs, or null if none exist
 *
 * @example
 * const children = getStaticChildren({ type: 'table', attrs: {} });
 * // [{ tag: 'tbody', content: true }]
 */
declare function getStaticChildren(node: PMNode): readonly [{
  readonly tag: "code";
  readonly content: true;
}] | readonly [{
  readonly tag: "img";
  readonly attrs: {
    readonly style: "width: 1.25em; height: 1.25em; vertical-align: text-top";
    readonly draggable: "false";
    readonly loading: "lazy";
  };
}] | readonly [{
  readonly tag: "tbody";
  readonly content: true;
}] | null;
//#endregion
export { type PMMark, type PMNode, type RenderSpec, type RichTextComponentProps, type StoryblokRichTextComponentMap, type StoryblokRichTextJson, type TiptapComponentName, getStaticChildren, isSelfClosing, processAttrs, resolveComponent, resolveTag, richTextRenderer, stringToStyle, styleToString };
//# sourceMappingURL=static.d.cts.map