UXP Toolkit
    Preparing search index...

    This object is passed to the callback of core.executeAsModal for modality related APIs.

    objects/options

    23.0

    interface ExecutionContext {
        hostControl: {
            registerAutoCloseDocument: (documentID: number) => Promise<void>;
            resumeHistory: (
                params: ResumeHistorySuspensionOptions,
                commit?: boolean,
            ) => Promise<void>;
            suspendHistory: (params: HistoryStateInfo) => Promise<HistorySuspension>;
            unregisterAutoCloseDocument: (documentID: number) => Promise<void>;
        };
        isCancelled: boolean;
        onCancel: ((e?: OnCancelCbArgument) => void)
        | undefined;
        reportProgress: (params: ReportProgressOptions) => void;
    }
    Index

    Properties

    hostControl: {
        registerAutoCloseDocument: (documentID: number) => Promise<void>;
        resumeHistory: (
            params: ResumeHistorySuspensionOptions,
            commit?: boolean,
        ) => Promise<void>;
        suspendHistory: (params: HistoryStateInfo) => Promise<HistorySuspension>;
        unregisterAutoCloseDocument: (documentID: number) => Promise<void>;
    }

    Use the methods in here to control Photoshop state.

    Type Declaration

    • registerAutoCloseDocument: (documentID: number) => Promise<void>

      Register a document to be closed when the modal scope exits.

    • resumeHistory: (params: ResumeHistorySuspensionOptions, commit?: boolean) => Promise<void>

      Call to resume history on a target document. commit (optional): if false, the current modified document state is dropped, and the document returns to the state when suspendHistory was invoked.

      23.0

    • suspendHistory: (params: HistoryStateInfo) => Promise<HistorySuspension>

      Call to suspend history on a target document, returns the suspension ID which can be used for resumeHistory.

      23.0

    • unregisterAutoCloseDocument: (documentID: number) => Promise<void>

      Unregister a document from being closed when the modal scope exits.

    23.0

    isCancelled: boolean

    True if user has cancelled the modal interaction.

    User can cancel by hitting the Escape key, or by pressing the "Cancel" button in the progress bar.

    23.0

    onCancel: ((e?: OnCancelCbArgument) => void) | undefined

    If assigned a method, it will be called when user cancels the modal interaction.

    23.0

    reportProgress: (params: ReportProgressOptions) => void

    Call this to customize the progress bar.

    23.0