Hierarchy (View Summary)

  • DataEntity<
        {
            error?: ErrorData;
            id: string;
            isNSFW?: boolean;
            previewUrl?: string;
            resultUrl?: null
            | string;
            seed?: number;
            status: JobStatus;
            step: number;
            stepCount: number;
            userCanceled?: boolean;
        },
        JobEventMap,
    >
    • Job

Constructors

  • Parameters

    • data: {
          error?: ErrorData;
          id: string;
          isNSFW?: boolean;
          previewUrl?: string;
          resultUrl?: null | string;
          seed?: number;
          status: JobStatus;
          step: number;
          stepCount: number;
          userCanceled?: boolean;
      }

    Returns Job

Properties

data: {
    error?: ErrorData;
    id: string;
    isNSFW?: boolean;
    previewUrl?: string;
    resultUrl?: null | string;
    seed?: number;
    status: JobStatus;
    step: number;
    stepCount: number;
    userCanceled?: boolean;
}
listeners: {
    completed?: (data: string) => void[];
    failed?: (data: ErrorData) => void[];
    progress?: (data: number) => void[];
    updated?: (data: string[]) => void[];
} = {}

Accessors

  • get isNSFW(): boolean
  • Whether the image is NSFW or not. Only makes sense if job is completed. If NSFW filter is disabled, this property will always be false. If NSFW filter is enabled and the image is NSFW, image will not be available for download.

    Returns boolean

  • get previewUrl(): undefined | string
  • Last preview image URL generated by the worker.

    Returns undefined | string

  • get progress(): number
  • Progress of the job in percentage (0-100).

    Returns number

  • get resultUrl(): undefined | null | string
  • URL to the result image, could be null if the job was canceled or triggered NSFW filter while it was not disabled explicitly.

    Returns undefined | null | string

  • get seed(): undefined | number
  • Seed used to generate the image. This property is only available when the job is completed.

    Returns undefined | number

  • get stepCount(): number
  • Total number of steps that worker will perform.

    Returns number

Methods

  • Get a copy of the entity's data

    Returns {
        error?: ErrorData;
        id: string;
        isNSFW?: boolean;
        previewUrl?: string;
        resultUrl?: null | string;
        seed?: number;
        status: JobStatus;
        step: number;
        stepCount: number;
        userCanceled?: boolean;
    }