import { ComponentType } from 'react';
import { GeneralField, ISchema, Query, Schema } from '@tachybase/schema';
import { APIClient } from '../../api-client';
interface CreateDesignableProps {
    current: Schema;
    model?: GeneralField;
    query?: Query;
    api?: APIClient;
    refresh?: () => void;
    onSuccess?: any;
    t?: any;
}
export declare function createDesignable(options: CreateDesignableProps): Designable;
/**
 *
 */
type Position = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd';
interface InsertAdjacentOptions {
    wrap?: (s: ISchema) => ISchema;
    removeParentsIfNoChildren?: boolean;
    breakRemoveOn?: ISchema | BreakFn;
    onSuccess?: any;
}
type BreakFn = (s: ISchema) => boolean;
interface RemoveOptions {
    removeParentsIfNoChildren?: boolean;
    breakRemoveOn?: ISchema | BreakFn;
}
interface RecursiveRemoveOptions {
    breakRemoveOn?: ISchema | BreakFn;
}
export declare const splitWrapSchema: (wrapped: Schema, schema: ISchema) => any[];
export declare class Designable {
    current: Schema;
    options: CreateDesignableProps;
    events: {};
    constructor(options: CreateDesignableProps);
    get model(): GeneralField;
    get query(): Query;
    loadAPIClientEvents(): void;
    prepareProperty(schema: ISchema): void;
    on(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', listener: any): void;
    emit(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', ...args: any[]): Promise<any>;
    parentsIn(schema: Schema): boolean;
    refresh(): void;
    deepMerge(schema: ISchema): void;
    getSchemaAttribute(key: string | string[], defaultValue?: any): any;
    shallowMerge(schema: ISchema): void;
    updateModel(key: any, value: any): void;
    insertAdjacent(position: Position, schema: ISchema, options?: InsertAdjacentOptions): void | Promise<any>;
    recursiveRemoveIfNoChildren(schema?: Schema, options?: RecursiveRemoveOptions): Schema<any, any, any, any, any, any, any, any, any>;
    remove(schema?: Schema, options?: RemoveOptions): Promise<any>;
    removeWithoutEmit(schema?: Schema, options?: RemoveOptions): Schema<any, any, any, any, any, any, any, any, any>;
    insertBeforeBeginOrAfterEnd(schema: ISchema, options?: InsertAdjacentOptions): void;
    /**
     * Before the current schema itself.
     */
    insertBeforeBegin(schema: ISchema, options?: InsertAdjacentOptions): void;
    /**
     * Just inside the current schema, before its first child.
     *
     * @param schema
     * @returns
     */
    insertAfterBegin(schema: ISchema, options?: InsertAdjacentOptions): void;
    /**
     * Just inside the targetElement, after its last child.
     *
     * @param schema
     * @returns
     */
    insertBeforeEnd(schema: ISchema, options?: InsertAdjacentOptions): Promise<any>;
    /**
     * After the current schema itself.
     */
    insertAfterEnd(schema: ISchema, options?: InsertAdjacentOptions): void;
}
export declare function useFindComponent(): (component: string | ComponentType) => any;
export declare function useDesignable(): {
    dn: Designable;
    designable: boolean;
    reset: () => void;
    refresh: () => void;
    setDesignable: (value: boolean) => void;
    DesignableBar: () => import("react/jsx-runtime").JSX.Element;
    findComponent: (component: any) => any;
    on: any;
    patch: (key: ISchema | string, value?: any) => void;
    shallowMerge: (schema: ISchema) => void;
    deepMerge: (schema: ISchema) => void;
    remove: (schema?: any, options?: RemoveOptions) => void;
    insertAdjacent: (position: Position, schema: ISchema, options?: InsertAdjacentOptions) => void;
    insertBeforeBegin: (schema: ISchema) => void;
    insertAfterBegin: (schema: ISchema) => void;
    insertBeforeEnd: (schema: ISchema) => void;
    insertAfterEnd: (schema: ISchema) => void;
};
export {};
