withsubclocks.d.ts 666 B

1234567891011121314151617181920
  1. export interface S {
  2. root<T>(fn: (dispose: () => void) => T): T;
  3. <T>(fn: () => T): () => T;
  4. <T>(fn: (v: T) => T, seed: T): () => T;
  5. on<T>(ev: () => any, fn: () => T): () => T;
  6. on<T>(ev: () => any, fn: (v: T) => T, seed: T, onchanges?: boolean): () => T;
  7. data<T>(value: T): DataSignal<T>;
  8. value<T>(value: T, eq?: (a: T, b: T) => boolean): DataSignal<T>;
  9. freeze<T>(fn: () => T): T;
  10. sample<T>(fn: () => T): T;
  11. cleanup(fn: (final: boolean) => any): void;
  12. subclock(): <T>(fn: () => T) => T;
  13. subclock<T>(fn: () => T): T;
  14. }
  15. export interface DataSignal<T> {
  16. (): T;
  17. (val: T): T;
  18. }
  19. declare const S: S;
  20. export default S;