@solid-primitives/utils 7.0.0-next.0 → 7.0.0-next.2

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.
package/dist/index.d.ts CHANGED
@@ -1,269 +1,273 @@
1
- import { onCleanup, createSignal, type Accessor, type ComputeFunction, type NoInfer, type Setter, type SignalOptions, type Signal, type Store, type StoreSetter } from "solid-js";
1
+ /* @ts-self-types="./index.d.ts" */
2
+ import { AccessReturnTypes, AccessorArray, AnyClass, AnyFunction, AnyObject, AnyStatic, DeepPartialAny, Directive, ExtractIfPossible, Falsy, FalsyValue, ItemsOf, ItemsOfMany, Many, MaybeAccessor, MaybeAccessorValue, Modify, ModifyDeep, Narrow, NoInfer, NonIterable, Noop, OnAccessEffectFunction, Position, PrimitiveValue, RequiredKeys, SetterParam, Simplify, Size, Tail, Truthy, UnboxLazy, UnionToIntersection, Values } from "./types.js";
3
+ import { Accessor, ComputeFunction, NoInfer as NoInfer$1, Setter, Signal, SignalOptions, Store, StoreSetter, createSignal, onCleanup } from "solid-js";
4
+
5
+ //#region src/index.d.ts
2
6
  declare const isServer: boolean;
3
- import type { AccessorArray, AnyClass, MaybeAccessor, MaybeAccessorValue, Noop, AnyObject, AnyFunction } from "./types.js";
4
- export * from "./types.js";
5
- /** `true` on the server (SSR), `false` in the browser. */
6
- export { isServer };
7
7
  /** `true` in the browser, `false` on the server. */
8
- export declare const isClient: boolean;
8
+ declare const isClient: boolean;
9
9
  /** `true` in the browser with Solid's DEV mode active. */
10
- export declare const isDev: boolean;
10
+ declare const isDev: boolean;
11
11
  /** `true` when DEV mode is off (i.e. production browser builds and all SSR). */
12
- export declare const isProd: boolean;
12
+ declare const isProd: boolean;
13
13
  /** No-operation function — accepts any arguments and returns `undefined`. */
14
- export declare const noop: Noop;
14
+ declare const noop: Noop;
15
15
  /** A function that always returns `true`. Useful as a default predicate prop. */
16
- export declare const trueFn: () => boolean;
16
+ declare const trueFn: () => boolean;
17
17
  /** A function that always returns `false`. Useful as a default predicate prop. */
18
- export declare const falseFn: () => boolean;
18
+ declare const falseFn: () => boolean;
19
19
  /** @deprecated use {@link equalFn} from "solid-js" */
20
- export declare const defaultEquals: (value1: any, value2: any) => boolean;
20
+ declare const defaultEquals: typeof Object.is;
21
21
  /**
22
- * Signal options that disable equality checking, causing the signal to always
23
- * notify subscribers even when the value hasn't changed. Useful for signals
24
- * holding mutable objects where structural equality cannot be assumed.
25
- */
26
- export declare const EQUALS_FALSE_OPTIONS: {
27
- readonly equals: false;
22
+ * Signal options that disable equality checking, causing the signal to always
23
+ * notify subscribers even when the value hasn't changed. Useful for signals
24
+ * holding mutable objects where structural equality cannot be assumed.
25
+ */
26
+ declare const EQUALS_FALSE_OPTIONS: {
27
+ readonly equals: false;
28
28
  };
29
29
  /**
30
- * Signal options that allow writes from inside an owned reactive scope
31
- * (component body, memo, or effect) without throwing `SIGNAL_WRITE_IN_OWNED_SCOPE`
32
- * in Solid 2.0 dev mode.
33
- *
34
- * Use only for implementation-detail signals that genuinely need to be written
35
- * from within a scope — not as a general escape hatch.
36
- */
37
- export declare const INTERNAL_OPTIONS: {
38
- readonly ownedWrite: true;
30
+ * Signal options that allow writes from inside an owned reactive scope
31
+ * (component body, memo, or effect) without throwing `SIGNAL_WRITE_IN_OWNED_SCOPE`
32
+ * in Solid 2.0 dev mode.
33
+ *
34
+ * Use only for implementation-detail signals that genuinely need to be written
35
+ * from within a scope — not as a general escape hatch.
36
+ */
37
+ declare const INTERNAL_OPTIONS: {
38
+ readonly ownedWrite: true;
39
39
  };
40
40
  /**
41
- * Returns `true` if `v` is an instance of `c`. Checks both `instanceof` and
42
- * `constructor` so that values created across different realms (e.g. iframes) match.
43
- */
44
- export declare const ofClass: (v: any, c: AnyClass) => boolean;
41
+ * Returns `true` if `v` is an instance of `c`. Checks both `instanceof` and
42
+ * `constructor` so that values created across different realms (e.g. iframes) match.
43
+ */
44
+ declare const ofClass: (v: any, c: AnyClass) => boolean;
45
45
  /** Check if value is typeof "object" or "function" */
46
- export declare function isObject(value: any): value is AnyObject;
46
+ declare function isObject(value: any): value is AnyObject;
47
47
  /** Type guard: returns `true` when `i` is neither `null` nor `undefined`. */
48
- export declare const isNonNullable: <T>(i: T) => i is NonNullable<T>;
48
+ declare const isNonNullable: <T>(i: T) => i is NonNullable<T>;
49
49
  /** Returns a new array with all `null` and `undefined` items removed. */
50
- export declare const filterNonNullable: <T extends readonly unknown[]>(arr: T) => NonNullable<T[number]>[];
50
+ declare const filterNonNullable: <T extends readonly unknown[]>(arr: T) => NonNullable<T[number]>[];
51
51
  /** Three-way comparison: returns `-1` if `a < b`, `1` if `a > b`, `0` if equal. */
52
- export declare const compare: (a: any, b: any) => number;
52
+ declare const compare: (a: any, b: any) => number;
53
53
  /**
54
- * Check shallow array equality
55
- */
56
- export declare const arrayEquals: (a: readonly unknown[], b: readonly unknown[]) => boolean;
54
+ * Check shallow array equality
55
+ */
56
+ declare const arrayEquals: (a: readonly unknown[], b: readonly unknown[]) => boolean;
57
57
  /**
58
- * Returns a function that will call all functions in the order they were chained with the same arguments.
59
- */
60
- export declare function chain<Args extends [] | any[]>(callbacks: {
61
- [Symbol.iterator](): IterableIterator<((...args: Args) => any) | undefined>;
58
+ * Returns a function that will call all functions in the order they were chained with the same arguments.
59
+ */
60
+ declare function chain<Args extends [] | any[]>(callbacks: {
61
+ [Symbol.iterator](): IterableIterator<((...args: Args) => any) | undefined>;
62
62
  }): (...args: Args) => void;
63
63
  /**
64
- * Returns a function that will call all functions in the reversed order with the same arguments.
65
- */
66
- export declare function reverseChain<Args extends [] | any[]>(callbacks: (((...args: Args) => any) | undefined)[]): (...args: Args) => void;
64
+ * Returns a function that will call all functions in the reversed order with the same arguments.
65
+ */
66
+ declare function reverseChain<Args extends [] | any[]>(callbacks: (((...args: Args) => any) | undefined)[]): (...args: Args) => void;
67
67
  /** Clamps `n` to the inclusive range `[min, max]`. */
68
- export declare const clamp: (n: number, min: number, max: number) => number;
68
+ declare const clamp: (n: number, min: number, max: number) => number;
69
+ /** Creates an ID generator with its own isolated counter and per-generator random segment. Each call to the returned function produces a `timestamp-sequence-random` string that is unique within the generator and with high probability unique across independent generators (e.g. separate processes or SSR requests). */
70
+ declare const createIdGenerator: () => (() => string);
69
71
  /**
70
- * Accesses the value of a MaybeAccessor
71
- * @example
72
- * ```ts
73
- * access("foo") // => "foo"
74
- * access(() => "foo") // => "foo"
75
- * ```
76
- */
77
- export declare const access: <T extends MaybeAccessor<any>>(v: T) => MaybeAccessorValue<T>;
72
+ * Accesses the value of a MaybeAccessor
73
+ * @example
74
+ * ```ts
75
+ * access("foo") // => "foo"
76
+ * access(() => "foo") // => "foo"
77
+ * ```
78
+ */
79
+ declare const access: <T extends MaybeAccessor<any>>(v: T) => MaybeAccessorValue<T>;
78
80
  /**
79
- * Wraps `value` in a single-element array. If `value` is already an array it is
80
- * returned as-is. Falsy values (except `0` and `false`) produce an empty array.
81
- */
82
- export declare const asArray: <T>(value: T) => (T extends any[] ? T[number] : NonNullable<T>)[];
81
+ * Wraps `value` in a single-element array. If `value` is already an array it is
82
+ * returned as-is. Falsy values (except `0` and `false`) produce an empty array.
83
+ */
84
+ declare const asArray: <T>(value: T) => (T extends any[] ? T[number] : NonNullable<T>)[];
83
85
  /**
84
- * Access an array of MaybeAccessors
85
- * @example
86
- * const list = [1, 2, () => 3)] // T: MaybeAccessor<number>[]
87
- * const newList = accessArray(list) // T: number[]
88
- */
89
- export declare const accessArray: <A extends MaybeAccessor<any>>(list: readonly A[]) => MaybeAccessorValue<A>[];
86
+ * Access an array of MaybeAccessors
87
+ * @example
88
+ * const list = [1, 2, () => 3)] // T: MaybeAccessor<number>[]
89
+ * const newList = accessArray(list) // T: number[]
90
+ */
91
+ declare const accessArray: <A extends MaybeAccessor<any>>(list: readonly A[]) => MaybeAccessorValue<A>[];
90
92
  /**
91
- * Run the function if the accessed value is not `undefined` nor `null`
92
- * @param value
93
- * @param fn
94
- */
95
- export declare const withAccess: <T, A extends MaybeAccessor<T>, V = MaybeAccessorValue<A>>(value: A, fn: (value: NonNullable<V>) => void) => void;
93
+ * Run the function if the accessed value is not `undefined` nor `null`
94
+ * @param value
95
+ * @param fn
96
+ */
97
+ declare const withAccess: <T, A extends MaybeAccessor<T>, V = MaybeAccessorValue<A>>(value: A, fn: (value: NonNullable<V>) => void) => void;
96
98
  /**
97
- * Wraps a plain value in a zero-argument accessor `() => value`.
98
- * If `v` is already a function it is returned unchanged.
99
- */
100
- export declare const asAccessor: <A extends MaybeAccessor<unknown>>(v: A) => Accessor<MaybeAccessorValue<A>>;
99
+ * Wraps a plain value in a zero-argument accessor `() => value`.
100
+ * If `v` is already a function it is returned unchanged.
101
+ */
102
+ declare const asAccessor: <A extends MaybeAccessor<unknown>>(v: A) => Accessor<MaybeAccessorValue<A>>;
101
103
  /** If value is a function – call it with a given arguments – otherwise get the value as is */
102
- export declare function accessWith<T>(valueOrFn: T, ...args: T extends AnyFunction ? Parameters<T> : never): T extends AnyFunction ? ReturnType<T> : T;
104
+ declare function accessWith<T>(valueOrFn: T, ...args: T extends AnyFunction ? Parameters<T> : never): T extends AnyFunction ? ReturnType<T> : T;
103
105
  /**
104
- * A deferred effect compute function. Skips the first reactive run and returns
105
- * `initialValue` instead, then calls `fn` on subsequent dependency changes.
106
- * Useful as the compute phase of `createEffect(defer(...), apply)` when the
107
- * initial run should be suppressed.
108
- *
109
- * @param deps - a single accessor or an array of accessors to track
110
- * @param fn - called with the current input, previous input, and previous return value
111
- * @param initialValue - returned on the skipped first run (defaults to `undefined`)
112
- */
113
- export declare function defer<S, Next extends Prev, Prev = Next>(deps: AccessorArray<S> | Accessor<S>, fn: (input: S, prevInput: S, prev: undefined | NoInfer<Prev>) => Next, initialValue: Next): ComputeFunction<undefined | NoInfer<Next>, NoInfer<Next>>;
114
- export declare function defer<S, Next extends Prev, Prev = Next>(deps: AccessorArray<S> | Accessor<S>, fn: (input: S, prevInput: S, prev: undefined | NoInfer<Prev>) => Next, initialValue?: undefined): ComputeFunction<undefined | NoInfer<Next>>;
106
+ * A deferred effect compute function. Skips the first reactive run and returns
107
+ * `initialValue` instead, then calls `fn` on subsequent dependency changes.
108
+ * Useful as the compute phase of `createEffect(defer(...), apply)` when the
109
+ * initial run should be suppressed.
110
+ *
111
+ * @param deps - a single accessor or an array of accessors to track
112
+ * @param fn - called with the current input, previous input, and previous return value
113
+ * @param initialValue - returned on the skipped first run (defaults to `undefined`)
114
+ */
115
+ declare function defer<S, Next extends Prev, Prev = Next>(deps: AccessorArray<S> | Accessor<S>, fn: (input: S, prevInput: S, prev: undefined | NoInfer$1<Prev>) => Next, initialValue: Next): ComputeFunction<undefined | NoInfer$1<Next>, NoInfer$1<Next>>;
116
+ declare function defer<S, Next extends Prev, Prev = Next>(deps: AccessorArray<S> | Accessor<S>, fn: (input: S, prevInput: S, prev: undefined | NoInfer$1<Prev>) => Next, initialValue?: undefined): ComputeFunction<undefined | NoInfer$1<Next>>;
115
117
  /**
116
- * Get entries of an object
117
- */
118
- export declare const entries: <T extends object>(obj: T) => [keyof T, T[keyof T]][];
118
+ * Get entries of an object
119
+ */
120
+ declare const entries: <T extends object>(obj: T) => [keyof T, T[keyof T]][];
119
121
  /**
120
- * Get keys of an object
121
- */
122
- export declare const keys: <T extends object>(object: T) => (keyof T)[];
122
+ * Get keys of an object
123
+ */
124
+ declare const keys: <T extends object>(object: T) => (keyof T)[];
123
125
  /**
124
- * Solid's `onCleanup` that doesn't warn in development if used outside of a component.
125
- */
126
- export declare const tryOnCleanup: typeof onCleanup;
126
+ * Solid's `onCleanup` that doesn't warn in development if used outside of a component.
127
+ */
128
+ declare const tryOnCleanup: typeof onCleanup;
127
129
  /**
128
- * Creates a stack of callbacks that can be pushed to, executed all at once, or cleared.
129
- * All callbacks receive the same arguments when `execute` is called; the stack is
130
- * automatically cleared after execution.
131
- *
132
- * @example
133
- * ```ts
134
- * const stack = createCallbackStack<string>();
135
- * stack.push(s => console.log("a:", s));
136
- * stack.push(s => console.log("b:", s));
137
- * stack.execute("hello"); // logs "a: hello", "b: hello" — stack is now empty
138
- * ```
139
- */
140
- export declare const createCallbackStack: <A0 = void, A1 = void, A2 = void, A3 = void>() => {
141
- push: (...callbacks: ((arg0: A0, arg1: A1, arg2: A2, arg3: A3) => void)[]) => void;
142
- execute: (arg0: A0, arg1: A1, arg2: A2, arg3: A3) => void;
143
- clear: VoidFunction;
130
+ * Creates a stack of callbacks that can be pushed to, executed all at once, or cleared.
131
+ * All callbacks receive the same arguments when `execute` is called; the stack is
132
+ * automatically cleared after execution.
133
+ *
134
+ * @example
135
+ * ```ts
136
+ * const stack = createCallbackStack<string>();
137
+ * stack.push(s => console.log("a:", s));
138
+ * stack.push(s => console.log("b:", s));
139
+ * stack.execute("hello"); // logs "a: hello", "b: hello" — stack is now empty
140
+ * ```
141
+ */
142
+ declare const createCallbackStack: <A0 = void, A1 = void, A2 = void, A3 = void>() => {
143
+ push: (...callbacks: ((arg0: A0, arg1: A1, arg2: A2, arg3: A3) => void)[]) => void;
144
+ execute: (arg0: A0, arg1: A1, arg2: A2, arg3: A3) => void;
145
+ clear: VoidFunction;
144
146
  };
145
147
  /**
146
- * Returns a debounced wrapper around `fn` that batches rapid synchronous calls
147
- * into a single invocation. Only the most-recently-passed arguments are forwarded.
148
- * The counter resets on cleanup so stale microtasks are silently discarded.
149
- *
150
- * @example
151
- * ```ts
152
- * const flush = createMicrotask((value: string) => console.log(value));
153
- * flush("a");
154
- * flush("b");
155
- * flush("c"); // only "c" is logged (in the next microtask)
156
- * ```
157
- */
158
- export declare function createMicrotask<A extends any[] | []>(fn: (...a: A) => void): (...a: A) => void;
148
+ * Returns a debounced wrapper around `fn` that batches rapid synchronous calls
149
+ * into a single invocation. Only the most-recently-passed arguments are forwarded.
150
+ * The counter resets on cleanup so stale microtasks are silently discarded.
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * const flush = createMicrotask((value: string) => console.log(value));
155
+ * flush("a");
156
+ * flush("b");
157
+ * flush("c"); // only "c" is logged (in the next microtask)
158
+ * ```
159
+ */
160
+ declare function createMicrotask<A extends any[] | []>(fn: (...a: A) => void): (...a: A) => void;
159
161
  /**
160
- * A hydratable version of the {@link createSignal}. It will use the serverValue on the server and the update function on the client. If initialized during hydration it will use serverValue as the initial value and update it once hydration is complete.
161
- *
162
- * @param serverValue initial value of the state on the server
163
- * @param update called once on the client or on hydration to initialize the value
164
- * @param options {@link SignalOptions}
165
- * @returns
166
- * ```ts
167
- * [state: Accessor<T>, setState: Setter<T>]
168
- * ```
169
- * @see {@link createSignal}
170
- */
171
- export declare function createHydratableSignal<T>(serverValue: T, update: () => T, options?: SignalOptions<T>): ReturnType<typeof createSignal<T>>;
162
+ * A hydratable version of the {@link createSignal}. It will use the serverValue on the server and the update function on the client. If initialized during hydration it will use serverValue as the initial value and update it once hydration is complete.
163
+ *
164
+ * @param serverValue initial value of the state on the server
165
+ * @param update called once on the client or on hydration to initialize the value
166
+ * @param options {@link SignalOptions}
167
+ * @returns
168
+ * ```ts
169
+ * [state: Accessor<T>, setState: Setter<T>]
170
+ * ```
171
+ * @see {@link createSignal}
172
+ */
173
+ declare function createHydratableSignal<T>(serverValue: T, update: () => T, options?: SignalOptions<T>): ReturnType<typeof createSignal<T>>;
172
174
  /** @deprecated use {@link createHydratableSignal} instead */
173
- export declare const createHydrateSignal: typeof createHydratableSignal;
175
+ declare const createHydrateSignal: typeof createHydratableSignal;
174
176
  /**
175
- * Diffs two arrays by reference and calls `handleAdded` / `handleRemoved` for
176
- * each item that appeared or disappeared. Items are compared with `===`.
177
- *
178
- * @param current - the new array
179
- * @param prev - the previous array snapshot
180
- * @param handleAdded - called once for each item present in `current` but not `prev`
181
- * @param handleRemoved - called once for each item present in `prev` but not `current`
182
- */
183
- export declare function handleDiffArray<T>(current: readonly T[], prev: readonly T[], handleAdded: (item: T) => void, handleRemoved: (item: T) => void): void;
177
+ * Diffs two arrays by reference and calls `handleAdded` / `handleRemoved` for
178
+ * each item that appeared or disappeared. Items are compared with `===`.
179
+ *
180
+ * @param current - the new array
181
+ * @param prev - the previous array snapshot
182
+ * @param handleAdded - called once for each item present in `current` but not `prev`
183
+ * @param handleRemoved - called once for each item present in `prev` but not `current`
184
+ */
185
+ declare function handleDiffArray<T>(current: readonly T[], prev: readonly T[], handleAdded: (item: T) => void, handleRemoved: (item: T) => void): void;
184
186
  /**
185
- * Schedules `fn` to run after the browser has painted by nesting two
186
- * requestAnimationFrame calls. No-op in non-browser environments.
187
- */
188
- export declare const afterPaint: (fn: () => void) => void;
187
+ * Schedules `fn` to run after the browser has painted by nesting two
188
+ * requestAnimationFrame calls. No-op in non-browser environments.
189
+ */
190
+ declare const afterPaint: (fn: () => void) => void;
189
191
  /**
190
- * Parse a string as a single JSON value.
191
- *
192
- * ```ts
193
- * const { data } = createSSE<{ status: string }>(url, { transform: json });
194
- * ```
195
- */
196
- export declare const json: <T>(raw: string) => T;
192
+ * Parse a string as a single JSON value.
193
+ *
194
+ * ```ts
195
+ * const { data } = createSSE<{ status: string }>(url, { transform: json });
196
+ * ```
197
+ */
198
+ declare const json: <T>(raw: string) => T;
197
199
  /**
198
- * Parse a string as newline-delimited JSON (NDJSON / JSON Lines).
199
- *
200
- * Each non-empty line is parsed as a separate JSON value and returned as an array.
201
- *
202
- * ```ts
203
- * const { data } = createSSE<TickEvent[]>(url, { transform: ndjson });
204
- * // data() === [{ id: 1, type: "tick" }, { id: 2, type: "tick" }]
205
- * ```
206
- */
207
- export declare const ndjson: <T>(raw: string) => T[];
200
+ * Parse a string as newline-delimited JSON (NDJSON / JSON Lines).
201
+ *
202
+ * Each non-empty line is parsed as a separate JSON value and returned as an array.
203
+ *
204
+ * ```ts
205
+ * const { data } = createSSE<TickEvent[]>(url, { transform: ndjson });
206
+ * // data() === [{ id: 1, type: "tick" }, { id: 2, type: "tick" }]
207
+ * ```
208
+ */
209
+ declare const ndjson: <T>(raw: string) => T[];
208
210
  /**
209
- * Split a string into individual lines, returning a `string[]`. Empty lines are filtered out.
210
- *
211
- * ```ts
212
- * const { data } = createSSE<string[]>(url, { transform: lines });
213
- * // data() === ["line one", "line two"]
214
- * ```
215
- */
216
- export declare const lines: (raw: string) => string[];
211
+ * Split a string into individual lines, returning a `string[]`. Empty lines are filtered out.
212
+ *
213
+ * ```ts
214
+ * const { data } = createSSE<string[]>(url, { transform: lines });
215
+ * // data() === ["line one", "line two"]
216
+ * ```
217
+ */
218
+ declare const lines: (raw: string) => string[];
217
219
  /**
218
- * Parse a string as a number using `Number()` semantics.
219
- *
220
- * Note: `""` → `0`, non-numeric strings → `NaN`.
221
- *
222
- * ```ts
223
- * const { data } = createSSE<number>(url, { transform: number });
224
- * // data() === 42
225
- * ```
226
- */
227
- export declare const number: (raw: string) => number;
220
+ * Parse a string as a number using `Number()` semantics.
221
+ *
222
+ * Note: `""` → `0`, non-numeric strings → `NaN`.
223
+ *
224
+ * ```ts
225
+ * const { data } = createSSE<number>(url, { transform: number });
226
+ * // data() === 42
227
+ * ```
228
+ */
229
+ declare const number: (raw: string) => number;
228
230
  /**
229
- * Wrap any `(string) => T` transform in a `try/catch`. Returns `fallback`
230
- * (default `undefined`) instead of throwing on malformed input.
231
- *
232
- * ```ts
233
- * const { data } = createSSE<MyEvent>(url, { transform: safe(json) });
234
- * const { data } = createSSE<number>(url, { transform: safe(number, 0) });
235
- * ```
236
- */
237
- export declare function safe<T>(transform: (raw: string) => T): (raw: string) => T | undefined;
238
- export declare function safe<T>(transform: (raw: string) => T, fallback: T): (raw: string) => T;
231
+ * Wrap any `(string) => T` transform in a `try/catch`. Returns `fallback`
232
+ * (default `undefined`) instead of throwing on malformed input.
233
+ *
234
+ * ```ts
235
+ * const { data } = createSSE<MyEvent>(url, { transform: safe(json) });
236
+ * const { data } = createSSE<number>(url, { transform: safe(number, 0) });
237
+ * ```
238
+ */
239
+ declare function safe<T>(transform: (raw: string) => T): (raw: string) => T | undefined;
240
+ declare function safe<T>(transform: (raw: string) => T, fallback: T): (raw: string) => T;
239
241
  /**
240
- * Compose two transforms into one: the output of `a` is passed as the input of `b`.
241
- *
242
- * ```ts
243
- * const { data } = createSSE<RawEvent[]>(url, {
244
- * transform: pipe(ndjson<RawEvent>, rows => rows.filter(r => r.type === "tick")),
245
- * });
246
- * ```
247
- */
248
- export declare function pipe<A, B>(a: (raw: string) => A, b: (a: A) => B): (raw: string) => B;
242
+ * Compose two transforms into one: the output of `a` is passed as the input of `b`.
243
+ *
244
+ * ```ts
245
+ * const { data } = createSSE<RawEvent[]>(url, {
246
+ * transform: pipe(ndjson<RawEvent>, rows => rows.filter(r => r.type === "tick")),
247
+ * });
248
+ * ```
249
+ */
250
+ declare function pipe<A, B>(a: (raw: string) => A, b: (a: A) => B): (raw: string) => B;
249
251
  /**
250
- * Check if a wrapper element contains a target element.
251
- * Portal-aware: follows SolidJS `_$host` links so elements rendered inside
252
- * a `<Portal>` are correctly treated as children of the portal's anchor.
253
- */
254
- export declare const contains: (wrapper: HTMLElement, target: HTMLElement) => boolean;
252
+ * Check if a wrapper element contains a target element.
253
+ * Portal-aware: follows SolidJS `_$host` links so elements rendered inside
254
+ * a `<Portal>` are correctly treated as children of the portal's anchor.
255
+ */
256
+ declare const contains: (wrapper: HTMLElement, target: HTMLElement) => boolean;
255
257
  /**
256
- * Wraps a setter function of any signal or store
257
- *
258
- * ```ts
259
- * const [data, setData] = wrapSetter(
260
- * createSignal(initialData),
261
- * (setter) => (next) => { console.log(next); return setter(next); },
262
- * );
263
- * ```
264
- * If you destructure signal or store in a longer tuple, you need to use a const assertion for the types to work.
265
- */
266
- export declare function wrapSetter<T>(signal: Signal<T>, wrapper: (setter: Setter<T>) => Setter<T>): Signal<T>;
267
- export declare function wrapSetter<T>(store: [Store<T>, StoreSetter<T>], wrapper: (setter: StoreSetter<T>) => StoreSetter<T>): [Store<T>, StoreSetter<T>];
268
- export declare function wrapSetter<T, S extends Signal<T> | [Store<T>, StoreSetter<T>] | [...Signal<T>, ...any[]] | [Store<T>, StoreSetter<T>, ...any[]]>(signalOrStore: S, wrapper: (setter: S[1]) => S[1]): S;
269
- export declare function wrapSetter<T, S extends Signal<T> | [Store<T>, StoreSetter<T>] | readonly [...Signal<T>, ...any[]] | readonly [Store<T>, StoreSetter<T>, ...any[]]>(signalOrStore: S, wrapper: (setter: S[1]) => S[1]): S;
258
+ * Wraps a setter function of any signal or store
259
+ *
260
+ * ```ts
261
+ * const [data, setData] = wrapSetter(
262
+ * createSignal(initialData),
263
+ * (setter) => (next) => { console.log(next); return setter(next); },
264
+ * );
265
+ * ```
266
+ * If you destructure signal or store in a longer tuple, you need to use a const assertion for the types to work.
267
+ */
268
+ declare function wrapSetter<T>(signal: Signal<T>, wrapper: (setter: Setter<T>) => Setter<T>): Signal<T>;
269
+ declare function wrapSetter<T>(store: [Store<T>, StoreSetter<T>], wrapper: (setter: StoreSetter<T>) => StoreSetter<T>): [Store<T>, StoreSetter<T>];
270
+ declare function wrapSetter<T, S extends Signal<T> | [Store<T>, StoreSetter<T>] | [...Signal<T>, ...any[]] | [Store<T>, StoreSetter<T>, ...any[]]>(signalOrStore: S, wrapper: (setter: S[1]) => S[1]): S;
271
+ declare function wrapSetter<T, S extends Signal<T> | [Store<T>, StoreSetter<T>] | readonly [...Signal<T>, ...any[]] | readonly [Store<T>, StoreSetter<T>, ...any[]]>(signalOrStore: S, wrapper: (setter: S[1]) => S[1]): S;
272
+ //#endregion
273
+ export { AccessReturnTypes, AccessorArray, AnyClass, AnyFunction, AnyObject, AnyStatic, DeepPartialAny, Directive, EQUALS_FALSE_OPTIONS, ExtractIfPossible, Falsy, FalsyValue, INTERNAL_OPTIONS, ItemsOf, ItemsOfMany, Many, MaybeAccessor, MaybeAccessorValue, Modify, ModifyDeep, Narrow, NoInfer, NonIterable, Noop, OnAccessEffectFunction, Position, PrimitiveValue, RequiredKeys, SetterParam, Simplify, Size, Tail, Truthy, UnboxLazy, UnionToIntersection, Values, access, accessArray, accessWith, afterPaint, arrayEquals, asAccessor, asArray, chain, clamp, compare, contains, createCallbackStack, createHydratableSignal, createHydrateSignal, createIdGenerator, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, isServer, json, keys, lines, ndjson, noop, number, ofClass, pipe, reverseChain, safe, trueFn, tryOnCleanup, withAccess, wrapSetter };