master
 1import { Octokit } from 'octokit'
 2import { Data } from './data.js'
 3import allTasks from './task/index.js'
 4import { BatchFn } from './batch.js'
 5
 6export type TaskName = (typeof allTasks)[number]['default']['name']
 7
 8type Context = {
 9  octokit: Octokit
10  data: Data
11  next: (taskName: TaskName, params: any) => void
12  batch: BatchFn
13}
14
15type Task<Name extends string> = {
16  name: Name
17  run: (context: Context, params: any) => Promise<void>
18}
19
20export function task<Name extends string>(t: Task<Name>) {
21  return t
22}