ctx.d.ts 1.5 KB

1234567891011121314151617181920212223242526
  1. import type { Container, Slice, SliceType } from '../context';
  2. import type { Clock, TimerType } from '../timer';
  3. import { Inspector } from '../inspector';
  4. import type { Meta } from '../inspector';
  5. export declare class Ctx {
  6. #private;
  7. constructor(container: Container, clock: Clock, meta?: Meta);
  8. get meta(): Meta | undefined;
  9. get inspector(): Inspector | undefined;
  10. readonly produce: (meta?: Meta) => Ctx;
  11. readonly inject: <T>(sliceType: SliceType<T, string>, value?: T | undefined) => this;
  12. readonly remove: <T, N extends string = string>(sliceType: N | SliceType<T, N>) => this;
  13. readonly record: (timerType: TimerType) => this;
  14. readonly clearTimer: (timerType: TimerType) => this;
  15. readonly isInjected: <T, N extends string = string>(sliceType: N | SliceType<T, N>) => boolean;
  16. readonly isRecorded: (timerType: TimerType) => boolean;
  17. readonly use: <T, N extends string = string>(sliceType: N | SliceType<T, N>) => Slice<T, N>;
  18. readonly get: <T, N extends string>(sliceType: N | SliceType<T, N>) => T;
  19. readonly set: <T, N extends string>(sliceType: N | SliceType<T, N>, value: T) => void;
  20. readonly update: <T, N extends string>(sliceType: N | SliceType<T, N>, updater: (prev: T) => T) => void;
  21. readonly timer: (timer: TimerType) => import("../timer").Timer;
  22. readonly done: (timer: TimerType) => void;
  23. readonly wait: (timer: TimerType) => Promise<void>;
  24. readonly waitTimers: (slice: SliceType<TimerType[]>) => Promise<void>;
  25. }
  26. //# sourceMappingURL=ctx.d.ts.map