/// <reference types="node" />
import * as events from 'events';
import * as ThingTalk from 'thingtalk';
import AppExecutor from './app_executor';
import type Engine from '../index';
/**
 * The collection of all running and configured ThingTalk programs.
 */
export default class AppDatabase extends events.EventEmitter {
    private _apps;
    private _engine;
    private _platform;
    private _db;
    /**
     * Construct the app database for this engine.
     *
     * There is only one app database instance per engine,
     * and it is accessible as {@link Engine#apps}.
     * @package
     */
    constructor(engine: Engine);
    private _getAll;
    private _insertOne;
    private _deleteOne;
    private _doStartApp;
    createApp(program: ThingTalk.Ast.Program, options?: {
        uniqueId?: string;
        name?: string;
        description?: string;
        icon?: string;
        conversation?: string;
    }): Promise<AppExecutor>;
    private _loadOneApp;
    start(): Promise<void>;
    stop(): Promise<void>;
    private _removeAppInternal;
    private _addAppInternal;
    private _enableApp;
    private _saveApp;
    removeApp(app: AppExecutor): Promise<void>;
    getAllApps(): AppExecutor[];
    getApp(id: string): AppExecutor | undefined;
    hasApp(id: string): boolean;
}
