/************************************************************************* * * ADOBE CONFIDENTIAL * ___________________ * * Copyright 2024 Adobe * All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of Adobe and its suppliers, if any. The intellectual * and technical concepts contained herein are proprietary to Adobe * and its suppliers and are protected by all applicable intellectual * property laws, including trade secret and copyright laws. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Adobe. **************************************************************************/ import { ApiResponse } from "@adobe/firefly-services-sdk-core"; import { AsyncJobPromise } from "@adobe/firefly-services-sdk-core/internal"; import { PsJobResponse } from "../src/models/PsJobResponse"; import { JobStatusLinkResponse } from "../src/models/JobStatusLinkResponse"; type PsJobLinkPromise = Promise>; /** * PsJobResponse can be either a ManifestJobApiResponse or PsJobApiResponse */ type PsJobStatusFetcher = (...args: any[]) => Promise>; export declare class PsAsyncJobError extends Error { readonly details: JobStatusLinkResponse; constructor(message: string, details: JobStatusLinkResponse); } /** * This is manually created class to handle the async job status for Photoshop APIs */ export declare class PsAsyncJob extends AsyncJobPromise { private _jobLinkPromise; private _statusFetcher; private _jobId; constructor(_jobLinkPromise: PsJobLinkPromise, _statusFetcher: PsJobStatusFetcher); protected _fetchJobStatus(): Promise; protected _getNextRetryTimeInMilliSecs(): number; /** * Check the status returned by the server and update the state of the job. * initial state is PENDING * if atleast one output is RUNNING, state is IN_PROGRESS * when all jobs are finished and if any output is FAILED, state is FAILED and error is set * if all outputs are COMPLETED, state is COMPLETED */ private _updateStatus; private ensureJobId; } export {};