Files
deepseek-harness/vendor/timer
Tianyi Cui d2fb352f3e Enable maximum-strict TypeScript across our packages
tsconfig.base.json adds noUncheckedIndexedAccess,
exactOptionalPropertyTypes, noImplicitOverride,
noFallthroughCasesInSwitch, noUnusedLocals, and noUnusedParameters on
top of strict. Vendored packages opt out of the new flags locally
(their tsconfigs are ours to regenerate; their source is not), keeping
upstream-sync friendliness.

Our code fixed accordingly: index accesses acknowledge undefined
(assembler flush cursors, lastTurnNumber); optional properties are
omitted instead of set-to-undefined (GenerateResult.usage,
ToolDefinition.strict, GenerateOptions.system/tools, error payloads
via an errorData helper); Session.onAppend is explicitly
`(…) => void | undefined`; tests and examples updated for unused
parameters and indexed access.
2026-06-11 14:02:47 +08:00
..

@cordisjs/plugin-timer

Disposal-aware timer service for Cordis.

Usage

import { Context } from 'cordis'
import Timer from '@cordisjs/plugin-timer'

const root = new Context()
await root.plugin(Timer)

const dispose = root.timeout(() => {
  root.logger.info('done')
}, 1000)

dispose()

Timer handles are registered on the current fiber, so they are cleared automatically when the plugin that created them is disposed.

API

API Description
ctx.timeout(callback, delay) Run once and return a disposer.
ctx.timeout(delay) Return a promise that resolves after delay.
ctx.interval(callback, delay) Run repeatedly and return a disposer.
ctx.interval(delay) Return an async iterator that yields on each interval.
ctx.throttle(callback, delay, noTrailing?) Return a throttled function with .dispose().
ctx.debounce(callback, delay) Return a debounced function with .dispose().

ctx.setTimeout() and ctx.setInterval() are kept as deprecated aliases for ctx.timeout() and ctx.interval().