10 lines
468 B
TypeScript
10 lines
468 B
TypeScript
/** Pause: whether the user paused this Ultimate, 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')
|