import { KoenigDecoratorNode } from './KoenigDecoratorNode.js';
import type { ExportDOMOptions, ExportDOMOutput } from './export-dom.js';
import type { LexicalEditor } from 'lexical';
import type { Visibility } from './utils/visibility.js';
type RenderFn<TOutput extends ExportDOMOutput = ExportDOMOutput> = (node: any, options: ExportDOMOptions) => TOutput;
type VersionedRenderFn<TOutput extends ExportDOMOutput = ExportDOMOutput> = Record<string | number, RenderFn<TOutput>>;
type WidenLiteral<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends readonly (infer U)[] ? U[] : T;
/**
 * @typedef {Object} DecoratorNodeProperty
 * @property {string} name - The property's name.
 * @property {*} default - The property's default value
 * @property {('url'|'html'|'markdown'|null)} urlType - If the property contains a URL, the URL's type: 'url', 'html' or 'markdown'. Use 'url' is the property contains only a URL, 'html' or 'markdown' if the property contains HTML or markdown code, that may contain URLs.
 * @property {boolean} wordCount - Whether the property should be counted in the word count
 *
 * @param {string} nodeType – The node's type (must be unique)
 * @param {DecoratorNodeProperty[]} properties - An array of properties for the generated class
 * @param {boolean} hasVisibility - Whether to add a visibility property to the node
 * @param {Function} defaultRenderFn - A function that returns a @tryghost/kg-lexical-html-renderer compatible object, e.g. {element: Div, type: 'inner}
 * @returns {Object} - The generated class.
 */
export interface DecoratorNodeProperty<Name extends string = string, Default = unknown> {
    name: Name;
    default: Default;
    urlType?: string;
    urlPath?: string;
    wordCount?: boolean;
    privateName?: string;
}
export type DecoratorNodeValueMap<Props extends readonly DecoratorNodeProperty[], HasVisibility extends boolean = false> = {
    [Prop in Props[number] as Prop['name']]: WidenLiteral<Prop['default']>;
} & (HasVisibility extends true ? {
    visibility: Visibility;
} : {});
export type DecoratorNodeData<Props extends readonly DecoratorNodeProperty[], HasVisibility extends boolean = false> = Partial<DecoratorNodeValueMap<Props, HasVisibility>>;
type GeneratedDecoratorNodeInstance<TDataset extends Record<string, unknown>, TOutput extends ExportDOMOutput = ExportDOMOutput> = GeneratedDecoratorNodeBase<TDataset> & TDataset & {
    exportDOM(editor: LexicalEditor, options?: ExportDOMOptions): TOutput;
};
export interface GeneratedDecoratorNodeClass<TDataset extends Record<string, unknown>, TOutput extends ExportDOMOutput = ExportDOMOutput> {
    new (data?: Partial<TDataset>, key?: string): GeneratedDecoratorNodeInstance<TDataset, TOutput>;
    prototype: GeneratedDecoratorNodeInstance<TDataset, TOutput>;
    getType(): string;
    clone(node: GeneratedDecoratorNodeInstance<TDataset, TOutput>): GeneratedDecoratorNodeInstance<TDataset, TOutput>;
    transform(): null;
    getPropertyDefaults(): TDataset;
    readonly urlTransformMap: Record<string, string | Record<string, string>>;
    importJSON(serializedNode: Record<string, unknown>): GeneratedDecoratorNodeInstance<TDataset, TOutput>;
}
export declare class GeneratedDecoratorNodeBase<TDataset extends Record<string, unknown> = Record<string, unknown>> extends KoenigDecoratorNode {
    [key: string]: unknown;
    constructor(data?: Partial<TDataset>, key?: string);
    getDataset(): Record<string, unknown>;
    exportJSON(): {
        type: string;
        version: number;
        [key: string]: unknown;
    };
    static getPropertyDefaults(): Record<string, unknown>;
    static get urlTransformMap(): Record<string, string | Record<string, string>>;
    static importJSON(_serializedNode: Record<string, unknown>): GeneratedDecoratorNodeBase<Record<string, unknown>>;
    static transform(): null;
    isKoenigCard(): true;
    hasDynamicData(): boolean;
    hasEditMode(): boolean;
    getIsVisibilityActive(): boolean;
}
export declare function generateDecoratorNode<Props extends readonly DecoratorNodeProperty[] = readonly [], HasVisibility extends boolean = false, TOutput extends ExportDOMOutput = ExportDOMOutput>({ nodeType, properties, defaultRenderFn, version, hasVisibility }: {
    nodeType: string;
    properties?: Props;
    defaultRenderFn?: RenderFn<TOutput> | VersionedRenderFn<TOutput>;
    version?: number;
    hasVisibility?: HasVisibility;
}): GeneratedDecoratorNodeClass<DecoratorNodeValueMap<Props, HasVisibility>, TOutput>;
export {};
//# sourceMappingURL=generate-decorator-node.d.ts.map