solid-js 1.8.11 → 1.8.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/dev.js +544 -307
  2. package/dist/server.js +170 -75
  3. package/dist/solid.js +471 -265
  4. package/h/dist/h.js +34 -8
  5. package/h/jsx-runtime/dist/jsx.js +1 -1
  6. package/h/jsx-runtime/types/index.d.ts +11 -8
  7. package/h/types/hyperscript.d.ts +11 -11
  8. package/html/dist/html.js +216 -94
  9. package/html/types/lit.d.ts +47 -33
  10. package/package.json +9 -4
  11. package/store/dist/dev.cjs +12 -2
  12. package/store/dist/dev.js +133 -44
  13. package/store/dist/server.js +19 -8
  14. package/store/dist/store.cjs +12 -2
  15. package/store/dist/store.js +124 -41
  16. package/store/types/index.d.ts +21 -7
  17. package/store/types/modifiers.d.ts +6 -3
  18. package/store/types/mutable.d.ts +5 -2
  19. package/store/types/server.d.ts +12 -4
  20. package/store/types/store.d.ts +218 -61
  21. package/types/index.d.ts +75 -10
  22. package/types/reactive/array.d.ts +12 -4
  23. package/types/reactive/observable.d.ts +25 -17
  24. package/types/reactive/scheduler.d.ts +9 -6
  25. package/types/reactive/signal.d.ts +233 -142
  26. package/types/render/Suspense.d.ts +5 -5
  27. package/types/render/component.d.ts +64 -33
  28. package/types/render/flow.d.ts +43 -31
  29. package/types/render/hydration.d.ts +13 -13
  30. package/types/server/index.d.ts +57 -2
  31. package/types/server/reactive.d.ts +73 -42
  32. package/types/server/rendering.d.ts +167 -96
  33. package/universal/dist/dev.js +28 -12
  34. package/universal/dist/universal.js +28 -12
  35. package/universal/types/index.d.ts +3 -1
  36. package/universal/types/universal.d.ts +0 -1
  37. package/web/dist/dev.cjs +3 -0
  38. package/web/dist/dev.js +625 -81
  39. package/web/dist/server.cjs +10 -15
  40. package/web/dist/server.js +216 -107
  41. package/web/dist/web.js +614 -80
  42. package/web/storage/dist/storage.js +10 -0
  43. package/web/storage/package.json +15 -0
  44. package/web/storage/types/index.d.ts +2 -0
  45. package/web/storage/types/index.js +13 -0
  46. package/web/types/client.d.ts +2 -2
  47. package/web/types/core.d.ts +10 -1
  48. package/web/types/index.d.ts +27 -10
  49. package/web/types/server-mock.d.ts +47 -32
  50. package/web/dist/storage.js +0 -10
  51. package/web/types/storage.d.ts +0 -2
  52. /package/web/{dist → storage/dist}/storage.cjs +0 -0
@@ -11,7 +11,7 @@ export type Component<P = {}> = (props: P) => JSX.Element;
11
11
  * would silently throw them away.
12
12
  */
13
13
  export type VoidProps<P = {}> = P & {
14
- children?: never;
14
+ children?: never;
15
15
  };
16
16
  /**
17
17
  * `VoidComponent` forbids the `children` prop.
@@ -25,7 +25,7 @@ export type VoidComponent<P = {}> = Component<VoidProps<P>>;
25
25
  * Use this for components that you want to accept children.
26
26
  */
27
27
  export type ParentProps<P = {}> = P & {
28
- children?: JSX.Element;
28
+ children?: JSX.Element;
29
29
  };
30
30
  /**
31
31
  * `ParentComponent` allows an optional `children` prop with the usual
@@ -40,7 +40,7 @@ export type ParentComponent<P = {}> = Component<ParentProps<P>>;
40
40
  * Note that all JSX <Elements> are of the type `JSX.Element`.
41
41
  */
42
42
  export type FlowProps<P = {}, C = JSX.Element> = P & {
43
- children: C;
43
+ children: C;
44
44
  };
45
45
  /**
46
46
  * `FlowComponent` requires a `children` prop with the specified type.
@@ -59,7 +59,11 @@ export type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (str
59
59
  * ComponentProps<typeof Portal> // { mount?: Node; useShadow?: boolean; children: JSX.Element }
60
60
  * ComponentProps<'div'> // JSX.HTMLAttributes<HTMLDivElement>
61
61
  */
62
- export type ComponentProps<T extends ValidComponent> = T extends Component<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : Record<string, unknown>;
62
+ export type ComponentProps<T extends ValidComponent> = T extends Component<infer P>
63
+ ? P
64
+ : T extends keyof JSX.IntrinsicElements
65
+ ? JSX.IntrinsicElements[T]
66
+ : Record<string, unknown>;
63
67
  /**
64
68
  * Type of `props.ref`, for use in `Component` or `props` typing.
65
69
  *
@@ -68,44 +72,71 @@ export type ComponentProps<T extends ValidComponent> = T extends Component<infer
68
72
  export type Ref<T> = T | ((val: T) => void);
69
73
  export declare function createComponent<T>(Comp: Component<T>, props: T): JSX.Element;
70
74
  type DistributeOverride<T, F> = T extends undefined ? F : T;
71
- type Override<T, U> = T extends any ? U extends any ? {
72
- [K in keyof T]: K extends keyof U ? DistributeOverride<U[K], T[K]> : T[K];
73
- } & {
74
- [K in keyof U]: K extends keyof T ? DistributeOverride<U[K], T[K]> : U[K];
75
- } : T & U : T & U;
76
- type OverrideSpread<T, U> = T extends any ? {
77
- [K in keyof ({
75
+ type Override<T, U> = T extends any
76
+ ? U extends any
77
+ ? {
78
+ [K in keyof T]: K extends keyof U ? DistributeOverride<U[K], T[K]> : T[K];
79
+ } & {
80
+ [K in keyof U]: K extends keyof T ? DistributeOverride<U[K], T[K]> : U[K];
81
+ }
82
+ : T & U
83
+ : T & U;
84
+ type OverrideSpread<T, U> = T extends any
85
+ ? {
86
+ [K in keyof ({
78
87
  [K in keyof T]: any;
79
- } & {
88
+ } & {
80
89
  [K in keyof U]?: any;
81
- } & {
90
+ } & {
82
91
  [K in U extends any ? keyof U : keyof U]?: any;
83
- })]: K extends keyof T ? Exclude<U extends any ? U[K & keyof U] : never, undefined> | T[K] : U extends any ? U[K & keyof U] : never;
84
- } : T & U;
85
- type Simplify<T> = T extends any ? {
86
- [K in keyof T]: T[K];
87
- } : T;
92
+ })]: K extends keyof T
93
+ ? Exclude<U extends any ? U[K & keyof U] : never, undefined> | T[K]
94
+ : U extends any
95
+ ? U[K & keyof U]
96
+ : never;
97
+ }
98
+ : T & U;
99
+ type Simplify<T> = T extends any
100
+ ? {
101
+ [K in keyof T]: T[K];
102
+ }
103
+ : T;
88
104
  type _MergeProps<T extends unknown[], Curr = {}> = T extends [
89
- infer Next | (() => infer Next),
90
- ...infer Rest
91
- ] ? _MergeProps<Rest, Override<Curr, Next>> : T extends [...infer Rest, infer Next | (() => infer Next)] ? Override<_MergeProps<Rest, Curr>, Next> : T extends [] ? Curr : T extends (infer I | (() => infer I))[] ? OverrideSpread<Curr, I> : Curr;
105
+ infer Next | (() => infer Next),
106
+ ...infer Rest
107
+ ]
108
+ ? _MergeProps<Rest, Override<Curr, Next>>
109
+ : T extends [...infer Rest, infer Next | (() => infer Next)]
110
+ ? Override<_MergeProps<Rest, Curr>, Next>
111
+ : T extends []
112
+ ? Curr
113
+ : T extends (infer I | (() => infer I))[]
114
+ ? OverrideSpread<Curr, I>
115
+ : Curr;
92
116
  export type MergeProps<T extends unknown[]> = Simplify<_MergeProps<T>>;
93
117
  export declare function mergeProps<T extends unknown[]>(...sources: T): MergeProps<T>;
94
118
  export type SplitProps<T, K extends (readonly (keyof T)[])[]> = [
95
- ...{
96
- [P in keyof K]: P extends `${number}` ? Pick<T, Extract<K[P], readonly (keyof T)[]>[number]> : never;
97
- },
98
- {
99
- [P in keyof T as Exclude<P, K[number][number]>]: T[P];
100
- }
119
+ ...{
120
+ [P in keyof K]: P extends `${number}`
121
+ ? Pick<T, Extract<K[P], readonly (keyof T)[]>[number]>
122
+ : never;
123
+ },
124
+ {
125
+ [P in keyof T as Exclude<P, K[number][number]>]: T[P];
126
+ }
101
127
  ];
102
- export declare function splitProps<T extends Record<any, any>, K extends [readonly (keyof T)[], ...(readonly (keyof T)[])[]]>(props: T, ...keys: K): SplitProps<T, K>;
103
- export declare function lazy<T extends Component<any>>(fn: () => Promise<{
128
+ export declare function splitProps<
129
+ T extends Record<any, any>,
130
+ K extends [readonly (keyof T)[], ...(readonly (keyof T)[])[]]
131
+ >(props: T, ...keys: K): SplitProps<T, K>;
132
+ export declare function lazy<T extends Component<any>>(
133
+ fn: () => Promise<{
134
+ default: T;
135
+ }>
136
+ ): T & {
137
+ preload: () => Promise<{
104
138
  default: T;
105
- }>): T & {
106
- preload: () => Promise<{
107
- default: T;
108
- }>;
139
+ }>;
109
140
  };
110
141
  export declare function createUniqueId(): string;
111
142
  export {};
@@ -14,9 +14,9 @@ import type { JSX } from "../jsx.js";
14
14
  * @description https://www.solidjs.com/docs/latest/api#for
15
15
  */
16
16
  export declare function For<T extends readonly any[], U extends JSX.Element>(props: {
17
- each: T | undefined | null | false;
18
- fallback?: JSX.Element;
19
- children: (item: T[number], index: Accessor<number>) => U;
17
+ each: T | undefined | null | false;
18
+ fallback?: JSX.Element;
19
+ children: (item: T[number], index: Accessor<number>) => U;
20
20
  }): JSX.Element;
21
21
  /**
22
22
  * Non-keyed iteration over a list creating elements from its items
@@ -32,26 +32,32 @@ export declare function For<T extends readonly any[], U extends JSX.Element>(pro
32
32
  * @description https://www.solidjs.com/docs/latest/api#index
33
33
  */
34
34
  export declare function Index<T extends readonly any[], U extends JSX.Element>(props: {
35
- each: T | undefined | null | false;
36
- fallback?: JSX.Element;
37
- children: (item: Accessor<T[number]>, index: number) => U;
35
+ each: T | undefined | null | false;
36
+ fallback?: JSX.Element;
37
+ children: (item: Accessor<T[number]>, index: number) => U;
38
38
  }): JSX.Element;
39
39
  type RequiredParameter<T> = T extends () => unknown ? never : T;
40
40
  /**
41
41
  * Conditionally render its children or an optional fallback component
42
42
  * @description https://www.solidjs.com/docs/latest/api#show
43
43
  */
44
- export declare function Show<T, TRenderFunction extends (item: Accessor<NonNullable<T>>) => JSX.Element>(props: {
45
- when: T | undefined | null | false;
46
- keyed?: false;
47
- fallback?: JSX.Element;
48
- children: JSX.Element | RequiredParameter<TRenderFunction>;
44
+ export declare function Show<
45
+ T,
46
+ TRenderFunction extends (item: Accessor<NonNullable<T>>) => JSX.Element
47
+ >(props: {
48
+ when: T | undefined | null | false;
49
+ keyed?: false;
50
+ fallback?: JSX.Element;
51
+ children: JSX.Element | RequiredParameter<TRenderFunction>;
49
52
  }): JSX.Element;
50
- export declare function Show<T, TRenderFunction extends (item: NonNullable<T>) => JSX.Element>(props: {
51
- when: T | undefined | null | false;
52
- keyed: true;
53
- fallback?: JSX.Element;
54
- children: JSX.Element | RequiredParameter<TRenderFunction>;
53
+ export declare function Show<
54
+ T,
55
+ TRenderFunction extends (item: NonNullable<T>) => JSX.Element
56
+ >(props: {
57
+ when: T | undefined | null | false;
58
+ keyed: true;
59
+ fallback?: JSX.Element;
60
+ children: JSX.Element | RequiredParameter<TRenderFunction>;
55
61
  }): JSX.Element;
56
62
  /**
57
63
  * switches between content based on mutually exclusive conditions
@@ -68,13 +74,13 @@ export declare function Show<T, TRenderFunction extends (item: NonNullable<T>) =
68
74
  * @description https://www.solidjs.com/docs/latest/api#switchmatch
69
75
  */
70
76
  export declare function Switch(props: {
71
- fallback?: JSX.Element;
72
- children: JSX.Element;
77
+ fallback?: JSX.Element;
78
+ children: JSX.Element;
73
79
  }): JSX.Element;
74
80
  export type MatchProps<T> = {
75
- when: T | undefined | null | false;
76
- keyed?: boolean;
77
- children: JSX.Element | ((item: NonNullable<T> | Accessor<NonNullable<T>>) => JSX.Element);
81
+ when: T | undefined | null | false;
82
+ keyed?: boolean;
83
+ children: JSX.Element | ((item: NonNullable<T> | Accessor<NonNullable<T>>) => JSX.Element);
78
84
  };
79
85
  /**
80
86
  * selects a content based on condition when inside a `<Switch>` control flow
@@ -85,15 +91,21 @@ export type MatchProps<T> = {
85
91
  * ```
86
92
  * @description https://www.solidjs.com/docs/latest/api#switchmatch
87
93
  */
88
- export declare function Match<T, TRenderFunction extends (item: Accessor<NonNullable<T>>) => JSX.Element>(props: {
89
- when: T | undefined | null | false;
90
- keyed?: false;
91
- children: JSX.Element | RequiredParameter<TRenderFunction>;
94
+ export declare function Match<
95
+ T,
96
+ TRenderFunction extends (item: Accessor<NonNullable<T>>) => JSX.Element
97
+ >(props: {
98
+ when: T | undefined | null | false;
99
+ keyed?: false;
100
+ children: JSX.Element | RequiredParameter<TRenderFunction>;
92
101
  }): JSX.Element;
93
- export declare function Match<T, TRenderFunction extends (item: NonNullable<T>) => JSX.Element>(props: {
94
- when: T | undefined | null | false;
95
- keyed: true;
96
- children: JSX.Element | RequiredParameter<TRenderFunction>;
102
+ export declare function Match<
103
+ T,
104
+ TRenderFunction extends (item: NonNullable<T>) => JSX.Element
105
+ >(props: {
106
+ when: T | undefined | null | false;
107
+ keyed: true;
108
+ children: JSX.Element | RequiredParameter<TRenderFunction>;
97
109
  }): JSX.Element;
98
110
  export declare function resetErrorBoundaries(): void;
99
111
  /**
@@ -112,7 +124,7 @@ export declare function resetErrorBoundaries(): void;
112
124
  * @description https://www.solidjs.com/docs/latest/api#errorboundary
113
125
  */
114
126
  export declare function ErrorBoundary(props: {
115
- fallback: JSX.Element | ((err: any, reset: () => void) => JSX.Element);
116
- children: JSX.Element;
127
+ fallback: JSX.Element | ((err: any, reset: () => void) => JSX.Element);
128
+ children: JSX.Element;
117
129
  }): JSX.Element;
118
130
  export {};
@@ -1,20 +1,20 @@
1
1
  import { Computation } from "../reactive/signal.js";
2
2
  export type HydrationContext = {
3
- id: string;
4
- count: number;
3
+ id: string;
4
+ count: number;
5
5
  };
6
6
  type SharedConfig = {
7
- context?: HydrationContext;
8
- resources?: {
9
- [key: string]: any;
10
- };
11
- load?: (id: string) => Promise<any> | any;
12
- has?: (id: string) => boolean;
13
- gather?: (key: string) => void;
14
- registry?: Map<string, Element>;
15
- done?: boolean;
16
- count?: number;
17
- effects?: Computation<any, any>[];
7
+ context?: HydrationContext;
8
+ resources?: {
9
+ [key: string]: any;
10
+ };
11
+ load?: (id: string) => Promise<any> | any;
12
+ has?: (id: string) => boolean;
13
+ gather?: (key: string) => void;
14
+ registry?: Map<string, Element>;
15
+ done?: boolean;
16
+ count?: number;
17
+ effects?: Computation<any, any>[];
18
18
  };
19
19
  export declare const sharedConfig: SharedConfig;
20
20
  export declare function setHydrateContext(context?: HydrationContext): void;
@@ -1,3 +1,58 @@
1
- export { catchError, createRoot, createSignal, createComputed, createRenderEffect, createEffect, createReaction, createDeferred, createSelector, createMemo, getListener, onMount, onCleanup, onError, untrack, batch, on, children, createContext, useContext, getOwner, runWithOwner, equalFn, requestCallback, mapArray, indexArray, observable, from, $PROXY, $DEVCOMP, $TRACK, DEV, enableExternalSource } from "./reactive.js";
2
- export { mergeProps, splitProps, createComponent, For, Index, Show, Switch, Match, ErrorBoundary, Suspense, SuspenseList, createResource, resetErrorBoundaries, enableScheduling, enableHydration, startTransition, useTransition, createUniqueId, lazy, sharedConfig } from "./rendering.js";
1
+ export {
2
+ catchError,
3
+ createRoot,
4
+ createSignal,
5
+ createComputed,
6
+ createRenderEffect,
7
+ createEffect,
8
+ createReaction,
9
+ createDeferred,
10
+ createSelector,
11
+ createMemo,
12
+ getListener,
13
+ onMount,
14
+ onCleanup,
15
+ onError,
16
+ untrack,
17
+ batch,
18
+ on,
19
+ children,
20
+ createContext,
21
+ useContext,
22
+ getOwner,
23
+ runWithOwner,
24
+ equalFn,
25
+ requestCallback,
26
+ mapArray,
27
+ indexArray,
28
+ observable,
29
+ from,
30
+ $PROXY,
31
+ $DEVCOMP,
32
+ $TRACK,
33
+ DEV,
34
+ enableExternalSource
35
+ } from "./reactive.js";
36
+ export {
37
+ mergeProps,
38
+ splitProps,
39
+ createComponent,
40
+ For,
41
+ Index,
42
+ Show,
43
+ Switch,
44
+ Match,
45
+ ErrorBoundary,
46
+ Suspense,
47
+ SuspenseList,
48
+ createResource,
49
+ resetErrorBoundaries,
50
+ enableScheduling,
51
+ enableHydration,
52
+ startTransition,
53
+ useTransition,
54
+ createUniqueId,
55
+ lazy,
56
+ sharedConfig
57
+ } from "./rendering.js";
3
58
  export type { Component, Resource } from "./rendering.js";
@@ -4,87 +4,118 @@ export declare const $TRACK: unique symbol;
4
4
  export declare const $DEVCOMP: unique symbol;
5
5
  export declare const DEV: undefined;
6
6
  export type Accessor<T> = () => T;
7
- export type Setter<T> = undefined extends T ? <U extends T>(value?: (U extends Function ? never : U) | ((prev?: T) => U)) => U : <U extends T>(value: (U extends Function ? never : U) | ((prev: T) => U)) => U;
7
+ export type Setter<T> = undefined extends T
8
+ ? <U extends T>(value?: (U extends Function ? never : U) | ((prev?: T) => U)) => U
9
+ : <U extends T>(value: (U extends Function ? never : U) | ((prev: T) => U)) => U;
8
10
  export type Signal<T> = [get: Accessor<T>, set: Setter<T>];
9
11
  export declare function castError(err: unknown): Error;
10
12
  export declare let Owner: Owner | null;
11
13
  interface Owner {
12
- owner: Owner | null;
13
- context: any | null;
14
- owned: Owner[] | null;
15
- cleanups: (() => void)[] | null;
14
+ owner: Owner | null;
15
+ context: any | null;
16
+ owned: Owner[] | null;
17
+ cleanups: (() => void)[] | null;
16
18
  }
17
19
  export declare function createOwner(): Owner;
18
- export declare function createRoot<T>(fn: (dispose: () => void) => T, detachedOwner?: typeof Owner): T;
19
- export declare function createSignal<T>(value: T, options?: {
20
+ export declare function createRoot<T>(
21
+ fn: (dispose: () => void) => T,
22
+ detachedOwner?: typeof Owner
23
+ ): T;
24
+ export declare function createSignal<T>(
25
+ value: T,
26
+ options?: {
20
27
  equals?: false | ((prev: T, next: T) => boolean);
21
28
  name?: string;
22
- }): [get: () => T, set: (v: (T extends Function ? never : T) | ((prev: T) => T)) => T];
29
+ }
30
+ ): [get: () => T, set: (v: (T extends Function ? never : T) | ((prev: T) => T)) => T];
23
31
  export declare function createComputed<T>(fn: (v?: T) => T, value?: T): void;
24
32
  export declare const createRenderEffect: typeof createComputed;
25
33
  export declare function createEffect<T>(fn: (v?: T) => T, value?: T): void;
26
34
  export declare function createReaction(fn: () => void): (fn: () => void) => void;
27
35
  export declare function createMemo<T>(fn: (v?: T) => T, value?: T): () => T;
28
36
  export declare function createDeferred<T>(source: () => T): () => T;
29
- export declare function createSelector<T>(source: () => T, fn?: (k: T, value: T) => boolean): (k: T) => boolean;
37
+ export declare function createSelector<T>(
38
+ source: () => T,
39
+ fn?: (k: T, value: T) => boolean
40
+ ): (k: T) => boolean;
30
41
  export declare function batch<T>(fn: () => T): T;
31
42
  export declare const untrack: typeof batch;
32
- export declare function on<T, U>(deps: Array<() => T> | (() => T), fn: (value: Array<T> | T, prev?: Array<T> | T, prevResults?: U) => U, options?: {
43
+ export declare function on<T, U>(
44
+ deps: Array<() => T> | (() => T),
45
+ fn: (value: Array<T> | T, prev?: Array<T> | T, prevResults?: U) => U,
46
+ options?: {
33
47
  defer?: boolean;
34
- }): (prev?: U) => U | undefined;
48
+ }
49
+ ): (prev?: U) => U | undefined;
35
50
  export declare function onMount(fn: () => void): void;
36
51
  export declare function onCleanup(fn: () => void): () => void;
37
52
  export declare function cleanNode(node: Owner): void;
38
53
  export declare function catchError<T>(fn: () => T, handler: (err: Error) => void): T | undefined;
39
54
  export declare function getListener(): null;
40
55
  export interface Context<T> {
41
- id: symbol;
42
- Provider: (props: {
43
- value: T;
44
- children: any;
45
- }) => any;
46
- defaultValue?: T;
56
+ id: symbol;
57
+ Provider: (props: { value: T; children: any }) => any;
58
+ defaultValue?: T;
47
59
  }
48
60
  export declare function createContext<T>(defaultValue?: T): Context<T>;
49
61
  export declare function useContext<T>(context: Context<T>): T;
50
62
  export declare function getOwner(): Owner | null;
51
63
  type ChildrenReturn = Accessor<any> & {
52
- toArray: () => any[];
64
+ toArray: () => any[];
53
65
  };
54
66
  export declare function children(fn: () => any): ChildrenReturn;
55
67
  export declare function runWithOwner<T>(o: typeof Owner, fn: () => T): T | undefined;
56
68
  export interface Task {
57
- id: number;
58
- fn: ((didTimeout: boolean) => void) | null;
59
- startTime: number;
60
- expirationTime: number;
69
+ id: number;
70
+ fn: ((didTimeout: boolean) => void) | null;
71
+ startTime: number;
72
+ expirationTime: number;
61
73
  }
62
- export declare function requestCallback(fn: () => void, options?: {
74
+ export declare function requestCallback(
75
+ fn: () => void,
76
+ options?: {
63
77
  timeout: number;
64
- }): Task;
78
+ }
79
+ ): Task;
65
80
  export declare function cancelCallback(task: Task): void;
66
- export declare function mapArray<T, U>(list: Accessor<readonly T[] | undefined | null | false>, mapFn: (v: T, i: Accessor<number>) => U, options?: {
81
+ export declare function mapArray<T, U>(
82
+ list: Accessor<readonly T[] | undefined | null | false>,
83
+ mapFn: (v: T, i: Accessor<number>) => U,
84
+ options?: {
67
85
  fallback?: Accessor<any>;
68
- }): () => U[];
69
- export declare function indexArray<T, U>(list: Accessor<readonly T[] | undefined | null | false>, mapFn: (v: Accessor<T>, i: number) => U, options?: {
86
+ }
87
+ ): () => U[];
88
+ export declare function indexArray<T, U>(
89
+ list: Accessor<readonly T[] | undefined | null | false>,
90
+ mapFn: (v: Accessor<T>, i: number) => U,
91
+ options?: {
70
92
  fallback?: Accessor<any>;
71
- }): () => U[];
72
- export type ObservableObserver<T> = ((v: T) => void) | {
73
- next: (v: T) => void;
74
- error?: (v: any) => void;
75
- complete?: (v: boolean) => void;
76
- };
77
- export declare function observable<T>(input: Accessor<T>): {
78
- subscribe(observer: ObservableObserver<T>): {
79
- unsubscribe(): void;
93
+ }
94
+ ): () => U[];
95
+ export type ObservableObserver<T> =
96
+ | ((v: T) => void)
97
+ | {
98
+ next: (v: T) => void;
99
+ error?: (v: any) => void;
100
+ complete?: (v: boolean) => void;
80
101
  };
81
- [Symbol.observable](): any;
102
+ export declare function observable<T>(input: Accessor<T>): {
103
+ subscribe(observer: ObservableObserver<T>): {
104
+ unsubscribe(): void;
105
+ };
106
+ [Symbol.observable](): any;
82
107
  };
83
- export declare function from<T>(producer: ((setter: Setter<T>) => () => void) | {
84
- subscribe: (fn: (v: T) => void) => (() => void) | {
85
- unsubscribe: () => void;
86
- };
87
- }): Accessor<T>;
108
+ export declare function from<T>(
109
+ producer:
110
+ | ((setter: Setter<T>) => () => void)
111
+ | {
112
+ subscribe: (fn: (v: T) => void) =>
113
+ | (() => void)
114
+ | {
115
+ unsubscribe: () => void;
116
+ };
117
+ }
118
+ ): Accessor<T>;
88
119
  export declare function enableExternalSource(factory: any): void;
89
120
  /**
90
121
  * @deprecated since version 1.7.0 and will be removed in next major - use catchError instead