import { Client } from '@botpress/client';
import { output } from '@botpress/sdk';
import { ZuiType } from '../types';
/**
 * State name constants that must match the names defined in bot.definition.ts
 *
 * These constants ensure consistency between runtime state names and
 * the state definitions in the generated bot.definition.ts file.
 */
export declare const BUILT_IN_STATES: {
    /** Generic conversation-specific state (user-defined per conversation) */
    readonly conversation: "state";
    /** User-specific state (persists across conversations per user) */
    readonly user: "userState";
    /** Bot-wide global state (persists across all conversations) */
    readonly bot: "botState";
    /** Workflow-specific state (persists across workflow executions) */
    readonly workflowState: "workflowState";
    /** Workflow cached steps executions */
    readonly workflowSteps: "workflowSteps";
    /** Data source metadata for dashboard visibility */
    readonly dsData: "dsData";
};
export declare class TrackedState<Schema extends ZuiType = ZuiType> {
    type: 'conversation' | 'user' | 'bot' | 'workflow';
    id: string;
    name: string;
    state: Schema;
    client: Client;
    value: Schema extends ZuiType ? output<Schema> | undefined : never | undefined;
    private _lastSavedHash;
    private _isDirty;
    private _loaded;
    private _saving;
    private _saveAgain;
    private _saveAgainCount;
    private static _savingAll;
    private static _saveAllAgain;
    private static _saveAllCount;
    private constructor();
    static create<T extends ZuiType>(props: {
        type: 'conversation' | 'user' | 'bot' | 'workflow';
        id: string;
        schema: T;
        client: Client;
        name: string;
    }): TrackedState<T>;
    static saveAllDirty(): Promise<void>;
    static loadAll(): Promise<void>;
    static unloadAll(): void;
    load(force?: boolean): Promise<void>;
    save(): Promise<void>;
    /**
     * Check if the state has been modified since last save/load
     * Uses a fast hash comparison to detect changes
     */
    isDirty(): boolean;
    /**
     * Mark the state as dirty (modified)
     * Useful when you know the state changed without checking
     */
    markDirty(): void;
    /**
     * Calculate a fast hash of the value for change detection
     * Uses crypto hash for better performance with large objects
     */
    private calculateHash;
    get diff(): string;
}
//# sourceMappingURL=tracked-state.d.ts.map