mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-04-22 15:09:04 +00:00
54 lines
1.1 KiB
TypeScript
54 lines
1.1 KiB
TypeScript
export type BackgroundTaskSourcePage =
|
|
| 'export'
|
|
| 'chat'
|
|
| 'analytics'
|
|
| 'sns'
|
|
| 'groupAnalytics'
|
|
| 'annualReport'
|
|
| 'other'
|
|
|
|
export type BackgroundTaskStatus =
|
|
| 'running'
|
|
| 'pause_requested'
|
|
| 'paused'
|
|
| 'cancel_requested'
|
|
| 'completed'
|
|
| 'failed'
|
|
| 'canceled'
|
|
|
|
export interface BackgroundTaskRecord {
|
|
id: string
|
|
sourcePage: BackgroundTaskSourcePage
|
|
title: string
|
|
detail?: string
|
|
progressText?: string
|
|
cancelable: boolean
|
|
resumable: boolean
|
|
cancelRequested: boolean
|
|
pauseRequested: boolean
|
|
status: BackgroundTaskStatus
|
|
startedAt: number
|
|
updatedAt: number
|
|
finishedAt?: number
|
|
}
|
|
|
|
export interface BackgroundTaskInput {
|
|
sourcePage: BackgroundTaskSourcePage
|
|
title: string
|
|
detail?: string
|
|
progressText?: string
|
|
cancelable?: boolean
|
|
resumable?: boolean
|
|
onCancel?: () => void | Promise<void>
|
|
onPause?: () => void | Promise<void>
|
|
onResume?: () => void | Promise<void>
|
|
}
|
|
|
|
export interface BackgroundTaskUpdate {
|
|
title?: string
|
|
detail?: string
|
|
progressText?: string
|
|
status?: BackgroundTaskStatus
|
|
cancelable?: boolean
|
|
}
|