Files
sausage/extensions/pause/api.ts
T

10 lines
474 B
TypeScript

/** Pause: whether the user paused this Standing agent, for timers that start work outside the task scheduler. */
const defineApi = <S>() => (name: string): {name: string; service?: S} => ({name})
export type PauseService = {
/** Whether the host is paused; a timer that starts work (a fetch, a ping, a backup) skips its tick while it is. */
paused(): boolean
}
/** The pause; `want` it, pause is optional. */
export const PauseApi = defineApi<PauseService>()('pause')