@signaldb/sinuous 2.0.0-beta.7 → 2.0.0-beta.8

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 (45) hide show
  1. package/dist/{reactivity-adapters/sinuous/src/index.d.ts → index.d.ts} +1 -1
  2. package/package.json +1 -1
  3. package/dist/base/core/src/AsyncDataAdapter.d.ts +0 -64
  4. package/dist/base/core/src/AutoFetchDataAdapter.d.ts +0 -112
  5. package/dist/base/core/src/Collection/Cursor.d.ts +0 -113
  6. package/dist/base/core/src/Collection/Observer.d.ts +0 -64
  7. package/dist/base/core/src/Collection/index.d.ts +0 -294
  8. package/dist/base/core/src/Collection/types.d.ts +0 -28
  9. package/dist/base/core/src/DataAdapter.d.ts +0 -35
  10. package/dist/base/core/src/DefaultDataAdapter.d.ts +0 -35
  11. package/dist/base/core/src/WorkerDataAdapter.d.ts +0 -25
  12. package/dist/base/core/src/WorkerDataAdapterHost.d.ts +0 -62
  13. package/dist/base/core/src/createIndex.d.ts +0 -7
  14. package/dist/base/core/src/createIndexProvider.d.ts +0 -8
  15. package/dist/base/core/src/createReactivityAdapter.d.ts +0 -8
  16. package/dist/base/core/src/createStorageAdapter.d.ts +0 -9
  17. package/dist/base/core/src/getIndexInfo.d.ts +0 -39
  18. package/dist/base/core/src/index.d.ts +0 -22
  19. package/dist/base/core/src/types/Dependency.d.ts +0 -4
  20. package/dist/base/core/src/types/IndexProvider.d.ts +0 -26
  21. package/dist/base/core/src/types/Modifier.d.ts +0 -46
  22. package/dist/base/core/src/types/ReactivityAdapter.d.ts +0 -6
  23. package/dist/base/core/src/types/Selector.d.ts +0 -46
  24. package/dist/base/core/src/types/Signal.d.ts +0 -4
  25. package/dist/base/core/src/types/StorageAdapter.d.ts +0 -20
  26. package/dist/base/core/src/utils/EventEmitter.d.ts +0 -71
  27. package/dist/base/core/src/utils/batchOnNextTick.d.ts +0 -16
  28. package/dist/base/core/src/utils/compact.d.ts +0 -9
  29. package/dist/base/core/src/utils/createSignal.d.ts +0 -14
  30. package/dist/base/core/src/utils/deepClone.d.ts +0 -17
  31. package/dist/base/core/src/utils/get.d.ts +0 -9
  32. package/dist/base/core/src/utils/getMatchingKeys.d.ts +0 -19
  33. package/dist/base/core/src/utils/intersection.d.ts +0 -9
  34. package/dist/base/core/src/utils/isEqual.d.ts +0 -14
  35. package/dist/base/core/src/utils/isFieldExpression.d.ts +0 -11
  36. package/dist/base/core/src/utils/match.d.ts +0 -12
  37. package/dist/base/core/src/utils/modify.d.ts +0 -14
  38. package/dist/base/core/src/utils/project.d.ts +0 -15
  39. package/dist/base/core/src/utils/queryId.d.ts +0 -9
  40. package/dist/base/core/src/utils/randomId.d.ts +0 -7
  41. package/dist/base/core/src/utils/reactiveOrAsync.d.ts +0 -59
  42. package/dist/base/core/src/utils/serializeValue.d.ts +0 -12
  43. package/dist/base/core/src/utils/set.d.ts +0 -13
  44. package/dist/base/core/src/utils/sortItems.d.ts +0 -12
  45. package/dist/base/core/src/utils/uniqueBy.d.ts +0 -10
@@ -1,14 +0,0 @@
1
- /**
2
- * Compares two values for deep equality.
3
- * @param a - The first value to compare.
4
- * @param b - The second value to compare.
5
- * @returns - Returns `true` if the two values are deeply equal, otherwise `false`.
6
- * @example
7
- * isEqual({ a: 1 }, { a: 1 }); // true
8
- * isEqual([1, 2], [1, 2]); // true
9
- * isEqual(new Date(0), new Date(0)); // true
10
- * isEqual(/abc/, /abc/); // true
11
- * isEqual({ a: 1 }, { a: 2 }); // false
12
- * isEqual(null, null); // true
13
- */
14
- export default function isEqual<T, K>(a: T, b: K): boolean;
@@ -1,11 +0,0 @@
1
- import type { FieldExpression } from '../types/Selector';
2
- /**
3
- * Determines whether a given object is a valid field expression.
4
- * A field expression is an object containing query operators supported by MongoDB-style queries.
5
- * @template T - The type of the field expression.
6
- * @param expression - The object to test.
7
- * @returns A boolean indicating whether the object is a valid field expression.
8
- * - `true` if the object contains only recognized query operators.
9
- * - `false` otherwise.
10
- */
11
- export default function isFieldExpression<T>(expression: any): expression is FieldExpression<T>;
@@ -1,12 +0,0 @@
1
- import type Selector from '../types/Selector';
2
- type BaseItem = Record<string, any>;
3
- /**
4
- * Tests whether a given item matches a specified selector.
5
- * Uses the `mingo` library to evaluate the query.
6
- * @template T - The type of the item being tested.
7
- * @param item - The item to test against the selector.
8
- * @param selector - The query selector used to match the item.
9
- * @returns A boolean indicating whether the item matches the selector.
10
- */
11
- export default function match<T extends BaseItem = BaseItem>(item: T, selector: Selector<T>): boolean;
12
- export {};
@@ -1,14 +0,0 @@
1
- import type Modifier from '../types/Modifier';
2
- /**
3
- * Applies a modifier to an object and returns a new modified object.
4
- * @template T - The type of the object to be modified.
5
- * @param item - The object to be modified.
6
- * @param modifier - The modifier to apply. This can be any transformation logic.
7
- * @returns - Returns a new object with the modifications applied.
8
- * @example
9
- * const item = { a: 1, b: 2 }
10
- * const modifier = { $set: { b: 3, c: 4 } }
11
- * const result = modify(item, modifier)
12
- * // result: { a: 1, b: 3, c: 4 }
13
- */
14
- export default function modify<T extends Record<string, any>>(item: T, modifier: Modifier): T;
@@ -1,15 +0,0 @@
1
- /**
2
- * Projects the fields of an object based on a specified fields configuration.
3
- * Supports inclusion (`1`) and exclusion (`0`) of specific fields. Creates a new object
4
- * with the desired fields included or excluded, based on the configuration.
5
- * @template T - The type of the object being projected.
6
- * @param item - The original object to project fields from.
7
- * @param fields - An object defining the fields to include (`1`) or exclude (`0`).
8
- * - Keys are the field names, and values are either `1` (include) or `0` (exclude).
9
- * @returns A new object with the specified fields included or excluded.
10
- * - If all fields are set to `0`, the excluded fields are removed from the result.
11
- * - If fields are set to `1`, only the included fields are retained.
12
- */
13
- export default function project<T extends Record<string, any>>(item: T, fields: {
14
- [P in keyof T]?: 0 | 1;
15
- } & Record<string, 0 | 1>): T;
@@ -1,9 +0,0 @@
1
- import type { QueryOptions } from '../DataAdapter';
2
- import type Selector from '../types/Selector';
3
- /**
4
- * Generates a unique identifier for a query based on its selector and options.
5
- * @param selector - The selector object.
6
- * @param options - The query options object (optional).
7
- * @returns A unique identifier string for the query.
8
- */
9
- export default function queryId(selector: Selector<any>, options?: QueryOptions<any>): string;
@@ -1,7 +0,0 @@
1
- /**
2
- * creates a random id
3
- * @returns a random string of 16 characters
4
- * @example
5
- * randomId() // '1234567890abcdef'
6
- */
7
- export default function randomId(): string;
@@ -1,59 +0,0 @@
1
- export type MaybePromise<T> = T | Promise<T>;
2
- /**
3
- * Options that control execution mode (and potential future mode-specific behavior).
4
- * Keep this minimal; you can extend it later (e.g. signal, timeoutMs, debugLabel).
5
- */
6
- export type ModeOptions = {
7
- async?: boolean;
8
- };
9
- /**
10
- * A generator helper that makes TypeScript infer the “synchronous value type” for maybe-async expressions.
11
- *
12
- * Usage:
13
- * const doc = yield* unwrap(Collection.findOne(...))
14
- * const list = yield* unwrap(Collection.find(...).fetch())
15
- *
16
- * Runtime note:
17
- * This does not “unwrap” Promises by itself. It yields the value/Promise to the runner and returns the
18
- * value that the runner feeds back via `.next(...)`.
19
- * @param value The value (or Promise of a value) to yield to the runner.
20
- * @returns A generator that yields `value` and resolves to the runner-supplied unwrapped `T`.
21
- */
22
- export declare function unwrap<T>(value: MaybePromise<T>): Generator<MaybePromise<T>, T, T>;
23
- /**
24
- * Generator shape used by the factory.
25
- *
26
- * `TThis` is the type of `this` inside the generator.
27
- * `Args` are the method parameters (excluding the mode flag).
28
- * `TReturn` is the final return value of the workflow.
29
- * `TNext` is the type that is yielded/awaited and fed back via `.next(...)`.
30
- *
31
- * Note:
32
- * - For best inference at yield sites, prefer `yield* unwrap(expr)` for maybe-async expressions.
33
- */
34
- export type ReactiveOrAsyncGen<TThis, Arguments extends any[], TReturn, TNext> = (this: TThis, a: boolean, ...args: Arguments) => Generator<MaybePromise<TNext>, TReturn, TNext>;
35
- /**
36
- * The method type produced from the generator signature.
37
- * Adds overloads so that `{ async: true }` yields a `Promise<...>` return type.
38
- */
39
- export type ReactiveOrAsyncMethod<TThis, P extends any[], R, N> = {
40
- (this: TThis, ...args: P): R;
41
- (this: TThis, ...args: [...P, ModeOptions?]): MaybePromise<R>;
42
- (this: TThis, ...args: [...P, {
43
- async: true;
44
- }]): Promise<R>;
45
- } & {
46
- /** Exposes the underlying generator for composition via `yield* method.generator.call(this, a, ...)` */
47
- generator: (this: TThis, a: boolean, ...args: P) => Generator<MaybePromise<N>, R, N>;
48
- };
49
- /**
50
- * Factory that turns a generator workflow into a callable method that can run in sync (reactive) or async mode.
51
- *
52
- * Call style:
53
- * fn(a, b) -> sync/reactive return
54
- * await fn(a, b, { async: true }) -> async return
55
- * @param gen Generator workflow. Receives `(a)` which indicates async mode and should `yield`/`yield* unwrap(...)`
56
- * any values that may be Promises.
57
- * @returns A callable method with overloads plus a `.generator` property for composition.
58
- */
59
- export default function reactiveOrAsync<TThis, P extends any[], R, N>(gen: (this: TThis, a: boolean, ...args: P) => Generator<MaybePromise<N>, R, N>): ReactiveOrAsyncMethod<TThis, P, R, N>;
@@ -1,12 +0,0 @@
1
- /**
2
- * Serializes a value into a string representation.
3
- * Handles various types, including strings, numbers, booleans, dates, and objects.
4
- * Falls back to JSON stringification for unsupported types.
5
- * @param value - The value to serialize.
6
- * - Strings are returned as-is.
7
- * - Numbers and booleans are converted to their string representation.
8
- * - Dates are converted to ISO string format.
9
- * - Other values are stringified using `JSON.stringify`.
10
- * @returns A string representation of the value.
11
- */
12
- export default function serializeValue(value: any): string | null;
@@ -1,13 +0,0 @@
1
- /**
2
- * Sets a value at a specified path within an object. Creates nested structures
3
- * (arrays or objects) as needed to set the value at the correct location. Supports
4
- * deleting the key if the value is `undefined` and the `deleteIfUndefined` flag is set to `true`.
5
- * @template T - The type of the object to modify.
6
- * @template K - The type of the value to set.
7
- * @param object - The object to modify. The object is mutated directly.
8
- * @param path - The path (dot or bracket notation) where the value should be set.
9
- * @param value - The value to set at the specified path.
10
- * @param deleteIfUndefined - A boolean indicating whether to delete the key if the value is `undefined` (default: `false`).
11
- * @returns The modified object.
12
- */
13
- export default function set<T extends object, K>(object: T, path: string, value: K, deleteIfUndefined?: boolean): T;
@@ -1,12 +0,0 @@
1
- /**
2
- * Sorts an array of items based on multiple fields and their specified sort order.
3
- * Uses the `fast-sort` library for efficient sorting.
4
- * @template T - The type of the items in the array.
5
- * @param items - The array of items to be sorted.
6
- * @param sortFields - An object defining the sort order for each field.
7
- * - Keys are the field names, and values are either `1` (ascending) or `-1` (descending).
8
- * @returns A new array of items sorted based on the specified fields and their order.
9
- */
10
- export default function sortItems<T extends Record<string, any>>(items: T[], sortFields: {
11
- [P in keyof T]?: -1 | 1;
12
- } & Record<string, -1 | 1>): T[];
@@ -1,10 +0,0 @@
1
- /**
2
- * Filters an array to ensure unique values based on a specified key or transformation function.
3
- * @template T - The type of the elements in the array.
4
- * @param array - The array to filter for unique values.
5
- * @param fn - A key or transformation function to determine uniqueness.
6
- * - If a key is provided, it will use the corresponding property of each element for uniqueness.
7
- * - If a function is provided, it will use the return value of the function applied to each element for uniqueness.
8
- * @returns A new array containing only unique elements based on the specified key or transformation.
9
- */
10
- export default function uniqueBy<T>(array: T[], fn: keyof T | ((item: T) => any)): T[];