summaryrefslogtreecommitdiffhomepage
path: root/frontend/src/modules/task/task.d.ts
blob: 4c7e2add1ab80b0204c42b3ebba25a80cf6819e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
declare namespace Task {
  type Status = "idle" | "running" | "success" | "failure";

  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  type AnyCallable = (...args: any[]) => Promise<void>;
  export type Callable<T extends AnyCallable = AnyCallable> = T & {
    parameters: Parameters<T>;
    id: symbol;
    status: Status;
  };

  export interface TaskRef {
    name: string;
    callableId: symbol;
    description?: string;
  }

  export interface Group {
    description: string;
    notify: string;
  }
}