import type { JSONSchema } from "@vertesia/common";
import { TypeSignature } from "./type-signature.js";
export interface NodeUpdate {
    name?: string;
    type?: TypeSignature;
    isRequired?: boolean;
    editor?: string | null;
    description?: string;
}
interface SchemaLoader {
    reload(): void;
}
export interface SchemaSource {
    uri: string;
    name: string;
}
export declare class ManagedSchema implements SchemaLoader {
    source?: SchemaSource;
    onChange: (schema: ManagedSchema) => void;
    schema: JSONSchema;
    root: SchemaNode;
    constructor(schema?: string | JSONSchema | null | undefined, title?: string);
    get isEmpty(): boolean;
    get children(): SchemaNode[];
    reload(): this;
    withSource(name: string, uri: string): this;
    withChangeListener(cb: (schema: ManagedSchema) => void): this;
    replaceSchema(schema: JSONSchema | null): void;
    clone(): ManagedSchema;
}
export declare class SchemaNode {
    schema: JSONSchema;
    loader: SchemaLoader;
    parent?: SchemaNode;
    name: string;
    isRequired: boolean;
    type: TypeSignature;
    children?: SchemaNode[];
    constructor(name: string, schema: JSONSchema, loader: SchemaLoader, parent?: SchemaNode);
    get title(): string | undefined;
    set title(value: string | undefined);
    get description(): string | undefined;
    set description(value: string | undefined);
    get isParent(): boolean;
    get isNew(): boolean;
    set isNew(value: boolean);
    resetIsNew(): boolean;
    getNameSignature(): string;
    getTypeSignature(): string;
    getSignature(): string;
    reloadTree(): void;
    loadChildren(): void;
    _loadChildren(properties: Record<string, JSONSchema>): void;
    _getPropertiesSchema(): JSONSchema;
    findAvailableChildName(prefix: string): string;
    /**
     * Add a new child node
     */
    addChild(name: string, type: TypeSignature, isRequired?: boolean): SchemaNode;
    /**
     * Remove this node
     */
    remove(): boolean;
    update(data: NodeUpdate): boolean;
    getUpdateFromNameAndTypeSignature(nameSig: string, typeSig: string): {
        name: string;
        type: TypeSignature;
        isRequired: boolean;
        editor: string | null;
    };
    updateFromNameAndTypeSignature(nameSig: string, typeSig: string): boolean;
    updateFromSignature(text: string): boolean;
}
export {};
//# sourceMappingURL=ManagedSchema.d.ts.map