import { ChoiceMenuOptionClose } from '../classes/ChoiceMenuOption.mjs';
import { LabelIdType } from '../types/LabelIdType.mjs';
import { StepLabelPropsType, StepLabelResultType, StepLabelType } from '../types/StepLabelType.mjs';
import CharacterBaseModel from '../classes/CharacterBaseModel.mjs';
import DialogueBaseModel from '../classes/DialogueBaseModel.mjs';
import Label from '../classes/Label.mjs';
import IHistoryStep from '../interface/IHistoryStep.mjs';
import IOpenedLabel from '../interface/IOpenedLabel.mjs';
import ExportedStep from '../interface/export/ExportedStep.mjs';
import '../types/StorageElementType.mjs';
import '../types/CloseType.mjs';
import '../types/LabelRunModeType.mjs';
import '@drincs/pixi-vn/dist/override';
import '../classes/LabelAbstract.mjs';
import '../types/StepHistoryDataType.mjs';
import '../interface/LabelProps.mjs';
import '../interface/CharacterBaseModelProps.mjs';
import '../classes/StoredClassModel.mjs';
import 'deep-diff';
import '../interface/export/ExportedCanvas.mjs';
import '../interface/canvas/ICanvasBaseMemory.mjs';
import '../interface/ITickersSteps.mjs';
import 'pixi.js';
import '../TickerBase-DKYzbzro.mjs';
import '../types/TickerIdType.mjs';
import '../types/PauseType.mjs';
import '../types/RepeatType.mjs';
import '../interface/TickerHistory.mjs';
import '../interface/export/ExportedStorage.mjs';

/**
 * GameStepManager is a class that manages the steps and labels of the game.
 */
declare class GameStepManager {
    private constructor();
    /**
     * stepHistory is a list of label events and steps that occurred during the progression of the steps.
     */
    private static _stepsHistory;
    static get stepsHistory(): IHistoryStep<DialogueBaseModel<CharacterBaseModel>>[];
    private static _lastStepIndex;
    /**
     * lastStepIndex is the last step index that occurred during the progression of the steps. **Not is the length of the stepsHistory - 1.**
     */
    static get lastStepIndex(): number;
    /**
     * Increase the last step index that occurred during the progression of the steps.
     */
    private static increaseLastStepIndex;
    private static _openedLabels;
    static get openedLabels(): IOpenedLabel[];
    /**
     * currentLabelId is the current label id that occurred during the progression of the steps.
     */
    private static get currentLabelId();
    /**
     * currentLabel is the current label that occurred during the progression of the steps.
     */
    static get currentLabel(): Label | undefined;
    private static get currentLabelStepIndex();
    /**
     * lastHistoryStep is the last history step that occurred during the progression of the steps.
     */
    private static get lastHistoryStep();
    private static _originalStepData;
    private static get originalStepData();
    private static set originalStepData(value);
    private static get currentStepData();
    /**
     * Add a label to the history.
     * @param label The label to add to the history.
     */
    private static addStepHistory;
    /**
     * Add a label to the history.
     * @param label The label to add to the history.
     */
    private static pushNewLabel;
    /**
     * Close the current label and add it to the history.
     * @returns
     */
    static closeCurrentLabel(): void;
    /**
     * Close all labels and add them to the history. **Attention: This method can cause an unhandled game ending.**
     */
    static closeAllLabels(): void;
    /**
     * Increase the current step index of the current label.
     */
    private static increaseCurrentStepIndex;
    private static restorLastLabelList;
    static get canGoNext(): boolean;
    /**
     * Execute the next step and add it to the history.
     * @param props The props to pass to the step.
     * @param choiseMade The index of the choise made by the player. (This params is used in the choice menu)
     * @returns StepLabelResultType or undefined.
     * @example
     * ```typescript
     *     function nextOnClick() {
     *     setLoading(true)
     *     GameStepManager.goNext(yourParams)
     *         .then((result) => {
     *             setUpdate((p) => p + 1)
     *             setLoading(false)
     *             if (result) {
     *                 // your code
     *             }
     *         })
     *         .catch((e) => {
     *             setLoading(false)
     *             console.error(e)
     *         })
     * }
     * ```
     */
    static goNext(props: StepLabelPropsType, choiseMade?: number): Promise<StepLabelResultType>;
    /**
     * Execute the current step and add it to the history.
     * @param props The props to pass to the step.
     * @param choiseMade The choise made by the player.
     * @returns StepLabelResultType or undefined.
     */
    private static runCurrentStep;
    /**
     * Execute the label and add it to the history. (It's similar to Ren'Py's call function)
     * @param label The label to execute or the id of the label
     * @param props The props to pass to the label.
     * @returns StepLabelResultType or undefined.
     * @example
     * ```typescript
     * GameStepManager.callLabel(startLabel, yourParams).then((result) => {
     *     if (result) {
     *         // your code
     *     }
     * })
     * ```
     * @example
     * ```typescript
     * // if you use it in a step label you should return the result.
     * return GameStepManager.callLabel(startLabel).then((result) => {
     *     return result
     * })
     * ```
     */
    static callLabel<T extends {} = {}>(label: Label<T> | LabelIdType, props: StepLabelPropsType<T>): Promise<StepLabelResultType>;
    /**
     * Execute the label, close the current label, execute the new label and add the new label to the history. (It's similar to Ren'Py's jump function)
     * @param label The label to execute.
     * @param props The props to pass to the label or the id of the label
     * @returns StepLabelResultType or undefined.
     * @example
     * ```typescript
     * GameStepManager.jumpLabel(startLabel, yourParams).then((result) => {
     *     if (result) {
     *         // your code
     *     }
     * })
     * ```
     * @example
     * ```typescript
     * // if you use it in a step label you should return the result.
     * return GameStepManager.jumpLabel(startLabel).then((result) => {
     *     return result
     * })
     * ```
     */
    static jumpLabel<T extends {}>(label: Label<T> | LabelIdType, props: StepLabelPropsType<T>): Promise<StepLabelResultType>;
    /**
     * When the player is in a choice menu, can use this function to exit to the choice menu.
     * @param choice
     * @param props
     * @returns StepLabelResultType or undefined.
     * @example
     * ```typescript
     * GameStepManager.closeChoiceMenu(yourParams).then((result) => {
     *     if (result) {
     *         // your code
     *     }
     * })
     * ```
     */
    static closeChoiceMenu<T extends {} = {}>(choice: ChoiceMenuOptionClose<T>, props: StepLabelPropsType<T>): Promise<StepLabelResultType>;
    /**
     * Go back to the last step and add it to the history.
     * @param navigate The navigate function.
     * @param steps The number of steps to go back.
     * @returns
     * @example
     * ```typescript
     * export function goBack(navigate: (path: string) => void, afterBack?: () => void) {
     *     GameStepManager.goBack(navigate)
     *     afterBack && afterBack()
     * }
     * ```
     */
    static goBack(navigate: (path: string) => void, steps?: number): Promise<void>;
    private static goBackInternal;
    /**
     * Return true if it is possible to go back.
     */
    static get canGoBack(): boolean;
    /**
     * Add a label to the history.
     */
    static clear(): void;
    /**
     * Export the history to a JSON string.
     * @returns The history in a JSON string.
     */
    static exportJson(): string;
    /**
     * Export the history to an object.
     * @returns The history in an object.
     */
    static export(): ExportedStep;
    /**
     * Import the history from a JSON string.
     * @param dataString The history in a JSON string.
     */
    static importJson(dataString: string): Promise<void>;
    /**
     * Import the history from an object.
     * @param data The history in an object.
     */
    static import(data: object): Promise<void>;
    /**
     * Function to be executed at the end of the game. It should be set in the game initialization.
     * @example
     * ```typescript
     * GameStepManager.gameEnd = async (props) => {
     *    props.navigate("/end")
     * }
     * ```
     */
    static gameEnd: StepLabelType | undefined;
}

export { GameStepManager as default };
