Repository: effector/effector
Pull request #452 (2021-02-01 18:42:37)

Improve sample types
fix target unit replacement,
fix clock without source,
fix IfAssignable helper,
fix type inference of events returned from map/filter/merge

netlify[bot]: Deploy request for *effector-docs* pending review.

Review with commit fe26d312476a5fda9f3851a2363f4b885c4f8b20

https://app.netlify.com/sites/effector-docs/deploys
doasync: The regression is fixed. Here are types for guard: https://github.com/effector/effector/pull/447

Patch:
diff --git a/packages/effector/index.d.ts b/packages/effector/index.d.ts
index 1018134c..908c9fae 100644
--- a/packages/effector/index.d.ts
+++ b/packages/effector/index.d.ts
@@ -109,16 +109,26 @@ export type CompositeName = {
   path: Array<string>
 }
 
+/**
+ * This is a workaround for https://github.com/microsoft/TypeScript/issues/35162
+ *
+ * The problem was that we couldn't use guard as sample's clock parameter because
+ * sample's clock-related generic inferred as `unknown` in cases when guard returned
+ * `Event<T>`. This happens because `Event` has a callable signature. With `Unit<T>`
+ * as the return type we won't see any problems.
+ */
+type EventAsReturnType<Payload> = any extends Payload ? Event<Payload> : never
+
 export interface Event<Payload> extends Unit<Payload> {
   (payload: Payload): Payload
   (this: Payload extends void ? void : `Error: Expected 1 argument, but got 0`, payload?: Payload): void
   watch(watcher: (payload: Payload) => any): Subscription
-  map<T>(fn: (payload: Payload) => T): Event<T>
+  map<T>(fn: (payload: Payload) => T): EventAsReturnType<T>
   filter<T extends Payload>(config: {
     fn(payload: Payload): payload is T
-  }): Event<T>
-  filter(config: {fn(payload: Payload): boolean}): Event<Payload>
-  filterMap<T>(fn: (payload: Payload) => T | undefined): Event<T>
+  }): EventAsReturnType<T>
+  filter(config: {fn(payload: Payload): boolean}): EventAsReturnType<Payload>
+  filterMap<T>(fn: (payload: Payload) => T | undefined): EventAsReturnType<T>
   prepend<Before = void>(fn: (_: Before) => Payload): Event<Before>
   subscribe(observer: Observer<Payload>): Subscription
   thru<U>(fn: (event: Event<Payload>) => U): U
@@ -128,16 +138,6 @@ export interface Event<Payload> extends Unit<Payload> {
   shortName: string
 }
 
-/**
- * This is a workaround for https://github.com/microsoft/TypeScript/issues/35162
- *
- * The problem was that we couldn't use guard as sample's clock parameter because
- * sample's clock-related generic inferred as `unknown` in cases when guard returned
- * `Event<T>`. This happens because `Event` has a callable signature. With `Unit<T>`
- * as the return type we won't see any problems.
- */
-type EventAsReturnType<Payload> = any extends Payload ? Event<Payload> : never
-
 export interface Effect<Params, Done, Fail = Error> extends Unit<Params> {
   (params: Params): Promise<Done>
   readonly done: Event<{params: Params; result: Done}>
@@ -169,10 +169,10 @@ export interface Effect<Params, Done, Fail = Error> extends Unit<Params> {
   watch(watcher: (payload: Params) => any): Subscription
   filter<T extends Params>(config: {
     fn(payload: Params): payload is T
-  }): Event<T>
-  filter(config: {fn(payload: Params): boolean}): Event<Params>
-  filterMap<T>(fn: (payload: Params) => T | undefined): Event<T>
-  map<T>(fn: (params: Params) => T): Event<T>
+  }): EventAsReturnType<T>
+  filter(config: {fn(payload: Params): boolean}): EventAsReturnType<Params>
+  filterMap<T>(fn: (payload: Params) => T | undefined): EventAsReturnType<T>
+  map<T>(fn: (params: Params) => T): EventAsReturnType<T>
   prepend<Before>(fn: (_: Before) => Params): Event<Before>
   subscribe(observer: Observer<Params>): Subscription
   getType(): string
@@ -418,7 +418,7 @@ export function forward<To, From extends To>(opts: {
   to: Unit<To> | ReadonlyArray<Unit<To>>
 }): Subscription
 
-export function merge<T>(events: ReadonlyArray<Unit<T>>): Event<T>
+export function merge<T>(events: ReadonlyArray<Unit<T>>): EventAsReturnType<T>
 export function merge<T extends ReadonlyArray<Unit<any>>>(
   events: T,
 ): T[number] extends Unit<infer R> ? Event<R> : never
@@ -657,27 +657,20 @@ type ValidTargetList<Match, Target extends Tuple<unknown>> = {
   : 'non-unit item in target array'
 }
 
-//  NoInfer in source and in return of fn helps with
-//        detecting loose objects against target type
-
-/* Sample types */
+/* sample types */
 
 type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N;
-type IfUnknown<T, Y, N> = IfAny<T, N, unknown extends T ? Y : N>;
-type IfEqual<T, U, Y = unknown, N = never> =
-  (<G>() => G extends T ? 1 : 0) extends
-    (<G>() => G extends U ? 1 : 0) ? Y : N;
-
-// TODO: support `sample(combinable)` [?]
-export type SourceNotConfig<T> = Unit<T> | {
-  source: never,
-  clock: never,
-  [key: string]: Store<any>
-} | Tuple<Store<any>>
-
-type Source<X> = Unit<X> | Combinable
-type Clock<X> = Unit<X> | Tuple<Unit<any>>
-type Target<X> = Unit<X> | Tuple<any>
+type IfUnknown<T, Y, N> = 0 extends (1 & T) ? N : unknown extends T ? Y : N;
+type IfAssignable<T, U, Y, N> =
+  (<G>() => IfAny<T & U, 0, G extends T ? 1 : 2>) extends
+    (<G>() => IfAny<T & U, 0, G extends U ? 1 : 2>)
+    ? Y
+    : (T extends U ? never : 1) extends never ? Y : N
+
+type SourceNotConfig<A> = Unit<A> | Tuple<Store<any>>
+type Source<A> = Unit<A> | Combinable
+type Clock<B> = Unit<B> | Tuple<Unit<any>>
+type Target = Unit<any> | Tuple<any>
 
 type GetTupleWithoutAny<T> = T extends Array<infer U>
   ? U extends Unit<infer Value>
@@ -687,17 +680,14 @@ type GetTupleWithoutAny<T> = T extends Array<infer U>
 
 type GetMergedValue<T> = GetTupleWithoutAny<T> extends never ? any : GetTupleWithoutAny<T>
 
-type GetSource<T> = T extends Unit<infer S> ? S : GetCombinedValue<T>
-type GetClock<T> = T extends Unit<infer S> ? S : GetMergedValue<T>
+type GetSource<S> = S extends Unit<infer Value> ? Value : GetCombinedValue<S>
+type GetClock<C> = C extends Unit<infer Value> ? Value : GetMergedValue<C>
 
 type AnyFn = (...args: any) => any
 
-type FnS<S> = (source: GetSource<S>) => unknown
-type FnSC<S, C> = (source: GetSource<S>, clock: GetClock<C>) => unknown
-type FnC<C> = (clock: GetClock<C>) => unknown
-type FnSF<S, F extends AnyFn, X> = (source: GetSource<S>) => IfUnknown<X, ReturnType<F>, X>
-type FnCF<C, F extends AnyFn, X> = (clock: GetClock<C>) => IfUnknown<X, ReturnType<F>, X>
-type FnSCF<S, C, F extends AnyFn, X> = (source: GetSource<S>, clock: GetClock<C>) => IfUnknown<X, ReturnType<F>, X>
+type FnSR<S, R> = (source: GetSource<S>) => R
+type FnCR<C, R> = (clock: GetClock<C>) => R
+type FnSCR<S, C, R> = (source: GetSource<S>, clock: GetClock<C>) => R
 
 type GetResultS<S> = S extends Store<any> | Combinable
   ? Store<GetSource<S>>
@@ -730,275 +720,225 @@ type GetResultSCF<S, C, F extends AnyFn> = S extends Store<any> | Combinable
 /** Replaces incompatible unit type with string error message.
  *  There is no error message if target type is void.
  */
-type ReplaceUnit<Result, Value, Target> = IfEqual<
-  Result,
-  Value,
+type ReplaceUnit<Target, Result, Value> = IfAssignable<Result, Value,
   Target,
-  Result extends Value
-  ? Target
-  : Value extends void
+  Value extends void
     ? Target
     : 'incompatible unit in target'
 >
 
-type TargetUnit<Result, T extends Unit<unknown>> = T extends Unit<infer Value>
-  ? ReplaceUnit<Result, Value, T>
-  : 'non-unit item in target'
-
-type TargetTuple<Result, T extends Tuple<unknown>> = {
-  [Index in keyof T]: T[Index] extends Unit<infer Value>
-    ? ReplaceUnit<Result, Value, T[Index]>
+// [...T] is used to show sample result as a tuple (not array)
+type TargetTuple<Target extends Array<unknown>, Result> = [...{
+  [Index in keyof Target]: Target[Index] extends Unit<infer Value>
+    ? ReplaceUnit<Target[Index], Result, Value>
     : 'non-unit item in target'
-}
+}]
 
-type MultiTarget<Result, T extends Target<X>, X = any> = T extends Unit<any>
-  ? TargetUnit<Result, T>
-  : T extends Tuple<unknown>
-    ? TargetTuple<Result, T>
-    : never
+type MultiTarget<Target, Result> = Target extends Unit<infer Value>
+  ? ReplaceUnit<Target, Result, Value>
+  : Target extends Tuple<unknown>
+    ? TargetTuple<Target, Result>
+    : 'non-unit item in target'
 
 /*
 * Sample generics:
 * A - source value
 * B - clock value
-* X - target value
+* R - fn result
 */
 
-export function sample<
-  A = any,
+export function sample<A = any,
   S extends SourceNotConfig<A> = SourceNotConfig<A>
->(
-  source: S
-): GetResultS<S>
-
-export function sample<
-  A = any,
-  B = any,
+>(source: S): GetResultS<S>
+export function sample<A = any, B = any,
   S extends Source<A> = Source<A>,
   C extends Clock<B> = Clock<B>
->(
-  source: S,
-  clock: C
-): GetResultSC<S, C>
-
-export function sample<
-  A = any,
-  B = any,
-  X = any,
+>(source: S, clock: C): GetResultSC<S, C>
+export function sample<A = any, B = any, R = any,
   S extends Source<A> = Source<A>,
   C extends Clock<B> = Clock<B>,
-  F extends FnSCF<S, C, F, X> = FnSCF<S, C, FnSC<S, C>, X>
->(
-  source: S,
-  clock: C,
-  fn: F
-): GetResultSCF<S, C, F>
+  F extends FnSCR<S, C, R> = FnSCR<S, C, R>
+>(source: S, clock: C, fn: F): GetResultSCF<S, C, F>
 
 // S
-export function sample<
-  A = any,
+export function sample<A = any,
   S extends Source<A> = Source<A>
 >(config: {
   source: S,
   clock?: never,
   fn?: never,
-  target?: never
-  name?: string
+  target?: never,
+  name?: string,
   greedy?: boolean
 }): GetResultS<S>
-
 // C
-export function sample<
-  B = any,
+export function sample<B = any,
   C extends Clock<B> = Clock<B>
 >(config: {
   source?: never,
   clock: C,
   fn?: never,
-  target?: never
-  name?: string
+  target?: never,
+  name?: string,
   greedy?: boolean
 }): GetResultC<C>
-
 // SC
-export function sample<
-  A = any,
-  B = any,
+export function sample<A = any, B = any,
   S extends Source<A> = Source<A>,
   C extends Clock<B> = Clock<B>
 >(config: {
   source: S,
   clock: C,
   fn?: never,
-  target?: never
-  name?: string
+  target?: never,
+  name?: string,
   greedy?: boolean
 }): GetResultSC<S, C>
-
 // SF
-export function sample<
-  A = any,
-  X = any,
+export function sample<A = any, R = any,
   S extends Source<A> = Source<A>,
-  F extends FnSF<S, F, X> = FnSF<S, FnS<S>, X>
+  F extends FnSR<S, R> = FnSR<S, R>
 >(config: {
   source: S,
   clock?: never,
   fn: F,
-  target?: never
-  name?: string
+  target?: never,
+  name?: string,
   greedy?: boolean
 }): GetResultSF<S, F>
-
 // CF
-export function sample<
-  B = any,
-  X = any,
+export function sample<B = any, R = any,
   C extends Clock<B> = Clock<B>,
-  F extends FnCF<C, F, X> = FnCF<C, FnC<C>, X>
+  F extends FnCR<C, R> = FnCR<C, R>
 >(config: {
   source?: never,
   clock: C,
   fn: F,
-  target?: never
-  name?: string
+  target?: never,
+  name?: string,
   greedy?: boolean
 }): GetResultCF<C, F>
-
 // SCF
-export function sample<
-  A = any,
-  B = any,
-  X = any,
+export function sample<A = any, B = any, R = any,
   S extends Source<A> = Source<A>,
   C extends Clock<B> = Clock<B>,
-  F extends FnSCF<S, C, F, X> = FnSCF<S, C, FnSC<S, C>, X>
+  F extends FnSCR<S, C, R> = FnSCR<S, C, R>
 >(config: {
   source: S,
   clock: C,
   fn: F,
-  target?: never
-  name?: string
+  target?: never,
+  name?: string,
   greedy?: boolean
 }): GetResultSCF<S, C, F>
 
-// With target
-
+// sample with target
 // ST
-export function sample<
-  A = any,
-  X = any,
+export function sample<A = any,
   S extends Source<A> = Source<A>,
-  T extends Target<X> = Target<X>
+  T extends Target = Target
 >(config: {
   source: S,
   clock?: never,
   fn?: never,
-  target: MultiTarget<GetSource<S>, T>
-  name?: string
+  target: MultiTarget<T, GetSource<S>>,
+  name?: string,
   greedy?: boolean
 }): T
-
 // СT
-export function sample<
-  B = any,
-  X = any,
+export function sample<B = any,
   C extends Clock<B> = Clock<B>,
-  T extends Target<X> = Target<X>
+  T extends Target = Target
 >(config: {
   source?: never,
   clock: C,
   fn?: never,
-  target: MultiTarget<GetClock<C>, T>
-  name?: string
+  target: MultiTarget<T, GetClock<C>>,
+  name?: string,
   greedy?: boolean
 }): T
-
 // SСT
-export function sample<
-  A = any,
-  B = any,
-  X = any,
+export function sample<A = any, B = any,
   S extends Source<A> = Source<A>,
   C extends Clock<B> = Clock<B>,
-  T extends Target<X> = Target<X>
+  T extends Target = Target
 >(config: {
   source: S,
   clock: C,
   fn?: never,
-  target: MultiTarget<GetSource<S>, T>
-  name?: string
+  target: MultiTarget<T, GetSource<S>>,
+  name?: string,
   greedy?: boolean
 }): T
-
 // SFT
-export function sample<
-  A = any,
-  X = any,
+export function sample<A = any, R = any,
   S extends Source<A> = Source<A>,
-  F extends FnSF<S, F, X> = FnSF<S, FnS<S>, X>,
-  T extends Target<X> = Target<X>
+  F extends FnSR<S, R> = FnSR<S, R>,
+  T extends Target = Target
 >(config: {
   source: S,
   clock?: never,
   fn: F,
-  target: MultiTarget<ReturnType<F>, T, X>
-  name?: string
+  target: MultiTarget<T, ReturnType<F>>,
+  name?: string,
   greedy?: boolean
 }): T
-
 // СFT
-export function sample<
-  B = any,
-  X = any,
+export function sample<B = any, R = any,
   C extends Clock<B> = Clock<B>,
-  F extends FnCF<C, F, X> = FnCF<C, FnC<C>, X>,
-  T extends Target<X> = Target<X>
+  F extends FnCR<C, R> = FnCR<C, R>,
+  T extends Target = Target
 >(config: {
   source?: never,
   clock: C,
   fn: F,
-  target: MultiTarget<ReturnType<F>, T, X>
-  name?: string
+  target: MultiTarget<T, ReturnType<F>>,
+  name?: string,
   greedy?: boolean
 }): T
-
 // SCFT
-export function sample<
-  A = any,
-  B = any,
-  X = any,
+export function sample<A = any, B = any, R = any,
   S extends Source<A> = Source<A>,
   C extends Clock<B> = Clock<B>,
-  F extends FnSCF<S, C, F, X> = FnSCF<S, C, FnSC<S, C>, X>,
-  T extends Target<X> = Target<X>
+  F extends FnSCR<S, C, R> = FnSCR<S, C, R>,
+  T extends Target = Target
 >(config: {
   source: S,
   clock: C,
   fn: F,
-  target: MultiTarget<ReturnType<F>, T, X>
-  name?: string
+  target: MultiTarget<T, ReturnType<F>>,
+  name?: string,
   greedy?: boolean
 }): T
 
-// Last overload
+// sample's last overload (for readable error messages)
 export function sample<
-  A = unknown,
-  B = unknown,
-  X = unknown,
-  S extends Source<A> = Source<A>,
-  C extends Clock<B> = Clock<B>,
-  F extends (source: IfUnknown<GetSource<S>, GetClock<C>, GetSource<S>>, clock: GetClock<C>) => unknown = (source: unknown, clock: unknown) => unknown,
-  T extends Target<X> = Target<X>
+  S extends Source<unknown>,
+  C extends Clock<unknown>,
+  F extends IfUnknown<GetSource<S>,
+    (clock: GetClock<C>) => unknown,
+    IfUnknown<GetSource<C>,
+      (source: GetSource<S>) => unknown,
+      (source: GetSource<S>, clock: GetClock<C>) => unknown
+    >
+  >,
+  T extends Target
 >(config: {
-  source: S,
+  source?: S,
   clock?: C,
   fn?: F,
-  target: MultiTarget<IfUnknown<ReturnType<F>, GetSource<S>, ReturnType<F>>, T, X>
-  name?: string
+  target: MultiTarget<T,
+    IfUnknown<ReturnType<F>,
+      IfUnknown<GetSource<S>, GetClock<C>, GetSource<S>>,
+      ReturnType<F>
+    >
+  >,
+  name?: string,
   greedy?: boolean
 }): T
 
+/* guard types */
+
 type ValidTargetUnitGuard<Source, Target extends unknown> =
   Target extends Unit<infer TargetValue>
   ? Source extends TargetValue


Test patch:
diff --git a/src/types/__tests__/effector/sample/arrayTarget.test.ts b/src/types/__tests__/effector/sample/arrayTarget.test.ts
index e2cae13b..8ab22532 100644
--- a/src/types/__tests__/effector/sample/arrayTarget.test.ts
+++ b/src/types/__tests__/effector/sample/arrayTarget.test.ts
@@ -99,7 +99,7 @@ describe('basic cases', () => {
       "
       No overload matches this call.
         The last overload gave the following error.
-          Type '[]' is not assignable to type 'Target<unknown>'.
+          Type '[]' is not assignable to type 'Target'.
             Type '[]' is not assignable to type '[any, ...any[]]'.
               Source has 0 element(s) but target requires 1.
       "
diff --git a/src/types/__tests__/effector/sample/clockArray.test.ts b/src/types/__tests__/effector/sample/clockArray.test.ts
index 911c5f36..78c44eea 100644
--- a/src/types/__tests__/effector/sample/clockArray.test.ts
+++ b/src/types/__tests__/effector/sample/clockArray.test.ts
@@ -425,7 +425,7 @@ describe('without target', () => {
 
     expect(typecheck).toMatchInlineSnapshot(`
       "
-      Type 'Store<[any]> | Store<[any, ...any[]]> | Event<any> | Store<{ [x: string]: any; source: unknown; clock: unknown; }>' is not assignable to type 'Event<{ a: string; clock: any; }>'.
+      Type 'Store<[any]> | Store<[any, ...any[]]> | Event<any>' is not assignable to type 'Event<{ a: string; clock: any; }>'.
         Type 'Store<[any]>' is missing the following properties from type 'Event<{ a: string; clock: any; }>': filter, filterMap, prepend, getType
       No overload matches this call.
         The last overload gave the following error.
@@ -453,7 +453,7 @@ describe('without target', () => {
 
     expect(typecheck).toMatchInlineSnapshot(`
       "
-      Type 'Store<[any]> | Store<[any, ...any[]]> | Event<any> | Store<{ [x: string]: any; source: unknown; clock: unknown; }>' is not assignable to type 'Event<{ a: string; b: string; clock: string; }>'.
+      Type 'Store<[any]> | Store<[any, ...any[]]> | Event<any>' is not assignable to type 'Event<{ a: string; b: string; clock: string; }>'.
         Type 'Store<[any]>' is missing the following properties from type 'Event<{ a: string; b: string; clock: string; }>': filter, filterMap, prepend, getType
       No overload matches this call.
         The last overload gave the following error.
diff --git a/src/types/__tests__/effector/sample/generated/arrayTargetGen.test.ts b/src/types/__tests__/effector/sample/generated/arrayTargetGen.test.ts
index 623e7039..75312b76 100644
--- a/src/types/__tests__/effector/sample/generated/arrayTargetGen.test.ts
+++ b/src/types/__tests__/effector/sample/generated/arrayTargetGen.test.ts
@@ -2367,7 +2367,7 @@ describe('combinable', () => {
       "
       No overload matches this call.
         The last overload gave the following error.
-          Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+          Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
             Types of parameters '__0' and 'source' are incompatible.
               Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                 Types of property 'b' are incompatible.
@@ -2375,7 +2375,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2383,7 +2383,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2391,7 +2391,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2399,7 +2399,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2407,7 +2407,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2415,7 +2415,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2423,7 +2423,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2431,7 +2431,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2439,7 +2439,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2447,14 +2447,14 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
                     Type 'string' is not assignable to type 'number'.
       No overload matches this call.
         The last overload gave the following error.
-          Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+          Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
             Types of parameters '__0' and 'source' are incompatible.
               Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                 Types of property 'b' are incompatible.
@@ -2462,7 +2462,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2470,14 +2470,14 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
                     Type 'string' is not assignable to type 'number'.
       No overload matches this call.
         The last overload gave the following error.
-          Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+          Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
             Types of parameters '__0' and 'source' are incompatible.
               Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                 Types of property 'b' are incompatible.
@@ -2486,7 +2486,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+              Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                     Types of property 'b' are incompatible.
@@ -2495,7 +2495,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+              Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                     Types of property 'b' are incompatible.
@@ -2504,7 +2504,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+              Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                     Types of property 'b' are incompatible.
@@ -2512,7 +2512,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2520,7 +2520,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }, clock: any) => unknown'.
+            Type '({ b }: ABN) => { a: number; b: string; }' is not assignable to type '(source: { a: number; b: string; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; b: string; }' is not assignable to type 'ABN'.
                   Types of property 'b' are incompatible.
@@ -2968,14 +2968,14 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '[number, string]' is not assignable to type '[number, number]'.
                   Type 'string' is not assignable to type 'number'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '[number, string]' is not assignable to type '[number, number]'.
                   Type 'string' is not assignable to type 'number'.
@@ -2983,131 +2983,131 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+            Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string], clock: any) => unknown'.
+              Type '([, b]: [number, number]) => { a: number; b: string; }' is not assignable to type '(source: [number, string]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
@@ -4835,7 +4835,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -4844,7 +4844,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -4853,7 +4853,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -4861,7 +4861,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -4869,7 +4869,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -4877,7 +4877,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -4885,14 +4885,14 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
                     Type 'number' is not assignable to type 'string'.
       No overload matches this call.
         The last overload gave the following error.
-          Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+          Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
             Types of parameters '__0' and 'source' are incompatible.
               Type '{ a: number; }' is not assignable to type 'AS'.
                 Types of property 'a' are incompatible.
@@ -4900,7 +4900,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -4908,7 +4908,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -4916,7 +4916,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -4924,7 +4924,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -4933,7 +4933,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -4942,7 +4942,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -4951,7 +4951,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -4960,7 +4960,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -4969,7 +4969,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -4978,7 +4978,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -4987,7 +4987,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -4996,7 +4996,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -5005,7 +5005,7 @@ describe('combinable', () => {
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+              Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
                 Types of parameters '__0' and 'source' are incompatible.
                   Type '{ a: number; }' is not assignable to type 'AS'.
                     Types of property 'a' are incompatible.
@@ -5013,7 +5013,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -5021,7 +5021,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -5029,7 +5029,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -5037,7 +5037,7 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }, clock: any) => unknown'.
+            Type '({ a }: AS) => { a: number; b: string; }' is not assignable to type '(source: { a: number; }) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '{ a: number; }' is not assignable to type 'AS'.
                   Types of property 'a' are incompatible.
@@ -5628,146 +5628,146 @@ describe('combinable', () => {
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '[number]' is not assignable to type '[string]'.
                   Type 'number' is not assignable to type 'string'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
               Types of parameters '__0' and 'source' are incompatible.
                 Type '[number]' is not assignable to type '[string]'.
                   Type 'number' is not assignable to type 'string'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
-            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+            Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<ABN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AS>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
             Type 'Event<AB>' is not assignable to type '\\"incompatible unit in target\\"'.
-              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number], clock: any) => unknown'.
+              Type '([a]: [string]) => { a: number; b: string; }' is not assignable to type '(source: [number]) => unknown'.
       No overload matches this call.
         The last overload gave the following error.
           Type 'Event<AN>' is not assignable to type '\\"incompatible unit in target\\"'.
diff --git a/src/types/__tests__/effector/sample/sample.test.ts b/src/types/__tests__/effector/sample/sample.test.ts
index 67cc3990..f1f984a9 100644
--- a/src/types/__tests__/effector/sample/sample.test.ts
+++ b/src/types/__tests__/effector/sample/sample.test.ts
@@ -12,7 +12,7 @@ import {
 const typecheck = '{global}'
 
 describe('explicit generics', () => {
-  test('sample<A, B, X>({source, clock, fn, target})', () => {
+  test('sample<A, B, R>({source, clock, fn, target})', () => {
     const source = createEvent<string>()
     const clock = createEvent<number>()
     const target = createEvent<number>()
@@ -70,7 +70,7 @@ describe('explicit generics', () => {
       "
     `)
   })
-  test('sample<A, B, X>({source, clock, fn})', () => {
+  test('sample<A, B, R>({source, clock, fn})', () => {
     const source = createEvent<string>()
     const clock = createEvent<number>()
     const result: Event<number> = sample<string, number, number>({
@@ -110,52 +110,32 @@ describe('explicit generics', () => {
       "
     `)
   })
-  test('sample<A, B, X>({source: shape, clock: list, target: list})', () => {
-    const num = createEvent<number>()
-    const str = createEvent<string>()
-    const anyt = createEvent<any>()
-    const $num = createStore<number>(0)
-    const $str = createStore('')
-    const a_num = createEvent<{a: number}>()
-    const ab_num_str = createEvent<{a: number; b: string}>()
-    const result1 = sample<
-      {a: number; b: string},
-      [number, string, any],
-      [{a: number}, {a: number; b: string}, {a: number}]
-    >({
-      source: {a: $num, b: $str},
-      clock: [num, anyt, str],
-      target: [a_num, ab_num_str, a_num],
-    })
-    const result2 = sample({
-      source: {a: $num, b: $str},
-      clock: [str, anyt, num],
-      target: [a_num, ab_num_str, a_num],
-    })
-    expect(typecheck).toMatchInlineSnapshot(`
-      "
-      no errors
-      "
-    `)
-  })
 })
 
 test('generic edge cases', () => {
-  function generic1<T, S>(target: Store<S>, clock: Event<T>) {
-    const result: Store<S> = sample({
+  function generic1<A, B>(target: Store<A>, clock: Event<B>) {
+    const result = sample({
       source: target,
       clock,
       target,
     })
   }
-  function generic2<T, S>(target: Store<S>, clock: Event<T>) {
-    const result: Store<S> = sample({
+  function generic2<A, B>(target: Store<A>, clock: Event<B>) {
+    const result: Store<A> = sample({
       source: target,
       clock,
       fn: (source, clock) => source,
       target,
     })
   }
+  function generic3<A, B>(target: Store<A>, clock: Event<B>) {
+    const result: Event<B> = sample({
+      source: target,
+      clock,
+      fn: (source, clock) => clock,
+      target: clock,
+    })
+  }
   expect(typecheck).toMatchInlineSnapshot(`
     "
     no errors
@@ -341,7 +321,6 @@ describe('sample(Store<T>):Store<T>', () => {
     })
   })
 })
-
 describe('sample + guard (should pass)', () => {
   test("directly assign `guard` invocation to `sample`'s `clock` argument without losing inference in `sample`'s `fn` (should pass)", () => {
     const source = createStore(0)
@@ -460,3 +439,199 @@ describe('without clock', () => {
     `)
   })
 })
+describe('clock without source', () => {
+  test('with fn (should pass)', () => {
+    const clock = createStore([{foo: 'ok', bar: 0}])
+    const target = createStore({foo: '...', bar: 1})
+    sample({
+      clock,
+      target,
+      fn: ([obj]) => obj,
+    })
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      no errors
+      "
+    `)
+  })
+  test('with fn [clock array] (should pass)', () => {
+    const clock = createStore({foo: 'ok', bar: 0})
+    const target = createStore({foo: '...', bar: 1})
+    sample({
+      clock: [clock],
+      target,
+      fn: foo => foo,
+    })
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      no errors
+      "
+    `)
+  })
+  test('without fn (should pass)', () => {
+    const clock = createEvent<number>()
+    const fx = createEffect<number, void, any>()
+    sample({
+      clock,
+      target: fx,
+    })
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      no errors
+      "
+    `)
+  })
+  test('without fn [void] (should pass)', () => {
+    const clock = createEvent()
+    const fx = createEffect<void, void, any>()
+    sample({
+      clock,
+      target: fx,
+    })
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      no errors
+      "
+    `)
+  })
+  test('without fn [clock array] (should pass)', () => {
+    const foo = createStore('ok')
+    const bar = createStore(0)
+    const target = createEvent<string | number>()
+    sample({
+      clock: [foo, bar],
+      target,
+    })
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      no errors
+      "
+    `)
+  })
+  test('without fn, any to void (should pass)', () => {
+    const clock = createEvent<string>()
+    const target = createEvent<void>()
+    sample({
+      clock,
+      target,
+    })
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      no errors
+      "
+    `)
+  })
+  test('with fn (should fail)', () => {
+    const foo = createStore('ok')
+    const target = createStore(1)
+    sample({
+      clock: foo,
+      fn: foo => foo,
+      //@ts-expect-error
+      target,
+    })
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      No overload matches this call.
+        The last overload gave the following error.
+          Type 'Store<number>' is not assignable to type '\\"incompatible unit in target\\"'.
+      "
+    `)
+  })
+  test('with fn [clock array] (should fail)', () => {
+    const foo = createStore(0)
+    const bar = createStore(1)
+    const target = createStore(2)
+
+    sample({
+      clock: [foo, bar],
+      fn: foo => true,
+      //@ts-expect-error
+      target,
+    })
+
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      No overload matches this call.
+        The last overload gave the following error.
+          Type 'Store<number>' is not assignable to type '\\"incompatible unit in target\\"'.
+      "
+    `)
+  })
+  test('without fn (should fail)', () => {
+    const foo = createStore('ok')
+    const target = createStore(1)
+
+    sample({
+      clock: foo,
+      //@ts-expect-error
+      target,
+    })
+
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      No overload matches this call.
+        The last overload gave the following error.
+          Type 'Store<number>' is not assignable to type '\\"incompatible unit in target\\"'.
+      "
+    `)
+  })
+
+  test('without fn [clock array] (should fail)', () => {
+    const foo = createStore('ok')
+    const bar = createStore(0)
+    const baz = createStore(true)
+    const target = createStore(1)
+
+    sample({
+      clock: [foo, bar, baz],
+      //@ts-expect-error
+      target,
+    })
+
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      No overload matches this call.
+        The last overload gave the following error.
+          Type 'Store<number>' is not assignable to type '\\"incompatible unit in target\\"'.
+      "
+    `)
+  })
+})
+describe('sample + .map', () => {
+  test('directly assign `.map` result to `source` (should pass)', () => {
+    const event: Event<[{foo: string}]> = createEvent()
+    const target = createStore('yes')
+
+    sample({
+      source: event.map(([obj]) => obj.foo),
+      target,
+    })
+
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      no errors
+      "
+    `)
+  })
+  test('directly assign `.map` result to `source` without losing inference in `fn` (should pass)', () => {
+    const event: Event<[{foo: 'payload'}]> = createEvent()
+    const a = createStore(0)
+    const b = createEvent<number | string>()
+
+    sample({
+      source: event.map(([obj]) => obj.foo),
+      fn: payload =>
+        // cast never if payload is any
+        (payload as 0 extends 1 & typeof payload ? never : typeof payload)
+          .length,
+      target: [a, b],
+    })
+
+    expect(typecheck).toMatchInlineSnapshot(`
+      "
+      no errors
+      "
+    `)
+  })
+})