import { PluginReceiver } from '../editor/plugin/receiver.js';
import { Runner } from '../editor/runner.js';
import { Plugin, PluginLifecycleStep } from '../editor/plugin.js';
import { OutputViewProvider, IOutputProvider } from './index.js';
import { IResources } from './resources.js';
import { PartsManager } from '../parts/manager.js';
import { Part } from '../parts/part.js';
import { Microphone } from './microphone.js';
import { IEvent } from '@kano/common/index.js';
import { AppModuleConstructor } from '../app-modules/app-modules.js';
export interface IOutputProfile {
    id: string;
    onInstall?(output: Output): void;
    onInject(): void;
    modules?: AppModuleConstructor[];
    plugins?: Plugin[];
    parts?: (typeof Part)[];
    outputViewProvider?: OutputViewProvider;
}
export interface IVisualsContext {
    canvas: HTMLCanvasElement;
    width: number;
    height: number;
}
export interface IAudioContext {
    context: AudioContext;
    destination: AudioDestinationNode;
    microphone: Microphone;
}
export interface IDOMContext {
    root: HTMLElement;
    onDidResize: IEvent<void>;
}
export declare type IConfigResolver = <T>(key: string) => T | null;
export declare const OutputConfig: {
    get<T>(key: string, fallback: T): T;
};
export declare class Output extends PluginReceiver {
    runner: Runner;
    private _running;
    private _fullscreen;
    private _code;
    private _loading?;
    private _queuedStart;
    parts: PartsManager;
    outputViewProvider?: IOutputProvider;
    outputProfile?: IOutputProfile;
    outputResources?: IResources;
    readonly visuals: IVisualsContext;
    readonly audio: IAudioContext;
    readonly dom: IDOMContext;
    readonly resources: IResources;
    private _onDidRunningStateChange;
    readonly onDidRunningStateChange: IEvent<boolean>;
    private _onDidFullscreenChange;
    readonly onDidFullscreenChange: IEvent<boolean>;
    static readonly config: {
        get<T>(key: string, fallback: T): T;
    };
    /**
     * Set the global configuration resolver
     * @param resolver A configuration resolver
     */
    static setConfigResolver(resolver: IConfigResolver): void;
    constructor();
    runPluginTask(taskName: PluginLifecycleStep, ...args: any[]): void;
    addPart(partClass: typeof Part): void;
    addPlugin(plugin: Plugin): void;
    registerOutputViewProvider(provider: OutputViewProvider): void;
    registerProfile(outputProfile?: IOutputProfile): void;
    registerResources(resources: IResources): void;
    ensureOutputView(): void;
    setRunningState(running: boolean): void;
    getRunningState(): boolean;
    toggleRunningState(): void;
    setFullscreen(state: boolean): void;
    getFullscreen(): boolean;
    toggleFullscreen(): void;
    restart(): void;
    setCode(code?: string): void;
    getCode(): string;
    readonly id: string;
    readonly outputView: IOutputProvider | undefined;
    onInject(): void;
    onExport(data: any): any;
    onImport(data: any): void;
    onCreationExport(data: any): any;
    onCreationImport(data: any): Promise<void>;
    render(...args: any[]): any;
    dispose(): void;
}
export default Output;
