/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import { GeneralField, Query } from '@formily/core';
import { ISchema, Schema } from '@formily/react';
import React, { ComponentType } from 'react';
import { APIClient } from '../../api-client';
interface CreateDesignableProps {
    current: Schema;
    model?: GeneralField;
    query?: Query;
    api?: APIClient;
    refresh?: (options?: {
        refreshParentSchema?: boolean;
    }) => void;
    onSuccess?: any;
    t?: any;
    /**
     * NocoBase 系统版本
     */
    appVersion?: string;
}
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;
    /**
     * NocoBase 系统版本
     */
    appVersion: string;
    events: {};
    constructor(options: CreateDesignableProps);
    get model(): GeneralField;
    get query(): Query;
    loadAPIClientEvents(): void;
    prepareProperty(schema: ISchema): void;
    on(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch' | 'initializeActionContext', listener: any): void;
    emit(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch' | 'initializeActionContext', ...args: any[]): Promise<any>;
    parentsIn(schema: Schema): boolean;
    refresh(options?: {
        refreshParentSchema?: boolean;
    }): 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: (options?: {
        refreshParentSchema?: boolean;
    }) => void;
    setDesignable: (value: boolean) => void;
    DesignableBar: () => React.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 {};
