From ba205574ecf6d54bb4f038ecb93546dff7dc0101 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Fri, 27 Mar 2020 18:35:14 +0000 Subject: [PATCH] refactor(rstream): update fromView value type inference --- packages/rstream/src/from/view.ts | 51 +++++++++++++++---------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/packages/rstream/src/from/view.ts b/packages/rstream/src/from/view.ts index 4dbf45a0ac..07d299b4ba 100644 --- a/packages/rstream/src/from/view.ts +++ b/packages/rstream/src/from/view.ts @@ -1,9 +1,7 @@ -import { View } from "@thi.ng/atom"; -import { Stream } from "../stream"; -import { optsWithID } from "../utils/idgen"; import type { DeepPath, Fn, + OptPathVal, Path, Path0, Path1, @@ -14,18 +12,13 @@ import type { Path6, Path7, Path8, - PathVal1, - PathVal2, - PathVal3, - PathVal4, - PathVal5, - PathVal6, - PathVal7, - PathVal8, Predicate2, } from "@thi.ng/api"; +import { View } from "@thi.ng/atom"; import type { ReadonlyAtom } from "@thi.ng/atom"; import type { CommonOpts } from "../api"; +import { Stream } from "../stream"; +import { optsWithID } from "../utils/idgen"; export interface FromViewOpts extends Partial { path: P; @@ -104,48 +97,52 @@ export function fromView( ): Stream; export function fromView( parent: ReadonlyAtom, - opts: FromViewOpts, PathVal1, R> -): Stream : R>; + opts: FromViewOpts, OptPathVal, R> +): Stream : R>; export function fromView( parent: ReadonlyAtom, - opts: FromViewOpts, PathVal2, R> -): Stream : R>; + opts: FromViewOpts, OptPathVal, R> +): Stream : R>; export function fromView( parent: ReadonlyAtom, - opts: FromViewOpts, PathVal3, R> -): Stream : R>; + opts: FromViewOpts, OptPathVal, R> +): Stream : R>; export function fromView( parent: ReadonlyAtom, - opts: FromViewOpts, PathVal4, R> -): Stream : R>; + opts: FromViewOpts, OptPathVal, R> +): Stream : R>; export function fromView( parent: ReadonlyAtom, - opts: FromViewOpts, PathVal5, R> -): Stream : R>; + opts: FromViewOpts< + Path5, + OptPathVal, + R + > +): Stream : R>; export function fromView( parent: ReadonlyAtom, opts: FromViewOpts< Path6, - PathVal6, + OptPathVal, R > -): Stream : R>; +): Stream : R>; export function fromView( parent: ReadonlyAtom, opts: FromViewOpts< Path7, - PathVal7, + OptPathVal, R > -): Stream : R>; +): Stream : R>; export function fromView( parent: ReadonlyAtom, opts: FromViewOpts< Path8, - PathVal8, + OptPathVal, R > -): Stream : R>; +): Stream : R>; export function fromView( parent: ReadonlyAtom, opts: FromViewOpts, any, R>