import * as ThingTalk from 'thingtalk';
import type Engine from '../engine';
import ValueCategory from './value-category';
import QueueItem from './dialogue_queue';
import { UserInput, PlatformData } from './user-input';
import type Conversation from './conversation';
import { FormattedChunk } from './card-output/card-formatter';
interface DialogueLoopOptions {
    nluServerUrl: string | undefined;
    nlgServerUrl: string | undefined;
    debug: boolean;
}
export default class DialogueLoop {
    conversation: Conversation;
    engine: Engine;
    private _nlu;
    private _nlg;
    private _textFormatter;
    private _cardFormatter;
    private _langPack;
    private _userInputQueue;
    private _notifyQueue;
    private _prefs;
    private _agent;
    private _policy;
    private _debug;
    icon: string | null;
    expecting: ValueCategory | null;
    platformData: PlatformData;
    private _raw;
    private _choices;
    private _dialogueState;
    private _executorState;
    private _lastNotificationApp;
    private _stopped;
    private _mgrResolve;
    private _mgrPromise;
    constructor(conversation: Conversation, engine: Engine, options: DialogueLoopOptions);
    get _(): (x: string) => string;
    get isAnonymous(): boolean;
    get hasDebug(): boolean;
    debug(...args: unknown[]): void;
    interpolate(msg: string, args: Record<string, unknown>): string;
    nextCommand(): Promise<UserInput>;
    private _checkPolicy;
    private _getSpecialThingTalkType;
    private _maybeGetThingTalkAnswer;
    private _prepareContextForPrediction;
    private _analyzeCommand;
    private _useNeuralNLG;
    private _doAgentReply;
    private _handleUICommand;
    private _describeProgram;
    private _handleUserInput;
    private _handleNormalDialogueCommand;
    private _showNotification;
    private _showAsyncError;
    private _handleAPICall;
    private _showWelcome;
    private _loop;
    get dialogueState(): ThingTalk.Ast.DialogueState | null;
    set dialogueState(newState: ThingTalk.Ast.DialogueState | null);
    nextQueueItem(): Promise<QueueItem>;
    lookingFor(): Promise<void>;
    fail(msg?: string): Promise<void>;
    setExpected(expected: ValueCategory | null, raw?: boolean): void;
    /**
     * Ask a question to the user.
     *
     * This is a legacy method used for certain scripted interactions.
     */
    ask(expected: ValueCategory.YesNo | ValueCategory.PhoneNumber | ValueCategory.EmailAddress | ValueCategory.Location | ValueCategory.Time, question: string, args?: Record<string, unknown>): Promise<ThingTalk.Ast.Value>;
    askChoices(question: string, choices: string[]): Promise<number>;
    private _resendChoices;
    replyInterp(msg: string, args?: Record<string, unknown>, icon?: string | null): Promise<void>;
    reply(msg: string, icon?: string | null): Promise<void>;
    replyCard(message: FormattedChunk, icon?: string | null): Promise<void>;
    replyButton(text: string, json: string): Promise<void>;
    replyLink(title: string, url: string): Promise<void>;
    private _isInDefaultState;
    dispatchNotify(appId: string, icon: string | null, outputType: string, outputValue: Record<string, unknown>): void;
    dispatchNotifyError(appId: string, icon: string | null, error: Error): void;
    start(showWelcome: boolean): Promise<void>;
    stop(): Promise<void>;
    reset(): Promise<void>;
    private _pushQueueItem;
    /**
     * Returns a promise that will resolve when the dialogue loop is
     * ready to accept the next command from the user.
     */
    private _waitNextCommand;
    pushCommand(command: UserInput): void;
    handleCommand(command: UserInput): Promise<void>;
}
export {};
