typetify 1.0.0 → 2.1.0

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 (47) hide show
  1. package/dist/chunk-7G4ZSMQX.js +470 -0
  2. package/dist/chunk-7G4ZSMQX.js.map +1 -0
  3. package/dist/chunk-CWHYQWNU.mjs +224 -0
  4. package/dist/chunk-CWHYQWNU.mjs.map +1 -0
  5. package/dist/{chunk-JAOGY4JO.mjs → chunk-FEX5C4OH.mjs} +2 -2
  6. package/dist/chunk-FEX5C4OH.mjs.map +1 -0
  7. package/dist/chunk-FN553YPU.js +441 -0
  8. package/dist/chunk-FN553YPU.js.map +1 -0
  9. package/dist/chunk-FT2EK4AM.mjs +420 -0
  10. package/dist/chunk-FT2EK4AM.mjs.map +1 -0
  11. package/dist/chunk-N6IUADIP.mjs +414 -0
  12. package/dist/chunk-N6IUADIP.mjs.map +1 -0
  13. package/dist/chunk-OKB3MS5F.js +547 -0
  14. package/dist/chunk-OKB3MS5F.js.map +1 -0
  15. package/dist/chunk-POD52NJ3.mjs +526 -0
  16. package/dist/chunk-POD52NJ3.mjs.map +1 -0
  17. package/dist/{chunk-SIA5BSVY.js → chunk-S535LAXW.js} +2 -2
  18. package/dist/chunk-S535LAXW.js.map +1 -0
  19. package/dist/chunk-X55EORNF.js +259 -0
  20. package/dist/chunk-X55EORNF.js.map +1 -0
  21. package/dist/index.d.mts +995 -28
  22. package/dist/index.d.ts +995 -28
  23. package/dist/index.js +869 -23
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +838 -17
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/iterator/index.js +77 -514
  28. package/dist/iterator/index.js.map +1 -1
  29. package/dist/iterator/index.mjs +1 -499
  30. package/dist/iterator/index.mjs.map +1 -1
  31. package/dist/logic/index.js +193 -408
  32. package/dist/logic/index.js.map +1 -1
  33. package/dist/logic/index.mjs +1 -364
  34. package/dist/logic/index.mjs.map +1 -1
  35. package/dist/narrowing/index.js +133 -212
  36. package/dist/narrowing/index.js.map +1 -1
  37. package/dist/narrowing/index.mjs +1 -183
  38. package/dist/narrowing/index.mjs.map +1 -1
  39. package/dist/schema/index.js +102 -402
  40. package/dist/schema/index.js.map +1 -1
  41. package/dist/schema/index.mjs +2 -381
  42. package/dist/schema/index.mjs.map +1 -1
  43. package/dist/typed/index.js +47 -47
  44. package/dist/typed/index.mjs +1 -1
  45. package/package.json +1 -1
  46. package/dist/chunk-JAOGY4JO.mjs.map +0 -1
  47. package/dist/chunk-SIA5BSVY.js.map +0 -1
package/dist/index.d.mts CHANGED
@@ -1,22 +1,830 @@
1
- import { isDefined, isNil, assert, assertDefined, fail, noop, identity, unreachable } from './core/index.mjs';
2
- import { isObject, isPlainObject, isString, isNumber, isBoolean, isFunction, isArray, isDate, isPromise, isError, isSymbol, hasKey, hasKeys, isEmpty, isNonEmpty, castArray, cloneWith, cloneDeepWith, conformsTo, eq, gt, gte, lt, lte, isArguments, isArrayBuffer, isArrayLike, isArrayLikeObject, isBuffer, isElement, isEqualWith, isFinite, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNull, isUndefined, isObjectLike, isRegExp, isSafeInteger, isSet, isTypedArray, isWeakMap, isWeakSet, toArray, toFinite, toInteger, toLength, toNumber, toPlainObject, toSafeInteger, toString } from './guards/index.mjs';
3
- import { pick, omit, keysTyped, valuesTyped, entriesTyped, fromEntriesTyped, mapObject, filterObject, mergeShallow, clone, cloneDeep, get, set, invert, deepMerge, isEqual, has, unset, paths, transform, deepGet, deepGetOr, deepSet, deepHas, deepPath, deepPluck } from './object/index.mjs';
1
+ import { isDefined, isNil, assert, fail, noop, identity, unreachable } from './core/index.mjs';
2
+ export { assertDefined } from './core/index.mjs';
3
+ import { isObject, isPlainObject, isString, isNumber, isBoolean, isFunction, isArray, isDate, isPromise, isError, isSymbol, hasKey, hasKeys, isEmpty, isNonEmpty, castArray, cloneWith, cloneDeepWith, conformsTo, eq, gt, gte, lt, lte, isArguments, isArrayBuffer, isArrayLike, isArrayLikeObject, isBuffer, isElement, isEqualWith, isFinite, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNull, isUndefined, isObjectLike, isRegExp, isSafeInteger, isSet, isTypedArray, isWeakMap, isWeakSet, toFinite, toInteger, toLength, toNumber, toPlainObject, toSafeInteger, toString } from './guards/index.mjs';
4
+ export { toArray } from './guards/index.mjs';
5
+ import { pick, omit, keysTyped, valuesTyped, entriesTyped, fromEntriesTyped, mapObject, filterObject, mergeShallow, clone, cloneDeep, set, invert, deepMerge, isEqual, has, unset, paths, transform, deepGet, deepGetOr, deepSet, deepHas, deepPath, deepPluck } from './object/index.mjs';
6
+ export { get } from './object/index.mjs';
4
7
  import { awaitTo, sleep, withTimeout, retry, debounce, throttle, once, onceAsync, defer, parallel } from './async/index.mjs';
5
8
  export { Deferred, RetryOptions } from './async/index.mjs';
6
- import { unique, groupBy, indexBy, partition, chunk, compact, flatten, sortBy, first, last, range, shuffle, sample, zip, unzip, difference, intersection, take, drop, takeWhile, dropWhile, findLast, countBy, maxBy, minBy, sumBy, head, tail, init } from './collection/index.mjs';
9
+ import { unique, groupBy, indexBy, partition, chunk as chunk$1, compact, flatten as flatten$1, sortBy, first, last, range as range$1, shuffle, sample, zip as zip$1, unzip, difference, take as take$1, drop, takeWhile, dropWhile, findLast, countBy, maxBy, minBy, sumBy, head, tail, init } from './collection/index.mjs';
10
+ export { intersection } from './collection/index.mjs';
7
11
  import { safeJsonParse, safeJsonStringify, parseNumber, parseInteger, parseBoolean, parseDate, coerceString, coerceArray, trimAll, defaults, clamp, isEmail, isUrl, isUuid, isIpAddress, parseUrl } from './input/index.mjs';
8
12
  export { JsonParseResult, JsonStringifyResult } from './input/index.mjs';
9
- import { pipe, compose, tap, when, unless, match, tryCatch, tryCatchAsync, ifElse, constant } from './flow/index.mjs';
10
- export { TryCatchAsyncResult, TryCatchResult } from './flow/index.mjs';
13
+ import { tap, match, tryCatch, tryCatchAsync, constant } from './flow/index.mjs';
14
+ export { TryCatchAsyncResult, TryCatchResult, compose, ifElse, pipe, unless, when } from './flow/index.mjs';
11
15
  import { debug, invariant, assertNever, exhaustive, todo, deprecated, measure, measureAsync, setLogLevel, getLogLevel } from './dx/index.mjs';
12
16
  export { LogLevel, MeasureResult, log } from './dx/index.mjs';
13
17
  export { A as ArrayElement, b as Awaited, B as Brand, c as DeepPartial, d as DeepReadonly, e as DeepRequired, f as Dictionary, E as ElementOf, g as EnumValue, K as KeysOfType, M as Merge, i as Mutable, j as NonNullableDeep, k as Nullable, O as Optional, l as OptionalKeys, n as PartialBy, P as Prettify, o as PromiseValue, R as ReadonlyDictionary, p as RequireAtLeastOne, q as RequireExactlyOne, r as RequireKeys, s as RequiredBy, U as UnionToIntersection, V as ValueOf, u as brand, v as createMap, w as createSet, x as defineConst, y as defineEnum, z as defineTuple, C as narrow } from './types-CPlzx7Jp.mjs';
14
18
  import { capitalize, uncapitalize, camelCase, kebabCase, snakeCase, pascalCase, truncate, slugify, template, words } from './string/index.mjs';
15
- import { memoize, negate, flip, partial, curry, ary, unary } from './fn/index.mjs';
19
+ import { negate, flip, partial, curry, ary, unary } from './fn/index.mjs';
20
+ export { memoize } from './fn/index.mjs';
16
21
  import { sum, average, median, round, randomInt, randomFloat, percentage, min, max } from './math/index.mjs';
17
22
  export { E as Err, N as None, O as Ok, a as Option, R as Result, S as Some } from './types-VsDp2t8s.mjs';
18
- import { ok, err, some, none, mapResult, mapOption, mapErr, andThen, orElse, matchResult, matchOption, isOk, isErr, unwrap, unwrapOption, unwrapOr, unwrapOptionOr, fromNullable, toNullable } from './result/index.mjs';
23
+ import { ok, err, some as some$1, none, mapResult, mapOption, mapErr, orElse, matchResult, matchOption, isOk, isErr, unwrapOption, unwrapOr, unwrapOptionOr, fromNullable, toNullable } from './result/index.mjs';
24
+ export { andThen, unwrap } from './result/index.mjs';
19
25
  import { Memoize, Debounce, Throttle, Bind, Log, Measure, Retry, Deprecated, Sealed, Frozen, Validate, Lazy } from './decorator/index.mjs';
26
+ import { when, whenValue, unless, unlessValue, ifElse, ifElseLazy, cond, condLazy, condBy, matchValue, matchWithDefault, matchLazy, matchType, and, allTrue, andThen, or, anyTrue, orThen, notFn, coalesce, coalesceLazy, defaultTo, defaultToLazy, defaultToIf, defaultToIfEmpty, firstTruthy, firstWhere, firstDefined, allTruthy, allWhere, allDefined, get, getTyped, getPath, getOr, getPathOr, getOrLazy, tryGet, tryGetOr, tryGetResult, safe, unwrap, chain, optionalOr, optionalChain } from './logic/index.mjs';
27
+ import { createIterator, lazyRange as range, lazyMap as map, lazyFilter as filter, lazyTake as take, lazySkip as skip, lazyChunk as chunk, lazyFlatten as flatten, lazyZip as zip, enumerate, cycle, repeat, fromAsync, toArray, iterReduce as reduce, iterForEach as forEach, iterFind as find, iterSome as some, iterEvery as every } from './iterator/index.mjs';
28
+ import { filterDefined, filterDefinedFn, filterTruthy, filterTruthyFn, filterByGuard, filterByRefinement, filterBy, partitionByGuard, assertType, assertDefined, assertNotNull, assertCondition, createAssertion, narrowUnion, createDiscriminantGuard, switchUnion, exhaustiveCheck, excludeNull, excludeUndefined, excludeNullish, withDefault, withDefaultLazy, mapNullable, chainNullable, refine, oneOf, allOf, not, arrayOf, objectOf } from './narrowing/index.mjs';
29
+ import { string, number, boolean, literal, array, object, optional, nullable, union as union$1, intersection, record, tuple, unknownSchema as unknown, anySchema as any, date, email, url, uuid, parse, safeParse, validate, is, parseJson, createGuard, createParser } from './schema/index.mjs';
30
+
31
+ /**
32
+ * Type-Safe Environment Variables
33
+ */
34
+ type EnvSchema = Record<string, EnvVar<unknown>>;
35
+ interface EnvVar<T> {
36
+ _type: T;
37
+ _parse: (value: string | undefined) => T;
38
+ _default?: T | undefined;
39
+ }
40
+ /**
41
+ * Environment variable type builders
42
+ */
43
+ declare const env: {
44
+ /**
45
+ * String environment variable
46
+ */
47
+ string(options?: {
48
+ default?: string;
49
+ }): EnvVar<string>;
50
+ /**
51
+ * Number environment variable
52
+ */
53
+ number(options?: {
54
+ default?: number;
55
+ }): EnvVar<number>;
56
+ /**
57
+ * Boolean environment variable
58
+ */
59
+ boolean(options?: {
60
+ default?: boolean;
61
+ }): EnvVar<boolean>;
62
+ /**
63
+ * Enum environment variable
64
+ */
65
+ enum<T extends string>(values: readonly T[], options?: {
66
+ default?: T;
67
+ }): EnvVar<T>;
68
+ /**
69
+ * URL environment variable
70
+ */
71
+ url(options?: {
72
+ default?: string;
73
+ }): EnvVar<string>;
74
+ /**
75
+ * JSON environment variable
76
+ */
77
+ json<T>(options?: {
78
+ default?: T;
79
+ }): EnvVar<T>;
80
+ /**
81
+ * Array environment variable (comma-separated)
82
+ */
83
+ array(options?: {
84
+ default?: string[];
85
+ separator?: string;
86
+ }): EnvVar<string[]>;
87
+ };
88
+ type InferEnv<T extends EnvSchema> = {
89
+ [K in keyof T]: T[K]['_type'];
90
+ };
91
+ /**
92
+ * Creates a type-safe environment configuration.
93
+ *
94
+ * @example
95
+ * const config = createEnv({
96
+ * DATABASE_URL: env.url(),
97
+ * API_KEY: env.string(),
98
+ * PORT: env.number({ default: 3000 }),
99
+ * NODE_ENV: env.enum(['development', 'production', 'test'] as const),
100
+ * DEBUG: env.boolean({ default: false }),
101
+ * ALLOWED_ORIGINS: env.array({ default: ['localhost'] }),
102
+ * })
103
+ *
104
+ * // All values are typed!
105
+ * config.DATABASE_URL // string (validated as URL)
106
+ * config.PORT // number
107
+ * config.NODE_ENV // 'development' | 'production' | 'test'
108
+ * config.DEBUG // boolean
109
+ */
110
+ declare function createEnv<T extends EnvSchema>(schema: T, envSource?: Record<string, string | undefined>): InferEnv<T>;
111
+
112
+ /**
113
+ * Type-Safe Feature Flags
114
+ */
115
+ type FlagType = 'boolean' | 'string' | 'number';
116
+ interface FlagConfig {
117
+ type: FlagType;
118
+ default: unknown;
119
+ }
120
+ type InferFlagType<T extends FlagType> = T extends 'boolean' ? boolean : T extends 'string' ? string : T extends 'number' ? number : never;
121
+ type FlagSchema = Record<string, FlagConfig>;
122
+ type InferFlags<T extends FlagSchema> = {
123
+ [K in keyof T]: InferFlagType<T[K]['type']>;
124
+ };
125
+ /**
126
+ * Flag type builders
127
+ */
128
+ declare const flag: {
129
+ boolean(defaultValue?: boolean): FlagConfig;
130
+ string(defaultValue?: string): FlagConfig;
131
+ number(defaultValue?: number): FlagConfig;
132
+ };
133
+ interface FeatureFlags<T extends FlagSchema> {
134
+ /** Check if a boolean flag is enabled */
135
+ is<K extends keyof T>(key: K): T[K]['type'] extends 'boolean' ? boolean : never;
136
+ /** Get a flag value */
137
+ get<K extends keyof T>(key: K): InferFlagType<T[K]['type']>;
138
+ /** Set a flag value */
139
+ set<K extends keyof T>(key: K, value: InferFlagType<T[K]['type']>): void;
140
+ /** Get all flags */
141
+ all(): InferFlags<T>;
142
+ /** Reset all flags to defaults */
143
+ reset(): void;
144
+ /** Load flags from an object */
145
+ load(flags: Partial<InferFlags<T>>): void;
146
+ }
147
+ /**
148
+ * Creates a type-safe feature flag system.
149
+ *
150
+ * @example
151
+ * const flags = createFeatureFlags({
152
+ * newDashboard: flag.boolean(false),
153
+ * betaFeatures: flag.boolean(false),
154
+ * maxUploadSize: flag.number(10),
155
+ * theme: flag.string('light'),
156
+ * })
157
+ *
158
+ * // Check boolean flags
159
+ * if (flags.is('newDashboard')) {
160
+ * renderNewDashboard()
161
+ * }
162
+ *
163
+ * // Get any flag value
164
+ * const maxSize = flags.get('maxUploadSize') // number
165
+ * const theme = flags.get('theme') // string
166
+ *
167
+ * // Set flags
168
+ * flags.set('betaFeatures', true)
169
+ * flags.set('maxUploadSize', 50)
170
+ *
171
+ * // Load from config/API
172
+ * flags.load({
173
+ * newDashboard: true,
174
+ * maxUploadSize: 100,
175
+ * })
176
+ */
177
+ declare function createFeatureFlags<T extends FlagSchema>(schema: T): FeatureFlags<T>;
178
+
179
+ /**
180
+ * Reactive Signals - Fine-grained reactivity like Solid.js
181
+ *
182
+ * Signals are the foundation of reactive programming.
183
+ * They hold a value and notify subscribers when it changes.
184
+ */
185
+ type Subscriber<T> = (value: T) => void;
186
+ type Unsubscribe$1 = () => void;
187
+ interface Signal<T> {
188
+ /** Get the current value */
189
+ (): T;
190
+ /** Set a new value */
191
+ set(value: T): void;
192
+ /** Update value using a function */
193
+ update(fn: (current: T) => T): void;
194
+ /** Subscribe to changes */
195
+ subscribe(fn: Subscriber<T>): Unsubscribe$1;
196
+ /** Get value without tracking */
197
+ peek(): T;
198
+ }
199
+ interface ReadonlySignal<T> {
200
+ /** Get the current value */
201
+ (): T;
202
+ /** Subscribe to changes */
203
+ subscribe(fn: Subscriber<T>): Unsubscribe$1;
204
+ /** Get value without tracking */
205
+ peek(): T;
206
+ }
207
+ /**
208
+ * Creates a reactive signal that notifies subscribers on change.
209
+ *
210
+ * @example
211
+ * const count = signal(0)
212
+ *
213
+ * // Read value
214
+ * console.log(count()) // 0
215
+ *
216
+ * // Set value
217
+ * count.set(5)
218
+ *
219
+ * // Update with function
220
+ * count.update(n => n + 1)
221
+ *
222
+ * // Subscribe to changes
223
+ * const unsubscribe = count.subscribe(value => {
224
+ * console.log('Count changed:', value)
225
+ * })
226
+ */
227
+ declare function signal<T>(initialValue: T): Signal<T>;
228
+ /**
229
+ * Creates a computed value that automatically updates when dependencies change.
230
+ *
231
+ * @example
232
+ * const firstName = signal('John')
233
+ * const lastName = signal('Doe')
234
+ *
235
+ * const fullName = computed(() => `${firstName()} ${lastName()}`)
236
+ *
237
+ * console.log(fullName()) // "John Doe"
238
+ *
239
+ * firstName.set('Jane')
240
+ * console.log(fullName()) // "Jane Doe"
241
+ */
242
+ declare function computed<T>(fn: () => T): ReadonlySignal<T>;
243
+ /**
244
+ * Runs a function whenever its dependencies change.
245
+ *
246
+ * @example
247
+ * const count = signal(0)
248
+ *
249
+ * const stop = effect(() => {
250
+ * console.log('Count is:', count())
251
+ * })
252
+ *
253
+ * count.set(1) // Logs: "Count is: 1"
254
+ * count.set(2) // Logs: "Count is: 2"
255
+ *
256
+ * stop() // Stop the effect
257
+ */
258
+ declare function effect(fn: () => void | (() => void)): Unsubscribe$1;
259
+ declare function batch(fn: () => void): void;
260
+
261
+ /**
262
+ * Undoable State - State management with undo/redo history
263
+ *
264
+ * Perfect for editors, forms, and any UI that needs history.
265
+ */
266
+
267
+ interface UndoableState<T> {
268
+ /** Current state value */
269
+ value: Signal<T>;
270
+ /** Undo the last change */
271
+ undo(): void;
272
+ /** Redo the last undone change */
273
+ redo(): void;
274
+ /** Check if undo is available */
275
+ canUndo(): boolean;
276
+ /** Check if redo is available */
277
+ canRedo(): boolean;
278
+ /** Clear all history */
279
+ clearHistory(): void;
280
+ /** Get history length */
281
+ historyLength(): number;
282
+ /** Commit current state (creates a checkpoint) */
283
+ commit(): void;
284
+ }
285
+ interface UndoableOptions {
286
+ /** Maximum history size (default: 100) */
287
+ maxHistory?: number;
288
+ /** Debounce commits in ms (default: 0 = no debounce) */
289
+ debounce?: number;
290
+ }
291
+ /**
292
+ * Creates an undoable state with undo/redo capabilities.
293
+ *
294
+ * @example
295
+ * const state = createUndoableState({ count: 0, text: '' })
296
+ *
297
+ * state.value.set({ count: 1, text: 'hello' })
298
+ * state.commit()
299
+ *
300
+ * state.value.set({ count: 2, text: 'world' })
301
+ * state.commit()
302
+ *
303
+ * console.log(state.value().count) // 2
304
+ *
305
+ * state.undo()
306
+ * console.log(state.value().count) // 1
307
+ *
308
+ * state.redo()
309
+ * console.log(state.value().count) // 2
310
+ *
311
+ * @example
312
+ * // With auto-commit on every change
313
+ * const counter = createUndoableState(0)
314
+ *
315
+ * counter.value.set(1)
316
+ * counter.commit()
317
+ * counter.value.set(2)
318
+ * counter.commit()
319
+ *
320
+ * counter.undo() // Back to 1
321
+ * counter.undo() // Back to 0
322
+ */
323
+ declare function createUndoableState<T>(initialValue: T, options?: UndoableOptions): UndoableState<T>;
324
+ /**
325
+ * Creates an undoable state that auto-commits on every change.
326
+ *
327
+ * @example
328
+ * const state = createAutoUndoableState({ name: '', age: 0 })
329
+ *
330
+ * state.set({ name: 'John', age: 30 })
331
+ * state.set({ name: 'Jane', age: 25 })
332
+ *
333
+ * state.undo() // { name: 'John', age: 30 }
334
+ * state.undo() // { name: '', age: 0 }
335
+ */
336
+ declare function createAutoUndoableState<T>(initialValue: T, options?: UndoableOptions): {
337
+ (): T;
338
+ set(value: T): void;
339
+ update(fn: (current: T) => T): void;
340
+ undo(): void;
341
+ redo(): void;
342
+ canUndo(): boolean;
343
+ canRedo(): boolean;
344
+ };
345
+
346
+ /**
347
+ * Smart Cache - Intelligent caching with TTL and invalidation
348
+ */
349
+ interface CacheOptions<K extends unknown[], V> {
350
+ /** Time to live in milliseconds or string like '5m', '1h', '1d' */
351
+ ttl?: number | string;
352
+ /** Maximum cache size */
353
+ maxSize?: number;
354
+ /** Custom key generator */
355
+ key?: (...args: K) => string;
356
+ /** Events that invalidate the cache */
357
+ invalidateOn?: string[];
358
+ /** Called when cache is hit */
359
+ onHit?: (key: string, value: V) => void;
360
+ /** Called when cache is missed */
361
+ onMiss?: (key: string) => void;
362
+ }
363
+ /**
364
+ * Creates a smart cache wrapper around a function.
365
+ *
366
+ * @example
367
+ * const fetchUser = smartCache(
368
+ * async (userId: string) => {
369
+ * const response = await fetch(`/api/users/${userId}`)
370
+ * return response.json()
371
+ * },
372
+ * {
373
+ * ttl: '5m',
374
+ * maxSize: 100,
375
+ * key: (userId) => `user:${userId}`
376
+ * }
377
+ * )
378
+ *
379
+ * // First call - fetches from API
380
+ * const user1 = await fetchUser('123')
381
+ *
382
+ * // Second call - returns cached value
383
+ * const user2 = await fetchUser('123')
384
+ *
385
+ * // Invalidate cache
386
+ * fetchUser.invalidate('123')
387
+ *
388
+ * // Clear all cache
389
+ * fetchUser.clear()
390
+ */
391
+ declare function smartCache<K extends unknown[], V>(fn: (...args: K) => V | Promise<V>, options?: CacheOptions<K, V>): ((...args: K) => Promise<V>) & {
392
+ invalidate: (...args: K) => void;
393
+ invalidateAll: () => void;
394
+ clear: () => void;
395
+ has: (...args: K) => boolean;
396
+ size: () => number;
397
+ };
398
+ /**
399
+ * Creates a simple memoization cache (no TTL, infinite size).
400
+ *
401
+ * @example
402
+ * const expensive = memoize((n: number) => {
403
+ * console.log('Computing...')
404
+ * return n * n
405
+ * })
406
+ *
407
+ * expensive(5) // Logs "Computing...", returns 25
408
+ * expensive(5) // Returns 25 (cached)
409
+ */
410
+ declare function memoize<K extends unknown[], V>(fn: (...args: K) => V): (...args: K) => V;
411
+
412
+ /**
413
+ * Type-Safe Event Bus - Decoupled communication with full type safety
414
+ */
415
+ type EventHandler<T> = (data: T) => void;
416
+ type Unsubscribe = () => void;
417
+ interface EventBus<Events extends Record<string, unknown>> {
418
+ /** Subscribe to an event */
419
+ on<K extends keyof Events>(event: K, handler: EventHandler<Events[K]>): Unsubscribe;
420
+ /** Subscribe to an event (fires only once) */
421
+ once<K extends keyof Events>(event: K, handler: EventHandler<Events[K]>): Unsubscribe;
422
+ /** Emit an event */
423
+ emit<K extends keyof Events>(event: K, data: Events[K]): void;
424
+ /** Remove all handlers for an event */
425
+ off<K extends keyof Events>(event: K): void;
426
+ /** Remove all handlers */
427
+ clear(): void;
428
+ /** Get number of handlers for an event */
429
+ listenerCount<K extends keyof Events>(event: K): number;
430
+ }
431
+ /**
432
+ * Creates a type-safe event bus for decoupled communication.
433
+ *
434
+ * @example
435
+ * // Define your events with their payload types
436
+ * type AppEvents = {
437
+ * 'user.login': { userId: string; timestamp: number }
438
+ * 'user.logout': { userId: string }
439
+ * 'order.created': { orderId: string; amount: number }
440
+ * 'notification': string
441
+ * }
442
+ *
443
+ * const events = createEventBus<AppEvents>()
444
+ *
445
+ * // Subscribe to events (fully typed!)
446
+ * events.on('user.login', (data) => {
447
+ * console.log(`User ${data.userId} logged in at ${data.timestamp}`)
448
+ * })
449
+ *
450
+ * // Emit events (type-checked!)
451
+ * events.emit('user.login', {
452
+ * userId: '123',
453
+ * timestamp: Date.now()
454
+ * })
455
+ *
456
+ * // TypeScript error: missing 'timestamp'
457
+ * events.emit('user.login', { userId: '123' })
458
+ *
459
+ * // TypeScript error: unknown event
460
+ * events.emit('unknown.event', {})
461
+ */
462
+ declare function createEventBus<Events extends Record<string, unknown>>(): EventBus<Events>;
463
+ /**
464
+ * Creates a typed event emitter for a single component/class.
465
+ *
466
+ * @example
467
+ * class UserService {
468
+ * private events = createTypedEmitter<{
469
+ * created: User
470
+ * updated: User
471
+ * deleted: string
472
+ * }>()
473
+ *
474
+ * readonly on = this.events.on
475
+ *
476
+ * async createUser(data: CreateUserDto) {
477
+ * const user = await db.users.create(data)
478
+ * this.events.emit('created', user)
479
+ * return user
480
+ * }
481
+ * }
482
+ */
483
+ declare function createTypedEmitter<Events extends Record<string, unknown>>(): EventBus<Events>;
484
+
485
+ /**
486
+ * Pipeline - Functional composition with full type inference
487
+ */
488
+ /**
489
+ * Pipes a value through a series of functions.
490
+ * Each function receives the result of the previous one.
491
+ *
492
+ * @example
493
+ * const result = pipe(
494
+ * [1, 2, 3, 4, 5],
495
+ * arr => arr.filter(x => x % 2 === 0),
496
+ * arr => arr.map(x => x * 2),
497
+ * arr => arr.reduce((a, b) => a + b, 0)
498
+ * )
499
+ * // result: 12
500
+ *
501
+ * @example
502
+ * // With async functions
503
+ * const user = await pipeAsync(
504
+ * userId,
505
+ * id => fetchUser(id),
506
+ * user => enrichUserData(user),
507
+ * user => validateUser(user)
508
+ * )
509
+ */
510
+ declare function pipe<A>(value: A): A;
511
+ declare function pipe<A, B>(value: A, fn1: (a: A) => B): B;
512
+ declare function pipe<A, B, C>(value: A, fn1: (a: A) => B, fn2: (b: B) => C): C;
513
+ declare function pipe<A, B, C, D>(value: A, fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D): D;
514
+ declare function pipe<A, B, C, D, E>(value: A, fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D, fn4: (d: D) => E): E;
515
+ declare function pipe<A, B, C, D, E, F>(value: A, fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D, fn4: (d: D) => E, fn5: (e: E) => F): F;
516
+ declare function pipe<A, B, C, D, E, F, G>(value: A, fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D, fn4: (d: D) => E, fn5: (e: E) => F, fn6: (f: F) => G): G;
517
+ declare function pipe<A, B, C, D, E, F, G, H>(value: A, fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D, fn4: (d: D) => E, fn5: (e: E) => F, fn6: (f: F) => G, fn7: (g: G) => H): H;
518
+ declare function pipe<A, B, C, D, E, F, G, H, I>(value: A, fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D, fn4: (d: D) => E, fn5: (e: E) => F, fn6: (f: F) => G, fn7: (g: G) => H, fn8: (h: H) => I): I;
519
+ /**
520
+ * Async version of pipe that handles promises.
521
+ */
522
+ declare function pipeAsync<A>(value: A): Promise<A>;
523
+ declare function pipeAsync<A, B>(value: A, fn1: (a: A) => B | Promise<B>): Promise<B>;
524
+ declare function pipeAsync<A, B, C>(value: A, fn1: (a: A) => B | Promise<B>, fn2: (b: B) => C | Promise<C>): Promise<C>;
525
+ declare function pipeAsync<A, B, C, D>(value: A, fn1: (a: A) => B | Promise<B>, fn2: (b: B) => C | Promise<C>, fn3: (c: C) => D | Promise<D>): Promise<D>;
526
+ declare function pipeAsync<A, B, C, D, E>(value: A, fn1: (a: A) => B | Promise<B>, fn2: (b: B) => C | Promise<C>, fn3: (c: C) => D | Promise<D>, fn4: (d: D) => E | Promise<E>): Promise<E>;
527
+ declare function pipeAsync<A, B, C, D, E, F>(value: A, fn1: (a: A) => B | Promise<B>, fn2: (b: B) => C | Promise<C>, fn3: (c: C) => D | Promise<D>, fn4: (d: D) => E | Promise<E>, fn5: (e: E) => F | Promise<F>): Promise<F>;
528
+ /**
529
+ * Creates a pipeline function that can be reused.
530
+ *
531
+ * @example
532
+ * const processUser = flow(
533
+ * (user: User) => validateUser(user),
534
+ * user => enrichUser(user),
535
+ * user => formatUser(user)
536
+ * )
537
+ *
538
+ * const result = processUser(rawUser)
539
+ */
540
+ declare function flow<A, B>(fn1: (a: A) => B): (a: A) => B;
541
+ declare function flow<A, B, C>(fn1: (a: A) => B, fn2: (b: B) => C): (a: A) => C;
542
+ declare function flow<A, B, C, D>(fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D): (a: A) => D;
543
+ declare function flow<A, B, C, D, E>(fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D, fn4: (d: D) => E): (a: A) => E;
544
+ declare function flow<A, B, C, D, E, F>(fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D, fn4: (d: D) => E, fn5: (e: E) => F): (a: A) => F;
545
+
546
+ /**
547
+ * Middleware Pipeline - Express-style middleware with type safety
548
+ */
549
+ type NextFunction = () => Promise<void> | void;
550
+ type Middleware<Context> = (ctx: Context, next: NextFunction) => Promise<void> | void;
551
+ interface MiddlewarePipeline<Context> {
552
+ /** Add a middleware to the pipeline */
553
+ use(middleware: Middleware<Context>): MiddlewarePipeline<Context>;
554
+ /** Execute the pipeline with a context */
555
+ execute(ctx: Context): Promise<void>;
556
+ /** Create a handler that executes the pipeline */
557
+ handler(): (ctx: Context) => Promise<void>;
558
+ }
559
+ /**
560
+ * Creates a middleware pipeline for processing requests or data.
561
+ *
562
+ * @example
563
+ * interface RequestContext {
564
+ * user?: User
565
+ * body: unknown
566
+ * headers: Record<string, string>
567
+ * }
568
+ *
569
+ * const pipeline = createMiddleware<RequestContext>()
570
+ * .use(async (ctx, next) => {
571
+ * // Authentication
572
+ * const token = ctx.headers['authorization']
573
+ * ctx.user = await validateToken(token)
574
+ * await next()
575
+ * })
576
+ * .use(async (ctx, next) => {
577
+ * // Logging
578
+ * console.log('Request from:', ctx.user?.id)
579
+ * await next()
580
+ * console.log('Request completed')
581
+ * })
582
+ * .use(async (ctx, next) => {
583
+ * // Rate limiting
584
+ * await checkRateLimit(ctx.user?.id)
585
+ * await next()
586
+ * })
587
+ *
588
+ * // Execute the pipeline
589
+ * await pipeline.execute({
590
+ * body: { name: 'John' },
591
+ * headers: { authorization: 'Bearer ...' }
592
+ * })
593
+ */
594
+ declare function createMiddleware<Context>(): MiddlewarePipeline<Context>;
595
+ /**
596
+ * Composes multiple middlewares into a single middleware.
597
+ *
598
+ * @example
599
+ * const authMiddleware = compose(
600
+ * validateToken,
601
+ * checkPermissions,
602
+ * loadUser
603
+ * )
604
+ *
605
+ * pipeline.use(authMiddleware)
606
+ */
607
+ declare function compose<Context>(...middlewares: Middleware<Context>[]): Middleware<Context>;
608
+
609
+ /**
610
+ * Dependency Injection Container - Type-safe DI with automatic resolution
611
+ */
612
+ type Factory<T> = (container: Container) => T;
613
+ type ServiceKey = string | symbol;
614
+ interface Container {
615
+ /** Register a service factory */
616
+ register<T>(key: ServiceKey, factory: Factory<T>): Container;
617
+ /** Register a singleton service */
618
+ singleton<T>(key: ServiceKey, factory: Factory<T>): Container;
619
+ /** Register a constant value */
620
+ constant<T>(key: ServiceKey, value: T): Container;
621
+ /** Resolve a service by key */
622
+ resolve<T>(key: ServiceKey): T;
623
+ /** Check if a service is registered */
624
+ has(key: ServiceKey): boolean;
625
+ /** Create a child container */
626
+ createChild(): Container;
627
+ }
628
+ /**
629
+ * Creates a dependency injection container.
630
+ *
631
+ * @example
632
+ * // Define your services
633
+ * class Logger {
634
+ * log(msg: string) { console.log(msg) }
635
+ * }
636
+ *
637
+ * class Database {
638
+ * constructor(private logger: Logger) {}
639
+ * query(sql: string) {
640
+ * this.logger.log(`Executing: ${sql}`)
641
+ * return []
642
+ * }
643
+ * }
644
+ *
645
+ * class UserService {
646
+ * constructor(private db: Database) {}
647
+ * getUsers() {
648
+ * return this.db.query('SELECT * FROM users')
649
+ * }
650
+ * }
651
+ *
652
+ * // Create container and register services
653
+ * const container = createContainer()
654
+ * .singleton('logger', () => new Logger())
655
+ * .singleton('db', (c) => new Database(c.resolve('logger')))
656
+ * .register('userService', (c) => new UserService(c.resolve('db')))
657
+ *
658
+ * // Resolve services
659
+ * const userService = container.resolve<UserService>('userService')
660
+ * userService.getUsers()
661
+ *
662
+ * @example
663
+ * // With constants
664
+ * const container = createContainer()
665
+ * .constant('apiUrl', 'https://api.example.com')
666
+ * .constant('apiKey', process.env.API_KEY)
667
+ * .singleton('api', (c) => new ApiClient(
668
+ * c.resolve('apiUrl'),
669
+ * c.resolve('apiKey')
670
+ * ))
671
+ */
672
+ declare function createContainer(parent?: Container): Container;
673
+ /**
674
+ * Creates a typed container with predefined service types.
675
+ *
676
+ * @example
677
+ * interface Services {
678
+ * logger: Logger
679
+ * db: Database
680
+ * userService: UserService
681
+ * }
682
+ *
683
+ * const container = createTypedContainer<Services>()
684
+ * .singleton('logger', () => new Logger())
685
+ * .singleton('db', (c) => new Database(c.resolve('logger')))
686
+ *
687
+ * // Fully typed!
688
+ * const logger = container.resolve('logger') // Type: Logger
689
+ */
690
+ declare function createTypedContainer<Services extends Record<string, unknown>>(): {
691
+ register<K extends keyof Services>(key: K, factory: (container: {
692
+ resolve<K2 extends keyof Services>(key: K2): Services[K2];
693
+ }) => Services[K]): ReturnType<typeof createTypedContainer<Services>>;
694
+ singleton<K extends keyof Services>(key: K, factory: (container: {
695
+ resolve<K2 extends keyof Services>(key: K2): Services[K2];
696
+ }) => Services[K]): ReturnType<typeof createTypedContainer<Services>>;
697
+ constant<K extends keyof Services>(key: K, value: Services[K]): ReturnType<typeof createTypedContainer<Services>>;
698
+ resolve<K extends keyof Services>(key: K): Services[K];
699
+ has(key: keyof Services): boolean;
700
+ };
701
+
702
+ /**
703
+ * Type-Safe Router - Routes with typed parameters
704
+ */
705
+ type ParamType = 'string' | 'number' | 'boolean';
706
+ interface RouteParams {
707
+ [key: string]: ParamType;
708
+ }
709
+ type InferParamType<T extends ParamType> = T extends 'string' ? string : T extends 'number' ? number : T extends 'boolean' ? boolean : never;
710
+ type InferParams<T extends RouteParams> = {
711
+ [K in keyof T]: InferParamType<T[K]>;
712
+ };
713
+ interface Route<Params extends RouteParams = Record<string, never>> {
714
+ path: string;
715
+ params: Params;
716
+ build: (params: InferParams<Params>) => string;
717
+ match: (path: string) => InferParams<Params> | null;
718
+ }
719
+ /**
720
+ * Creates a type-safe route definition.
721
+ *
722
+ * @example
723
+ * const userRoute = route('/users/:id', { id: 'string' })
724
+ *
725
+ * // Build URL (type-checked!)
726
+ * userRoute.build({ id: '123' }) // '/users/123'
727
+ *
728
+ * // Match URL
729
+ * userRoute.match('/users/123') // { id: '123' }
730
+ * userRoute.match('/posts/123') // null
731
+ */
732
+ declare function route<Params extends RouteParams = Record<string, never>>(path: string, params?: Params): Route<Params>;
733
+ interface Router<Routes extends Record<string, Route<RouteParams>>> {
734
+ routes: Routes;
735
+ navigate: <K extends keyof Routes>(name: K, params: Routes[K] extends Route<infer P> ? InferParams<P> : never) => string;
736
+ match: (path: string) => {
737
+ name: keyof Routes;
738
+ params: Record<string, unknown>;
739
+ } | null;
740
+ }
741
+ /**
742
+ * Creates a type-safe router with named routes.
743
+ *
744
+ * @example
745
+ * const router = createRouter({
746
+ * home: route('/'),
747
+ * users: route('/users'),
748
+ * user: route('/users/:id', { id: 'string' }),
749
+ * post: route('/posts/:postId/comments/:commentId', {
750
+ * postId: 'number',
751
+ * commentId: 'number'
752
+ * }),
753
+ * })
754
+ *
755
+ * // Navigate (fully typed!)
756
+ * router.navigate('user', { id: '123' }) // '/users/123'
757
+ * router.navigate('post', { postId: 1, commentId: 5 }) // '/posts/1/comments/5'
758
+ *
759
+ * // TypeScript error: missing 'id'
760
+ * router.navigate('user', {})
761
+ *
762
+ * // Match current path
763
+ * const matched = router.match('/users/123')
764
+ * // { name: 'user', params: { id: '123' } }
765
+ */
766
+ declare function createRouter<Routes extends Record<string, Route<RouteParams>>>(routes: Routes): Router<Routes>;
767
+
768
+ /**
769
+ * Type-Safe Form - Form handling with validation
770
+ */
771
+
772
+ interface FieldState<T> {
773
+ value: Signal<T>;
774
+ error: Signal<string | null>;
775
+ touched: Signal<boolean>;
776
+ dirty: Signal<boolean>;
777
+ }
778
+ interface FormState<T extends Record<string, unknown>> {
779
+ fields: {
780
+ [K in keyof T]: FieldState<T[K]>;
781
+ };
782
+ values: () => T;
783
+ errors: () => Partial<Record<keyof T, string>>;
784
+ isValid: () => boolean;
785
+ isDirty: () => boolean;
786
+ isTouched: () => boolean;
787
+ reset: () => void;
788
+ validate: () => boolean;
789
+ submit: (handler: (values: T) => void | Promise<void>) => Promise<void>;
790
+ }
791
+ type Validator<T> = (value: T) => string | null;
792
+ interface FieldConfig<T> {
793
+ initial: T;
794
+ validate?: Validator<T> | undefined;
795
+ }
796
+ /**
797
+ * Creates a form field configuration.
798
+ */
799
+ declare function field<T>(initial: T, validate?: Validator<T>): FieldConfig<T>;
800
+ /**
801
+ * Creates a type-safe form with validation.
802
+ *
803
+ * @example
804
+ * const form = createForm({
805
+ * email: field('', (v) => !v.includes('@') ? 'Invalid email' : null),
806
+ * password: field('', (v) => v.length < 8 ? 'Min 8 characters' : null),
807
+ * remember: field(false),
808
+ * })
809
+ *
810
+ * // Access field values
811
+ * form.fields.email.value.set('test@example.com')
812
+ *
813
+ * // Check validation
814
+ * console.log(form.isValid()) // true/false
815
+ * console.log(form.errors()) // { email: null, password: 'Min 8 characters' }
816
+ *
817
+ * // Submit form
818
+ * await form.submit(async (values) => {
819
+ * await api.login(values)
820
+ * })
821
+ *
822
+ * // Reset form
823
+ * form.reset()
824
+ */
825
+ declare function createForm<T extends Record<string, unknown>>(config: {
826
+ [K in keyof T]: FieldConfig<T[K]>;
827
+ }): FormState<T>;
20
828
 
21
829
  /**
22
830
  * Creates a new array concatenating array with any additional arrays and/or values.
@@ -487,6 +1295,178 @@ declare function zipWith<T, R>(iteratee: (...values: T[]) => R, ...arrays: reado
487
1295
  * ```
488
1296
  */
489
1297
  declare const _: {
1298
+ createFeatureFlags: typeof createFeatureFlags;
1299
+ flag: {
1300
+ boolean(defaultValue?: boolean): FlagConfig;
1301
+ string(defaultValue?: string): FlagConfig;
1302
+ number(defaultValue?: number): FlagConfig;
1303
+ };
1304
+ createForm: typeof createForm;
1305
+ field: typeof field;
1306
+ route: typeof route;
1307
+ createRouter: typeof createRouter;
1308
+ env: {
1309
+ string(options?: {
1310
+ default?: string;
1311
+ }): EnvVar<string>;
1312
+ number(options?: {
1313
+ default?: number;
1314
+ }): EnvVar<number>;
1315
+ boolean(options?: {
1316
+ default?: boolean;
1317
+ }): EnvVar<boolean>;
1318
+ enum<T extends string>(values: readonly T[], options?: {
1319
+ default?: T;
1320
+ }): EnvVar<T>;
1321
+ url(options?: {
1322
+ default?: string;
1323
+ }): EnvVar<string>;
1324
+ json<T>(options?: {
1325
+ default?: T;
1326
+ }): EnvVar<T>;
1327
+ array(options?: {
1328
+ default?: string[];
1329
+ separator?: string;
1330
+ }): EnvVar<string[]>;
1331
+ };
1332
+ createEnv: typeof createEnv;
1333
+ createContainer: typeof createContainer;
1334
+ createTypedContainer: typeof createTypedContainer;
1335
+ pipe: typeof pipe;
1336
+ pipeAsync: typeof pipeAsync;
1337
+ flow: typeof flow;
1338
+ createMiddleware: typeof createMiddleware;
1339
+ compose: typeof compose;
1340
+ createEventBus: typeof createEventBus;
1341
+ createTypedEmitter: typeof createTypedEmitter;
1342
+ smartCache: typeof smartCache;
1343
+ memoize: typeof memoize;
1344
+ signal: typeof signal;
1345
+ computed: typeof computed;
1346
+ effect: typeof effect;
1347
+ batch: typeof batch;
1348
+ createUndoableState: typeof createUndoableState;
1349
+ createAutoUndoableState: typeof createAutoUndoableState;
1350
+ string: typeof string;
1351
+ number: typeof number;
1352
+ boolean: typeof boolean;
1353
+ literal: typeof literal;
1354
+ array: typeof array;
1355
+ object: typeof object;
1356
+ optional: typeof optional;
1357
+ nullable: typeof nullable;
1358
+ union: typeof union$1;
1359
+ intersection: typeof intersection;
1360
+ record: typeof record;
1361
+ tuple: typeof tuple;
1362
+ unknownSchema: typeof unknown;
1363
+ anySchema: typeof any;
1364
+ date: typeof date;
1365
+ email: typeof email;
1366
+ url: typeof url;
1367
+ uuid: typeof uuid;
1368
+ parse: typeof parse;
1369
+ safeParse: typeof safeParse;
1370
+ validate: typeof validate;
1371
+ is: typeof is;
1372
+ parseJson: typeof parseJson;
1373
+ createGuard: typeof createGuard;
1374
+ createParser: typeof createParser;
1375
+ filterDefined: typeof filterDefined;
1376
+ filterDefinedFn: typeof filterDefinedFn;
1377
+ filterTruthy: typeof filterTruthy;
1378
+ filterTruthyFn: typeof filterTruthyFn;
1379
+ filterByGuard: typeof filterByGuard;
1380
+ filterByRefinement: typeof filterByRefinement;
1381
+ filterBy: typeof filterBy;
1382
+ partitionByGuard: typeof partitionByGuard;
1383
+ assertType: typeof assertType;
1384
+ assertDefined: typeof assertDefined;
1385
+ assertNotNull: typeof assertNotNull;
1386
+ assertCondition: typeof assertCondition;
1387
+ createAssertion: typeof createAssertion;
1388
+ narrowUnion: typeof narrowUnion;
1389
+ createDiscriminantGuard: typeof createDiscriminantGuard;
1390
+ switchUnion: typeof switchUnion;
1391
+ exhaustiveCheck: typeof exhaustiveCheck;
1392
+ excludeNull: typeof excludeNull;
1393
+ excludeUndefined: typeof excludeUndefined;
1394
+ excludeNullish: typeof excludeNullish;
1395
+ withDefault: typeof withDefault;
1396
+ withDefaultLazy: typeof withDefaultLazy;
1397
+ mapNullable: typeof mapNullable;
1398
+ chainNullable: typeof chainNullable;
1399
+ refine: typeof refine;
1400
+ oneOf: typeof oneOf;
1401
+ allOf: typeof allOf;
1402
+ not: typeof not;
1403
+ arrayOf: typeof arrayOf;
1404
+ objectOf: typeof objectOf;
1405
+ createIterator: typeof createIterator;
1406
+ lazyRange: typeof range;
1407
+ lazyMap: typeof map;
1408
+ lazyFilter: typeof filter;
1409
+ lazyTake: typeof take;
1410
+ lazySkip: typeof skip;
1411
+ lazyChunk: typeof chunk;
1412
+ lazyFlatten: typeof flatten;
1413
+ lazyZip: typeof zip;
1414
+ enumerate: typeof enumerate;
1415
+ cycle: typeof cycle;
1416
+ repeat: typeof repeat;
1417
+ fromAsync: typeof fromAsync;
1418
+ toArray: typeof toArray;
1419
+ iterReduce: typeof reduce;
1420
+ iterForEach: typeof forEach;
1421
+ iterFind: typeof find;
1422
+ iterSome: typeof some;
1423
+ iterEvery: typeof every;
1424
+ when: typeof when;
1425
+ whenValue: typeof whenValue;
1426
+ unless: typeof unless;
1427
+ unlessValue: typeof unlessValue;
1428
+ ifElse: typeof ifElse;
1429
+ ifElseLazy: typeof ifElseLazy;
1430
+ cond: typeof cond;
1431
+ condLazy: typeof condLazy;
1432
+ condBy: typeof condBy;
1433
+ matchValue: typeof matchValue;
1434
+ matchWithDefault: typeof matchWithDefault;
1435
+ matchLazy: typeof matchLazy;
1436
+ matchType: typeof matchType;
1437
+ and: typeof and;
1438
+ allTrue: typeof allTrue;
1439
+ andThen: typeof andThen;
1440
+ or: typeof or;
1441
+ anyTrue: typeof anyTrue;
1442
+ orThen: typeof orThen;
1443
+ notFn: typeof notFn;
1444
+ coalesce: typeof coalesce;
1445
+ coalesceLazy: typeof coalesceLazy;
1446
+ defaultTo: typeof defaultTo;
1447
+ defaultToLazy: typeof defaultToLazy;
1448
+ defaultToIf: typeof defaultToIf;
1449
+ defaultToIfEmpty: typeof defaultToIfEmpty;
1450
+ firstTruthy: typeof firstTruthy;
1451
+ firstWhere: typeof firstWhere;
1452
+ firstDefined: typeof firstDefined;
1453
+ allTruthy: typeof allTruthy;
1454
+ allWhere: typeof allWhere;
1455
+ allDefined: typeof allDefined;
1456
+ get: typeof get;
1457
+ getTyped: typeof getTyped;
1458
+ getPath: typeof getPath;
1459
+ getOr: typeof getOr;
1460
+ getPathOr: typeof getPathOr;
1461
+ getOrLazy: typeof getOrLazy;
1462
+ tryGet: typeof tryGet;
1463
+ tryGetOr: typeof tryGetOr;
1464
+ tryGetResult: typeof tryGetResult;
1465
+ safe: typeof safe;
1466
+ unwrap: typeof unwrap;
1467
+ chain: typeof chain;
1468
+ optionalOr: typeof optionalOr;
1469
+ optionalChain: typeof optionalChain;
490
1470
  concat: typeof concat;
491
1471
  differenceBy: typeof differenceBy;
492
1472
  differenceWith: typeof differenceWith;
@@ -522,7 +1502,6 @@ declare const _: {
522
1502
  sortedUniqBy: typeof sortedUniqBy;
523
1503
  takeRight: typeof takeRight;
524
1504
  takeRightWhile: typeof takeRightWhile;
525
- union: typeof union;
526
1505
  unionBy: typeof unionBy;
527
1506
  unionWith: typeof unionWith;
528
1507
  uniqBy: typeof uniqBy;
@@ -549,18 +1528,16 @@ declare const _: {
549
1528
  Lazy: typeof Lazy;
550
1529
  ok: typeof ok;
551
1530
  err: typeof err;
552
- some: typeof some;
1531
+ some: typeof some$1;
553
1532
  none: typeof none;
554
1533
  mapResult: typeof mapResult;
555
1534
  mapOption: typeof mapOption;
556
1535
  mapErr: typeof mapErr;
557
- andThen: typeof andThen;
558
1536
  orElse: typeof orElse;
559
1537
  matchResult: typeof matchResult;
560
1538
  matchOption: typeof matchOption;
561
1539
  isOk: typeof isOk;
562
1540
  isErr: typeof isErr;
563
- unwrap: typeof unwrap;
564
1541
  unwrapOption: typeof unwrapOption;
565
1542
  unwrapOr: typeof unwrapOr;
566
1543
  unwrapOptionOr: typeof unwrapOptionOr;
@@ -575,7 +1552,6 @@ declare const _: {
575
1552
  percentage: typeof percentage;
576
1553
  min: typeof min;
577
1554
  max: typeof max;
578
- memoize: typeof memoize;
579
1555
  negate: typeof negate;
580
1556
  flip: typeof flip;
581
1557
  partial: typeof partial;
@@ -608,15 +1584,10 @@ declare const _: {
608
1584
  };
609
1585
  setLogLevel: typeof setLogLevel;
610
1586
  getLogLevel: typeof getLogLevel;
611
- pipe: typeof pipe;
612
- compose: typeof compose;
613
1587
  tap: typeof tap;
614
- when: typeof when;
615
- unless: typeof unless;
616
1588
  match: typeof match;
617
1589
  tryCatch: typeof tryCatch;
618
1590
  tryCatchAsync: typeof tryCatchAsync;
619
- ifElse: typeof ifElse;
620
1591
  constant: typeof constant;
621
1592
  safeJsonParse: typeof safeJsonParse;
622
1593
  safeJsonStringify: typeof safeJsonStringify;
@@ -638,20 +1609,19 @@ declare const _: {
638
1609
  groupBy: typeof groupBy;
639
1610
  indexBy: typeof indexBy;
640
1611
  partition: typeof partition;
641
- chunk: typeof chunk;
1612
+ chunk: typeof chunk$1;
642
1613
  compact: typeof compact;
643
- flatten: typeof flatten;
1614
+ flatten: typeof flatten$1;
644
1615
  sortBy: typeof sortBy;
645
1616
  first: typeof first;
646
1617
  last: typeof last;
647
- range: typeof range;
1618
+ range: typeof range$1;
648
1619
  shuffle: typeof shuffle;
649
1620
  sample: typeof sample;
650
- zip: typeof zip;
1621
+ zip: typeof zip$1;
651
1622
  unzip: typeof unzip;
652
1623
  difference: typeof difference;
653
- intersection: typeof intersection;
654
- take: typeof take;
1624
+ take: typeof take$1;
655
1625
  drop: typeof drop;
656
1626
  takeWhile: typeof takeWhile;
657
1627
  dropWhile: typeof dropWhile;
@@ -684,7 +1654,6 @@ declare const _: {
684
1654
  mergeShallow: typeof mergeShallow;
685
1655
  clone: typeof clone;
686
1656
  cloneDeep: typeof cloneDeep;
687
- get: typeof get;
688
1657
  set: typeof set;
689
1658
  invert: typeof invert;
690
1659
  deepMerge: typeof deepMerge;
@@ -747,7 +1716,6 @@ declare const _: {
747
1716
  isTypedArray: typeof isTypedArray;
748
1717
  isWeakMap: typeof isWeakMap;
749
1718
  isWeakSet: typeof isWeakSet;
750
- toArray: typeof toArray;
751
1719
  toFinite: typeof toFinite;
752
1720
  toInteger: typeof toInteger;
753
1721
  toLength: typeof toLength;
@@ -758,11 +1726,10 @@ declare const _: {
758
1726
  isDefined: typeof isDefined;
759
1727
  isNil: typeof isNil;
760
1728
  assert: typeof assert;
761
- assertDefined: typeof assertDefined;
762
1729
  fail: typeof fail;
763
1730
  noop: typeof noop;
764
1731
  identity: typeof identity;
765
1732
  unreachable: typeof unreachable;
766
1733
  };
767
1734
 
768
- export { Bind, Debounce, Deprecated, Frozen, Lazy, Log, Measure, Memoize, Retry, Sealed, Throttle, Validate, _, andThen, ary, assert, assertDefined, assertNever, average, awaitTo, camelCase, capitalize, castArray, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, coerceArray, coerceString, compact, compose, concat, conformsTo, constant, countBy, curry, debounce, debug, deepMerge, _ as default, defaults, defer, deprecated, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, entriesTyped, eq, err, exhaustive, fail, fill, filterObject, findIndex, findLast, findLastIndex, first, flatten, flattenDeep, flattenDepth, flip, fromEntriesTyped, fromNullable, fromPairs, get, getLogLevel, groupBy, gt, gte, has, hasKey, hasKeys, head, identity, ifElse, indexBy, indexOf, init, intersection, intersectionBy, intersectionWith, invariant, invert, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isDefined, isElement, isEmail, isEmpty, isEqual, isEqualWith, isErr, isError, isFinite, isFunction, isInteger, isIpAddress, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNonEmpty, isNull, isNumber, isObject, isObjectLike, isOk, isPlainObject, isPromise, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isUrl, isUuid, isWeakMap, isWeakSet, join, kebabCase, keysTyped, last, lastIndexOf, lt, lte, mapErr, mapObject, mapOption, mapResult, match, matchOption, matchResult, max, maxBy, measure, measureAsync, median, memoize, mergeShallow, min, minBy, negate, none, noop, nth, ok, omit, once, onceAsync, orElse, parallel, parseBoolean, parseDate, parseInteger, parseNumber, parseUrl, partial, partition, pascalCase, paths, percentage, pick, pipe, pull, pullAll, pullAllBy, pullAllWith, pullAt, randomFloat, randomInt, range, remove, retry, reverse, round, safeJsonParse, safeJsonStringify, sample, set, setLogLevel, shuffle, sleep, slice, slugify, snakeCase, some, sortBy, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, tap, template, throttle, toArray, toFinite, toInteger, toLength, toNullable, toNumber, toPlainObject, toSafeInteger, toString, todo, transform, trimAll, truncate, tryCatch, tryCatchAsync, unary, uncapitalize, union, unionBy, unionWith, uniqBy, uniqWith, unique, unless, unreachable, unset, unwrap, unwrapOption, unwrapOptionOr, unwrapOr, unzip, unzipWith, valuesTyped, when, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith };
1735
+ export { Bind, type CacheOptions, type Container, Debounce, Deprecated, type EventBus, type FeatureFlags, type FieldState, type FormState, Frozen, Lazy, Log, Measure, Memoize, type Middleware, type MiddlewarePipeline, type ReadonlySignal, Retry, type Route, type Router, Sealed, type Signal, Throttle, type UndoableOptions, type UndoableState, Validate, _, ary, assert, assertNever, average, awaitTo, batch, camelCase, capitalize, castArray, chunk$1 as chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, coerceArray, coerceString, compact, compose as composeMiddleware, computed, concat, conformsTo, constant, countBy, createAutoUndoableState, createContainer, createEnv, createEventBus, createFeatureFlags, createForm, createMiddleware, createRouter, createTypedContainer, createTypedEmitter, createUndoableState, curry, debounce, debug, deepMerge, _ as default, defaults, defer, deprecated, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, effect, entriesTyped, env, eq, err, exhaustive, fail, field, fill, filterObject, findIndex, findLast, findLastIndex, first, flag, flatten$1 as flatten, flattenDeep, flattenDepth, flip, flow, fromEntriesTyped, fromNullable, fromPairs, getLogLevel, groupBy, gt, gte, has, hasKey, hasKeys, head, identity, indexBy, indexOf, init, intersectionBy, intersectionWith, invariant, invert, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isDefined, isElement, isEmail, isEmpty, isEqual, isEqualWith, isErr, isError, isFinite, isFunction, isInteger, isIpAddress, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNonEmpty, isNull, isNumber, isObject, isObjectLike, isOk, isPlainObject, isPromise, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isUrl, isUuid, isWeakMap, isWeakSet, join, kebabCase, keysTyped, last, lastIndexOf, lt, lte, mapErr, mapObject, mapOption, mapResult, match, matchOption, matchResult, max, maxBy, measure, measureAsync, median, mergeShallow, min, minBy, negate, none, noop, nth, ok, omit, once, onceAsync, orElse, parallel, parseBoolean, parseDate, parseInteger, parseNumber, parseUrl, partial, partition, pascalCase, paths, percentage, pick, pipeAsync, pipe as pipeValue, pull, pullAll, pullAllBy, pullAllWith, pullAt, randomFloat, randomInt, range$1 as range, remove, retry, reverse, round, route, safeJsonParse, safeJsonStringify, sample, set, setLogLevel, shuffle, signal, sleep, slice, slugify, smartCache, memoize as smartMemoize, snakeCase, some$1 as some, sortBy, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, sum, sumBy, tail, take$1 as take, takeRight, takeRightWhile, takeWhile, tap, template, throttle, toFinite, toInteger, toLength, toNullable, toNumber, toPlainObject, toSafeInteger, toString, todo, transform, trimAll, truncate, tryCatch, tryCatchAsync, unary, uncapitalize, union, unionBy, unionWith, uniqBy, uniqWith, unique, unreachable, unset, unwrapOption, unwrapOptionOr, unwrapOr, unzip, unzipWith, valuesTyped, withTimeout, without, words, xor, xorBy, xorWith, zip$1 as zip, zipObject, zipObjectDeep, zipWith };