import React, { ComponentType, ReactElement } from 'react';
import { type RequireJS } from '@tachybase/requirejs';
import { APIClientOptions } from '@tachybase/sdk';
import { i18n as i18next } from 'i18next';
import { APIClient } from '../api-client';
import { CollectionFieldInterfaceComponentOption } from '../data-source';
import { DataSourceManager, type DataSourceManagerOptions } from '../data-source/data-source/DataSourceManager';
import { AttachmentPreviewManager, PluginAttachmentItemsOptions } from './AttachmentPreviewManager';
import { NoticeManager } from './NoticesManager';
import type { Plugin } from './Plugin';
import { PluginContextMenu, PluginItemsOptions } from './PluginContextMenu';
import { PluginManager, PluginType } from './PluginManager';
import { ComponentTypeAndString, RouterManager, RouterOptions } from './RouterManager';
import { SchemaInitializer, SchemaInitializerManager } from './schema-initializer';
import { SchemaSettings, SchemaSettingsManager } from './schema-settings';
import { PluginSettingOptions, SystemSettingsManager } from './SystemSettingsManager';
import { TrackingManager } from './TrackingManager';
import { UserSettingOptions, UserSettingsManager } from './UserSettingsManager';
import { WebSocketClient, WebSocketClientOptions } from './WebSocketClient';
declare global {
    interface Window {
        define: RequireJS['define'];
        require: RequireJS['require'];
        Sentry?: any;
    }
}
export type DevDynamicImport = (packageName: string) => Promise<{
    default: typeof Plugin;
}>;
export type ComponentAndProps<T = any> = [ComponentType, T];
export interface ApplicationOptions {
    name?: string;
    publicPath?: string;
    apiClient?: APIClientOptions | APIClient;
    ws?: WebSocketClientOptions | boolean;
    i18n?: i18next;
    providers?: (ComponentType | ComponentAndProps)[];
    plugins?: PluginType[];
    components?: Record<string, ComponentType>;
    scopes?: Record<string, any>;
    router?: RouterOptions;
    pluginSettings?: Record<string, PluginSettingOptions>;
    userSettings?: Record<string, UserSettingOptions>;
    schemaSettings?: SchemaSettings[];
    schemaInitializers?: SchemaInitializer[];
    designable?: boolean;
    loadRemotePlugins?: boolean;
    devDynamicImport?: DevDynamicImport;
    dataSourceManager?: DataSourceManagerOptions;
    pluginMenuItems?: Record<string, PluginItemsOptions>;
    attachmentItem?: Record<string, PluginAttachmentItemsOptions>;
}
export declare class Application {
    protected options: ApplicationOptions;
    providers: ComponentAndProps[];
    router: RouterManager;
    scopes: Record<string, any>;
    i18n: i18next;
    ws: WebSocketClient;
    apiClient: APIClient;
    components: Record<string, ComponentType<any> | any>;
    pluginManager: PluginManager;
    systemSettingsManager: SystemSettingsManager;
    userSettingsManager: UserSettingsManager;
    devDynamicImport: DevDynamicImport;
    requirejs: RequireJS;
    notification: any;
    schemaInitializerManager: SchemaInitializerManager;
    schemaSettingsManager: SchemaSettingsManager;
    dataSourceManager: DataSourceManager;
    noticeManager: NoticeManager;
    trackingManager: TrackingManager;
    pluginContextMenu: PluginContextMenu;
    AttachmentPreviewManager: AttachmentPreviewManager;
    name: string;
    globalVars: Record<string, any>;
    loading: boolean;
    maintained: boolean;
    maintaining: boolean;
    error: any;
    get pm(): PluginManager;
    get adminUrl(): string;
    constructor(options?: ApplicationOptions);
    private initRequireJs;
    private addDefaultProviders;
    private addReactRouterComponents;
    private addRoutes;
    getOptions(): ApplicationOptions;
    getPublicPath(): string;
    getName(): string;
    getApiUrl(pathname?: string): string;
    getRouteUrl(pathname: string): string;
    getHref(pathname: string): string;
    getCollectionManager(dataSource?: string): import("..").CollectionManager;
    /**
     * @internal
     */
    getComposeProviders(): React.FC;
    use<T = any>(component: ComponentType, props?: T): number;
    addProvider<T = any>(component: ComponentType, props?: T): number;
    addProviders(providers: (ComponentType | [ComponentType, any])[]): void;
    load(): Promise<void>;
    getComponent<T = any>(Component: ComponentTypeAndString<T>, isShowError?: boolean): ComponentType<T> | undefined;
    renderComponent<T extends {}>(Component: ComponentTypeAndString, props?: T): ReactElement;
    /**
     * @internal use addComponents({ SomeComponent }) instead
     */
    protected addComponent(component: ComponentType, name?: string): void;
    addComponents(components: Record<string, ComponentType>): void;
    addScopes(scopes: Record<string, any>): void;
    getRootComponent(): () => import("react/jsx-runtime").JSX.Element;
    mount(containerOrSelector: Element | ShadowRoot | string): import("react-dom/client").Root;
    addFieldInterfaceComponentOption(fieldName: string, componentOption: CollectionFieldInterfaceComponentOption): void;
    addGlobalVar(key: string, value: any): void;
    getGlobalVar(key: any): any;
}
