import type { Activity } from './Activity.js';
import type { Application } from './Application.js';
export declare enum ActivityState {
    Initialized = 0,
    Created = 1,
    Started = 2,
    Resumed = 3,
    Paused = 4,
    Stopped = 5,
    Destroyed = 6
}
export declare enum IntentFlags {
    /**
     * Marks that the activity should be rendered as a modal.
     */
    Modal = 1,
    /**
     * The activity is started for result.
     */
    ForResult = 2,
    /**
     * When set, the intent data is passed by reference.
     * By default the activity manager makes a copy of the intent data.
     * This is useful when the data is large and you want to avoid copying it
     * or when you want to share the same data between activities.
     */
    ByReference = 4
}
export interface Intent {
    action: string;
    data?: unknown;
    category?: string[];
    flags?: number;
    /**
     * The request code used to distinguish between different activities.
     */
    requestCode?: number;
}
export declare enum IntentResult {
    RESULT_CANCELED = 0,
    RESULT_OK = 1
}
/**
 * Manages application activities.
 *
 * An activity is a screen or a portion of a rendered screen that has its own
 * lifecycle methods and routing.
 *
 * An activity is registered by its class definition. Because of that, activities
 * cannot have constructors that require own parameters. Activities have to be
 * self contained or use the event system to request data.
 */
export declare class ActivityManager {
    #private;
    private currentActivity?;
    /**
     * Stores activity *classes* by unique ID (action name).
     */
    private activityClasses;
    /**
     * Represents the activity stack. It is used to manage
     * the UI state after calling the back action.
     */
    private activityStack;
    /**
     * A stack of activities that are rendered over other activities
     * in a dialog.
     */
    private modalActivityStack;
    private generateActivityId;
    constructor(parent: Application);
    registerActivity(action: string, activityClass: typeof Activity): void;
    /**
     * Creates an activity and pushes it into the stack, but it does not initialize any of the lifecycle methods.
     * It is a way to put an activity at some place of the stack,
     * but it will be only initialized when other activities finis.
     *
     * Note, if you add an uninitialized activity and you won't add more activities then this activity may never run.
     * Make sure that there's always another activity.
     *
     * @param intent The intent that created this activity.
     */
    createActivity(intent: Intent): Promise<void>;
    setupRoute(intent: Intent): void;
    /**
     * Starts a new activity and brings it to the foreground.
     *
     * @param intent The intent that created this activity.
     */
    startActivity(intent: Intent): Promise<void>;
    private buildActivity;
    /**
     * Starts an activity that should return a result to the calling activity.
     * The result should be a unique number across the application.
     * @param intent The intent to start the activity.
     * @param requestCode The request code used to match the activity result.
     */
    startActivityForResult(intent: Intent, requestCode: number): Promise<void>;
    isDestroyed(activity: Activity): boolean;
    /**
     * @param activity The activity to finish.
     */
    finishActivity(activity: Activity): Promise<void>;
    private manageActivityResult;
    private bringLastActivityToFront;
    getTopActivity(): Activity | undefined;
    getCurrentActivity(): Activity | undefined;
    /**
     * Sets the styles for the current activity.
     * This method adds or removes CSS classes based on the activity's class name
     * and action, allowing for dynamic styling based on the active activity.
     * @param activity The activity to set styles for.
     * If not provided, it will not set any styles.
     * If the activity is the same as the current one, it does nothing.
     */
    setupStyles(activity?: Activity, oldActivity?: Activity): void;
    /**
     * A helper method to handle the transition between activities, ensuring
     * lifecycle methods are called in the correct order (pause the previous activity,
     * then start/resume the new one). This centralizes lifecycle management.
     *
     * @param activity The activity to bring to the foreground.
     */
    private updateCurrentActivity;
    /**
     * Allows navigating back through the activity stack.
     * Call `ActivityManager.navigateBack()` when the user performs a back action
     * (e.g., clicks a back button).
     */
    navigateBack(): Promise<void>;
    createRequestCode(): number;
    findActiveActivity(action: string): Activity | undefined;
}
//# sourceMappingURL=ActivityManager.d.ts.map