import { API } from './API';
import { Graph } from './Class/Graph';
import { Component } from './client/component';
import { Context } from './client/context';
import { IOPointerEvent } from './client/event/pointer';
import { Store } from './client/store';
import { Theme } from './client/theme';
import { Point } from './client/util/geometry';
import { EventEmitter } from './EventEmitter';
import { Object_ } from './Object';
import { SharedObject } from './SharedObject';
import { Style } from './system/platform/Props';
import { Classes, GraphSpec, GraphSpecs, Specs } from './types';
import { BundleSpec } from './types/BundleSpec';
import { Dict } from './types/Dict';
import { IChannel, IChannelOpt } from './types/global/IChannel';
import { IGamepad } from './types/global/IGamepad';
import { IHTTPServer, IHTTPServerOpt } from './types/global/IHTTPServer';
import { IKeyboard } from './types/global/IKeyboard';
import { IPointer } from './types/global/IPointer';
import { J } from './types/interface/J';
import { S } from './types/interface/S';
import { Unlisten } from './types/Unlisten';
declare global {
    interface FileSystemFileHandle {
        name: string;
        getFile(): any;
    }
}
export declare type IO_INIT<T, K> = (opt: K) => T;
export declare type IO_SYSTEM_INIT<T, K> = (system: System, opt: K) => T;
export declare type IO_HTTP_API<T> = {
    local: T;
    cloud: T;
};
export declare type IO_STORAGE_API<T> = {
    session: T;
    local: T;
};
export declare type IO_SERVICE_API<T> = {
    local: T;
    cloud: T;
    shared: T;
};
export declare type IO_HTTP_API_INIT<T, K> = IO_HTTP_API<IO_INIT<T, K>>;
export declare type IO_STORAGE_API_INIT<T, K> = IO_STORAGE_API<IO_INIT<T, K>>;
export declare type IO_SERVICE_API_INIT<T, K> = IO_SYSTEM_INIT<IO_SERVICE_API<T>, K>;
export declare type IOInput = {
    keyboard: IKeyboard;
    gamepad: Gamepad[];
};
export declare type IOMethod = Dict<Function>;
export declare type APIStorage = IO_STORAGE_API_INIT<J, undefined>;
export declare type APIHTTP = {
    server: IO_HTTP_API_INIT<IHTTPServer, IHTTPServerOpt>;
    fetch: (url: string, opt: RequestInit) => any;
};
export declare type APIChannel = IO_STORAGE_API_INIT<IChannel, IChannelOpt>;
export declare type APIAlert = {
    alert: (message: string) => void;
    prompt: (message: string) => string;
};
export interface System extends S {
    parent: System | null;
    path: string;
    emitter: EventEmitter;
    root: HTMLElement | null;
    customEvent: Set<string>;
    context: Context[];
    theme: Theme;
    animated: boolean;
    graphs: Graph[];
    cache: {
        dragAndDrop: Dict<any>;
        pointerCapture: Dict<any>;
        spriteSheetMap: Dict<boolean>;
    };
    feature: Dict<boolean>;
    foreground: {
        sprite?: SVGSVGElement;
        app?: HTMLElement;
        svg?: SVGSVGElement;
        canvas?: HTMLCanvasElement;
    };
    input: {
        keyboard: IKeyboard;
        gamepads: IGamepad[];
        pointers: Dict<IPointer>;
    };
    specs_: Object_<Specs>;
    specs: Specs;
    specsCount: Dict<number>;
    classes: Classes;
    components: ComponentClasses;
    global: {
        ref: Dict<any>;
        component: Dict<Component>;
    };
    api: API;
    boot: (opt: BootOpt) => System;
    injectPrivateCSSClass: (globalId: string, className: string, style: Style) => Unlisten;
    graph: IO_SYSTEM_INIT<SharedObject<Store<BundleSpec>, {}>, {}>;
    newSpecId: () => string;
    hasSpec: (id: string) => boolean;
    emptySpec: (partial?: Partial<GraphSpec>) => GraphSpec;
    newSpec: (spec: GraphSpec) => GraphSpec;
    getSpec: (id: string) => GraphSpec;
    getRemoteComponent: (id: string) => Component;
    setSpec: (id: string, spec: GraphSpec) => void;
    forkSpec: (spec: GraphSpec) => [string, GraphSpec];
    injectSpecs: (specs: GraphSpecs) => Dict<string>;
    registerComponent: (component: Component) => string;
    registerRemoteComponent: (globalId: string, remoteGlobalId: string) => void;
    registerUnit(id: string): void;
    unregisterUnit(id: string): void;
    showLongPress?: (screenX: number, screenY: number, opt: {
        stroke?: string;
        direction?: 'in' | 'out';
    }) => void;
    captureGesture?: (event: IOPointerEvent, opt: {
        lineWidth?: number;
        strokeStyle?: string;
    }, callback: (event: PointerEvent, track: Point[]) => void) => Unlisten;
}
export declare type IFilePickerOpt = {
    suggestedName?: string;
    startIn?: string;
    id?: string;
    excludeAcceptAllOption?: boolean;
    types?: {
        description: string;
        accept: Dict<string[]>;
    }[];
    multiple?: boolean;
};
export declare type ComponentClass<T = any> = {
    id: string;
    new ($props: T, $system: System): Component;
};
export declare type ComponentClasses = Dict<ComponentClass>;
export interface BootOpt {
    path?: string;
    specs?: GraphSpecs;
}
export declare const HTTPServer: (opt: IHTTPServerOpt) => IHTTPServer;
export declare const LocalChannel: (opt: IChannelOpt) => IChannel;
