File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,7 @@ type HistorySeed<ValueType = any> = {
3232 archive_tail : Array < ValueType >
3333}
3434
35- export class Watchable <
36- ValueType = any
37- // ValueType extends AlmostAnything = Input extends Fetcher<infer V> ? V : Input
38- > {
35+ export class Watchable < ValueType = any > {
3936 protected _watchableStore : WatchableStore <
4037 PlexusWatchableValueInterpreter < ValueType >
4138 >
@@ -102,10 +99,7 @@ export class Watchable<
10299 }
103100}
104101
105- export class WatchableMutable <
106- // Input = never,
107- ValueType = any
108- > extends Watchable < ValueType > {
102+ export class WatchableMutable < ValueType = any > extends Watchable < ValueType > {
109103 private _history : HistorySeed | undefined
110104 // constructor(instance: () => PlexusInstance, init: () => ValueType)
111105 // constructor(instance: () => PlexusInstance, init: ValueType)
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export type UnionToIntersection<U> = (
3131) extends ( k : infer I ) => void
3232 ? I
3333 : never
34+
3435export type IsUnion < T > = [ T ] extends [ UnionToIntersection < T > ] ? false : true
3536
3637export type PlexusWatchableValueInterpreter < Value > = Value extends (
@@ -62,14 +63,17 @@ export declare type AsyncState<T> =
6263 }
6364
6465export declare type FunctionReturningPromise = ( ...args : any [ ] ) => Promise < any >
66+
6567export declare type PromiseType < P extends Promise < any > > = P extends Promise <
6668 infer T
6769>
6870 ? T
6971 : never
72+
7073declare type StateFromFunctionReturningPromise <
7174 T extends FunctionReturningPromise
7275> = AsyncState < PromiseType < ReturnType < T > > >
76+
7377export declare type AsyncFnReturn <
7478 T extends FunctionReturningPromise = FunctionReturningPromise
7579> = [ StateFromFunctionReturningPromise < T > , T ]
You can’t perform that action at this time.
0 commit comments