/// <reference path="../../../../src/@types/@kano/common/index.d.ts" />
import { IPartAPI } from './api.js';
import { IAPIDefinition } from '../meta-api/module.js';
import { Part } from './part.js';
import Editor from '../editor/editor.js';
import { ToolboxEntry, IToolboxWhitelist } from '../editor/toolbox.js';
import { QueryEngine } from '../editor/selector/selector.js';
import { IPartsControlsEntry } from '../../elements/kc-workspace-frame/kc-parts-controls.js';
declare type PartAPIOrFactory = IPartAPI | IPartFactory;
declare type IPartFactory = (editor: Editor) => IPartAPI;
interface IPartRecord {
    type: string;
    toolboxEntry: ToolboxEntry;
    partsControlsEntry: IPartsControlsEntry;
    part: Part;
}
export declare class EditorPartsManager {
    private editor;
    private addDialog;
    private addDialogProvider;
    private apiRegistry;
    private parts;
    private names;
    private whitelist;
    private _telemetry;
    private _onDidOpenAddParts;
    private _onDidAddPart;
    readonly onDidOpenAddParts: import("@kano/common/index.js").IEvent<void>;
    readonly onDidAddPart: import("@kano/common/index.js").IEvent<Part>;
    constructor(editor: Editor);
    getRegisteredParts(): Map<string, typeof Part>;
    getAddedParts(): Map<string, IPartRecord>;
    setWhitelist(whitelist: IToolboxWhitelist | null): void;
    onInject(): void;
    createToolboxModule(api: IPartAPI, id: string, name: string): IAPIDefinition;
    reserveName(name: string): void;
    /**
     * Find a unique name available
     * @param source Original name
     */
    getAvailableName(source: string, inc?: number): string;
    /**
     * Mark a name as free to use
     * @param source Name to free
     */
    freeName(source: string): void;
    /**
     * Called by the editor when the user imports a saved app
     * @param app Exported app data
     */
    onImport(app: any): void;
    addPart(partClass: typeof Part, data?: any): IPartRecord | undefined;
    removePartAttempt(id: string): void;
    removePart(id: string): void;
    checkBlockDependency(id: string): boolean;
    static getInlineDisplay(api: IPartAPI, part: Part): import("./inline-display.js").PartInlineDisplay<HTMLElement>;
    renamePart(partRecord: IPartRecord, newName: string): void;
    registerAPI(partAPI: PartAPIOrFactory): void;
    reset(): void;
    registerQueryHandlers(engine: QueryEngine): void;
    /**
     * Disable all parts. This prevents users from being able to create parts.
     * Parts can still be created and visible if their are loaded through the editor
     */
    disable(): void;
    dispose(): void;
}
export {};
