tyneq 1.0.0 → 1.0.1
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/README.md +67 -1
- package/dist/{TyneqCachedTerminalOperator.d.ts → TyneqCachedTerminalOperator-DTVuBGMn.d.ts} +150 -173
- package/dist/{TyneqCachedTerminalOperator.d.cts → TyneqCachedTerminalOperator-QzqAHJSE.d.cts} +150 -173
- package/dist/chunk-6QXGRDRO.cjs +681 -0
- package/dist/chunk-6QXGRDRO.cjs.map +1 -0
- package/dist/chunk-BKSTSJTW.js +3786 -0
- package/dist/chunk-BKSTSJTW.js.map +1 -0
- package/dist/chunk-D2KVCXTF.cjs +47 -0
- package/dist/chunk-D2KVCXTF.cjs.map +1 -0
- package/dist/chunk-DVHUFMNJ.js +47 -0
- package/dist/chunk-DVHUFMNJ.js.map +1 -0
- package/dist/chunk-KT2G2VJZ.js +681 -0
- package/dist/chunk-KT2G2VJZ.js.map +1 -0
- package/dist/chunk-TOFO2EMH.cjs +3786 -0
- package/dist/chunk-TOFO2EMH.cjs.map +1 -0
- package/dist/core-DR17XN89.d.cts +1390 -0
- package/dist/core-DR17XN89.d.ts +1390 -0
- package/dist/index.cjs +637 -841
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +554 -576
- package/dist/index.d.ts +554 -576
- package/dist/index.js +630 -780
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.cjs +50 -24
- package/dist/plugin/index.cjs.map +1 -0
- package/dist/plugin/index.d.cts +35 -38
- package/dist/plugin/index.d.ts +35 -38
- package/dist/plugin/index.js +50 -2
- package/dist/plugin/index.js.map +1 -0
- package/dist/utility/index.cjs +19 -9
- package/dist/utility/index.cjs.map +1 -0
- package/dist/utility/index.d.cts +312 -2
- package/dist/utility/index.d.ts +312 -2
- package/dist/utility/index.js +19 -3
- package/dist/utility/index.js.map +1 -0
- package/package.json +5 -5
- package/dist/Lazy.cjs +0 -762
- package/dist/Lazy.cjs.map +0 -1
- package/dist/Lazy.js +0 -691
- package/dist/Lazy.js.map +0 -1
- package/dist/TyneqCachedTerminalOperator.cjs +0 -4950
- package/dist/TyneqCachedTerminalOperator.cjs.map +0 -1
- package/dist/TyneqCachedTerminalOperator.d.cts.map +0 -1
- package/dist/TyneqCachedTerminalOperator.d.ts.map +0 -1
- package/dist/TyneqCachedTerminalOperator.js +0 -4741
- package/dist/TyneqCachedTerminalOperator.js.map +0 -1
- package/dist/ValidationBuilder.cjs +0 -80
- package/dist/ValidationBuilder.cjs.map +0 -1
- package/dist/ValidationBuilder.d.cts +0 -319
- package/dist/ValidationBuilder.d.cts.map +0 -1
- package/dist/ValidationBuilder.d.ts +0 -319
- package/dist/ValidationBuilder.d.ts.map +0 -1
- package/dist/ValidationBuilder.js +0 -69
- package/dist/ValidationBuilder.js.map +0 -1
- package/dist/core.d.cts +0 -1393
- package/dist/core.d.cts.map +0 -1
- package/dist/core.d.ts +0 -1393
- package/dist/core.d.ts.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/plugin/index.d.cts.map +0 -1
- package/dist/plugin/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -169,7 +169,73 @@ Two registration styles: functional (generators, factories, terminals) and class
|
|
|
169
169
|
npm install tyneq
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
## Requirements
|
|
173
|
+
|
|
174
|
+
- TypeScript 5.0 or higher
|
|
175
|
+
- `"strictNullChecks": true` in your tsconfig
|
|
176
|
+
|
|
177
|
+
No `@types` package needed.
|
|
178
|
+
|
|
179
|
+
## Stage 3 Decorators
|
|
180
|
+
|
|
181
|
+
tyneq is implemented with TC39 Stage 3 decorators - the standardized decorator proposal
|
|
182
|
+
that shipped in TypeScript 5.0 and requires no extra tsconfig flags. This is a different
|
|
183
|
+
model from the legacy `experimentalDecorators` syntax used by NestJS, Angular, and
|
|
184
|
+
InversifyJS.
|
|
185
|
+
|
|
186
|
+
**Using built-in operators requires nothing from you.** The decorator machinery lives
|
|
187
|
+
entirely inside tyneq's compiled output. Calling `.where()`, `.select()`, or any terminal
|
|
188
|
+
is just calling a plain method. No decorator support is needed on your side at all.
|
|
189
|
+
|
|
190
|
+
**Using the class-based plugin API does require Stage 3 decorators in your project.**
|
|
191
|
+
If you write custom operators using `@operator`, `@terminal`, `@orderedOperator`, or
|
|
192
|
+
`@cachedOperator`, your tsconfig must not have `experimentalDecorators: true`, because
|
|
193
|
+
TypeScript supports only one decorator model at a time. If your project already uses
|
|
194
|
+
the legacy model, the functional plugin API is fully equivalent and has no such constraint.
|
|
195
|
+
|
|
196
|
+
### How the dist handles decorators
|
|
197
|
+
|
|
198
|
+
The published `dist` is compiled by tsup (esbuild) targeting `es2017`. esbuild
|
|
199
|
+
transforms Stage 3 decorator syntax into plain helper functions (`__decorateClass`,
|
|
200
|
+
`__decorateElement`) at build time, so the output works in every Node version, bundler,
|
|
201
|
+
and consumer project - including those with no native decorator support at all.
|
|
202
|
+
|
|
203
|
+
| Aspect | Detail |
|
|
204
|
+
|---|---|
|
|
205
|
+
| Raw `@decorator` syntax in dist | No - compiled to helper functions |
|
|
206
|
+
| Node 18+ | Works |
|
|
207
|
+
| Projects with `experimentalDecorators: true` | Works (built-ins and functional plugin API) |
|
|
208
|
+
| Extra bundle overhead | Small - one shared set of helpers per entry point |
|
|
209
|
+
|
|
210
|
+
**Trade-offs to be aware of:**
|
|
211
|
+
|
|
212
|
+
- Helper-function output is slightly larger than native decorator syntax would be. The
|
|
213
|
+
helpers are small and shared across all operators within an entry point, so in practice
|
|
214
|
+
the impact is minimal.
|
|
215
|
+
- Tools that understand Stage 3 decorator syntax natively (newer runtimes, bundlers) do
|
|
216
|
+
not get any advantage from the raw syntax - they just run the helper functions instead.
|
|
217
|
+
- This is the correct approach for a published package right now. Shipping raw `@decorator`
|
|
218
|
+
syntax would silently break consumers on Node versions or bundlers that do not handle it.
|
|
219
|
+
|
|
220
|
+
**Future:** When TC39 Stage 3 decorators are universally supported in all target runtimes
|
|
221
|
+
and bundlers, the build toolchain will be updated to pass decorator syntax through natively,
|
|
222
|
+
removing the helper-function overhead. Until that point, the helper-based output is the safe
|
|
223
|
+
and correct choice.
|
|
224
|
+
|
|
225
|
+
## Compatibility
|
|
226
|
+
|
|
227
|
+
**All projects:** Built-in operators and sequences work without any decorator support. Import
|
|
228
|
+
and use normally.
|
|
229
|
+
|
|
230
|
+
**Projects with `experimentalDecorators: true`** (NestJS, Angular, InversifyJS): The built-in
|
|
231
|
+
operators and the functional plugin API (`createGeneratorOperator`, `createOperator`, and
|
|
232
|
+
related helpers) work without any changes. The class-based decorator plugin API (`@operator`,
|
|
233
|
+
`@terminal`, and related decorators) cannot be used because TypeScript supports only one
|
|
234
|
+
decorator model at a time. Use the functional API instead - it is fully equivalent and the
|
|
235
|
+
recommended path in these projects.
|
|
236
|
+
|
|
237
|
+
**Projects with TypeScript 5.0+ and no `experimentalDecorators`:** Full access to everything,
|
|
238
|
+
including the class-based plugin API decorators.
|
|
173
239
|
|
|
174
240
|
---
|
|
175
241
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as Constructor, l as Enumerable, m as EnumeratorFactory, O as OperatorSource, $ as TyneqEnumerableBase, X as TyneqOrderedSequence, T as TyneqSequence, N as Nullable, D as OrderedEnumerable, _ as tyneqQueryNode, e as QueryPlanNode, C as Comparer, E as Enumerator, a0 as BaseEnumerableSorter, V as TyneqCachedSequence, i as CachedEnumerable, h as CacheResult } from './core-DR17XN89.js';
|
|
2
2
|
|
|
3
|
-
//#region src/plugin/decorators/operator.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Class decorator that registers a `TyneqEnumerator` subclass as an operator on every sequence.
|
|
6
5
|
*
|
|
@@ -34,8 +33,7 @@ import { L as Constructor, M as tyneqQueryNode, S as TyneqEnumerableBase, T as Q
|
|
|
34
33
|
* @group Decorators
|
|
35
34
|
*/
|
|
36
35
|
declare function operator<TArgs extends unknown[] = never>(name: string, category: "streaming" | "buffer", validate?: (...args: TArgs) => void): <TClass extends new (...args: any[]) => any>(target: TClass, _context: ClassDecoratorContext) => TClass;
|
|
37
|
-
|
|
38
|
-
//#region src/plugin/decorators/orderedOperator.d.ts
|
|
36
|
+
|
|
39
37
|
/**
|
|
40
38
|
* Class decorator that registers a `TyneqOrderedEnumerator` subclass as an operator
|
|
41
39
|
* available only on ordered sequences.
|
|
@@ -70,8 +68,7 @@ declare function operator<TArgs extends unknown[] = never>(name: string, categor
|
|
|
70
68
|
* @group Decorators
|
|
71
69
|
*/
|
|
72
70
|
declare function orderedOperator<TArgs extends unknown[] = never>(name: string, category: "streaming" | "buffer", validate?: (...args: TArgs) => void): <TClass extends Constructor<any>>(target: TClass, _context: ClassDecoratorContext<TClass>) => TClass;
|
|
73
|
-
|
|
74
|
-
//#region src/plugin/decorators/cachedOperator.d.ts
|
|
71
|
+
|
|
75
72
|
/**
|
|
76
73
|
* Class decorator that registers a `TyneqCachedEnumerator` subclass as an operator
|
|
77
74
|
* available only on cached sequences.
|
|
@@ -104,8 +101,7 @@ declare function orderedOperator<TArgs extends unknown[] = never>(name: string,
|
|
|
104
101
|
* @group Decorators
|
|
105
102
|
*/
|
|
106
103
|
declare function cachedOperator<TArgs extends unknown[] = never>(name: string, category: "streaming" | "buffer", validate?: (...args: TArgs) => void): <TClass extends Constructor<any>>(target: TClass, _context: ClassDecoratorContext<TClass>) => TClass;
|
|
107
|
-
|
|
108
|
-
//#region src/plugin/decorators/terminal.d.ts
|
|
104
|
+
|
|
109
105
|
/**
|
|
110
106
|
* Class decorator that registers a class as a terminal operator.
|
|
111
107
|
*
|
|
@@ -134,10 +130,9 @@ declare function cachedOperator<TArgs extends unknown[] = never>(name: string, c
|
|
|
134
130
|
* @group Decorators
|
|
135
131
|
*/
|
|
136
132
|
declare function terminal<TArgs extends unknown[] = never>(name: string, validate?: (...args: TArgs) => void): <TClass extends new (...args: any[]) => {
|
|
137
|
-
|
|
133
|
+
process(): unknown;
|
|
138
134
|
}>(target: TClass, _context: ClassDecoratorContext) => TClass;
|
|
139
|
-
|
|
140
|
-
//#region src/plugin/decorators/orderedTerminal.d.ts
|
|
135
|
+
|
|
141
136
|
/**
|
|
142
137
|
* Class decorator that registers a `TyneqOrderedTerminalOperator` subclass as a terminal
|
|
143
138
|
* operator available only on ordered sequences.
|
|
@@ -165,10 +160,9 @@ declare function terminal<TArgs extends unknown[] = never>(name: string, validat
|
|
|
165
160
|
* @group Decorators
|
|
166
161
|
*/
|
|
167
162
|
declare function orderedTerminal<TArgs extends unknown[] = never>(name: string, validate?: (...args: TArgs) => void): <TClass extends Constructor<{
|
|
168
|
-
|
|
163
|
+
process(): unknown;
|
|
169
164
|
}>>(target: TClass, _context: ClassDecoratorContext<TClass>) => TClass;
|
|
170
|
-
|
|
171
|
-
//#region src/plugin/decorators/cachedTerminal.d.ts
|
|
165
|
+
|
|
172
166
|
/**
|
|
173
167
|
* Class decorator that registers a `TyneqCachedTerminalOperator` subclass as a terminal
|
|
174
168
|
* operator available only on cached sequences.
|
|
@@ -192,10 +186,9 @@ declare function orderedTerminal<TArgs extends unknown[] = never>(name: string,
|
|
|
192
186
|
* @group Decorators
|
|
193
187
|
*/
|
|
194
188
|
declare function cachedTerminal<TArgs extends unknown[] = never>(name: string, validate?: (...args: TArgs) => void): <TClass extends Constructor<{
|
|
195
|
-
|
|
189
|
+
process(): unknown;
|
|
196
190
|
}>>(target: TClass, _context: ClassDecoratorContext<TClass>) => TClass;
|
|
197
|
-
|
|
198
|
-
//#region src/plugin/registration/createOperator.d.ts
|
|
191
|
+
|
|
199
192
|
/**
|
|
200
193
|
* Registers a streaming or buffering operator using a factory function.
|
|
201
194
|
*
|
|
@@ -238,14 +231,13 @@ declare function cachedTerminal<TArgs extends unknown[] = never>(name: string, v
|
|
|
238
231
|
* @group Factory Functions
|
|
239
232
|
*/
|
|
240
233
|
declare function createOperator<TSource, TArgs extends unknown[], TResult>(config: {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
234
|
+
name: string;
|
|
235
|
+
category: "streaming" | "buffer";
|
|
236
|
+
factory: (source: Enumerable<TSource>, ...args: TArgs) => EnumeratorFactory<TResult>;
|
|
237
|
+
validate?: (...args: NoInfer<TArgs>) => void;
|
|
238
|
+
source?: OperatorSource;
|
|
246
239
|
}): void;
|
|
247
|
-
|
|
248
|
-
//#region src/plugin/registration/createGeneratorOperator.d.ts
|
|
240
|
+
|
|
249
241
|
/**
|
|
250
242
|
* Registers an operator using a generator function.
|
|
251
243
|
*
|
|
@@ -299,14 +291,13 @@ declare function createOperator<TSource, TArgs extends unknown[], TResult>(confi
|
|
|
299
291
|
* @group Factory Functions
|
|
300
292
|
*/
|
|
301
293
|
declare function createGeneratorOperator<TSource, TArgs extends unknown[], TResult>(config: {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
294
|
+
name: string;
|
|
295
|
+
category?: "streaming" | "buffer";
|
|
296
|
+
generator: (source: Iterable<TSource>, ...args: TArgs) => IterableIterator<TResult>;
|
|
297
|
+
validate?: (...args: NoInfer<TArgs>) => void;
|
|
298
|
+
source?: OperatorSource;
|
|
307
299
|
}): void;
|
|
308
|
-
|
|
309
|
-
//#region src/core/ordering/TyneqOrderedEnumerable.d.ts
|
|
300
|
+
|
|
310
301
|
/**
|
|
311
302
|
* Concrete implementation of {@link TyneqOrderedSequence}.
|
|
312
303
|
*
|
|
@@ -317,25 +308,24 @@ declare function createGeneratorOperator<TSource, TArgs extends unknown[], TResu
|
|
|
317
308
|
* @internal
|
|
318
309
|
*/
|
|
319
310
|
declare class TyneqOrderedEnumerable<TSource, TKey> extends TyneqEnumerableBase<TSource> implements TyneqOrderedSequence<TSource> {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
311
|
+
private readonly keySelector;
|
|
312
|
+
private readonly comparer;
|
|
313
|
+
private readonly descending;
|
|
314
|
+
readonly source: TyneqSequence<TSource>;
|
|
315
|
+
readonly parent: Nullable<OrderedEnumerable<TSource>>;
|
|
316
|
+
readonly [tyneqQueryNode]: Nullable<QueryPlanNode>;
|
|
317
|
+
constructor(source: TyneqSequence<TSource>, keySelector: (item: TSource) => TKey, comparer: Comparer<TKey>, descending: boolean, parent?: OrderedEnumerable<TSource>, node?: Nullable<QueryPlanNode>);
|
|
318
|
+
asc(): TyneqOrderedSequence<TSource>;
|
|
319
|
+
desc(): TyneqOrderedSequence<TSource>;
|
|
320
|
+
getEnumerator(): Enumerator<TSource>;
|
|
321
|
+
getSorter(next: Nullable<BaseEnumerableSorter<TSource>>): BaseEnumerableSorter<TSource>;
|
|
322
|
+
thenBy<UKey>(keySelector: (item: TSource) => UKey, comparer?: Comparer<UKey>): TyneqOrderedSequence<TSource>;
|
|
323
|
+
thenByDescending<UKey>(keySelector: (item: TSource) => UKey, comparer?: Comparer<UKey>): TyneqOrderedSequence<TSource>;
|
|
324
|
+
protected createEnumerable<TResult>(factory: EnumeratorFactory<TResult>, node: Nullable<QueryPlanNode>): TyneqSequence<TResult>;
|
|
325
|
+
protected createOrderedEnumerable<TKey>(keySelector: (x: TSource) => TKey, comparer: Comparer<TKey>, descending: boolean, node: Nullable<QueryPlanNode>): TyneqOrderedSequence<TSource>;
|
|
326
|
+
protected createCachedEnumerable(source: TyneqSequence<TSource>, node: Nullable<QueryPlanNode>): TyneqCachedSequence<TSource>;
|
|
336
327
|
}
|
|
337
|
-
|
|
338
|
-
//#region src/plugin/registration/createOrderedOperator.d.ts
|
|
328
|
+
|
|
339
329
|
/**
|
|
340
330
|
* Registers a factory function as an operator available only on ordered sequences,
|
|
341
331
|
* where the factory fully controls the return type.
|
|
@@ -376,14 +366,13 @@ declare class TyneqOrderedEnumerable<TSource, TKey> extends TyneqEnumerableBase<
|
|
|
376
366
|
* @group Factory Functions
|
|
377
367
|
*/
|
|
378
368
|
declare function createOrderedOperator<TSource, TArgs extends unknown[]>(config: {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
369
|
+
name: string;
|
|
370
|
+
category: "streaming" | "buffer";
|
|
371
|
+
factory: (source: TyneqOrderedEnumerable<TSource, unknown>, node: QueryPlanNode, ...args: TArgs) => TyneqOrderedSequence<TSource>;
|
|
372
|
+
validate?: (...args: NoInfer<TArgs>) => void;
|
|
373
|
+
source?: OperatorSource;
|
|
384
374
|
}): void;
|
|
385
|
-
|
|
386
|
-
//#region src/core/TyneqCachedEnumerable.d.ts
|
|
375
|
+
|
|
387
376
|
/**
|
|
388
377
|
* Concrete implementation of {@link TyneqCachedSequence} - caches elements incrementally.
|
|
389
378
|
*
|
|
@@ -395,21 +384,20 @@ declare function createOrderedOperator<TSource, TArgs extends unknown[]>(config:
|
|
|
395
384
|
* @internal
|
|
396
385
|
*/
|
|
397
386
|
declare class TyneqCachedEnumerable<TSource> extends TyneqEnumerableBase<TSource> implements TyneqCachedSequence<TSource>, CachedEnumerable<TSource> {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
387
|
+
private source;
|
|
388
|
+
private cache;
|
|
389
|
+
private done;
|
|
390
|
+
private sourceEnumerator;
|
|
391
|
+
readonly [tyneqQueryNode]: Nullable<QueryPlanNode>;
|
|
392
|
+
constructor(source: TyneqSequence<TSource>, node?: Nullable<QueryPlanNode>);
|
|
393
|
+
getEnumerator(): Enumerator<TSource>;
|
|
394
|
+
refresh(): TyneqCachedSequence<TSource>;
|
|
395
|
+
tryGetAtFromCache(index: number): CacheResult<TSource>;
|
|
396
|
+
protected createEnumerable<TResult>(factory: EnumeratorFactory<TResult>, node: Nullable<QueryPlanNode>): TyneqSequence<TResult>;
|
|
397
|
+
protected createOrderedEnumerable<TKey>(keySelector: (x: TSource) => TKey, comparer: Comparer<TKey>, descending: boolean, node: Nullable<QueryPlanNode>): TyneqOrderedSequence<TSource>;
|
|
398
|
+
protected createCachedEnumerable(source: TyneqSequence<TSource>, node: Nullable<QueryPlanNode>): TyneqCachedSequence<TSource>;
|
|
410
399
|
}
|
|
411
|
-
|
|
412
|
-
//#region src/plugin/registration/createCachedOperator.d.ts
|
|
400
|
+
|
|
413
401
|
/**
|
|
414
402
|
* Registers a factory function as an operator available only on cached sequences,
|
|
415
403
|
* where the factory fully controls the return type.
|
|
@@ -443,14 +431,13 @@ declare class TyneqCachedEnumerable<TSource> extends TyneqEnumerableBase<TSource
|
|
|
443
431
|
* @group Factory Functions
|
|
444
432
|
*/
|
|
445
433
|
declare function createCachedOperator<TSource, TArgs extends unknown[]>(config: {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
434
|
+
name: string;
|
|
435
|
+
category: "streaming" | "buffer";
|
|
436
|
+
factory: (source: TyneqCachedEnumerable<TSource>, node: QueryPlanNode, ...args: TArgs) => TyneqCachedSequence<TSource>;
|
|
437
|
+
validate?: (...args: NoInfer<TArgs>) => void;
|
|
438
|
+
source?: OperatorSource;
|
|
451
439
|
}): void;
|
|
452
|
-
|
|
453
|
-
//#region src/plugin/registration/createTerminalOperator.d.ts
|
|
440
|
+
|
|
454
441
|
/**
|
|
455
442
|
* Registers a terminal operator using a plain function.
|
|
456
443
|
*
|
|
@@ -478,13 +465,12 @@ declare function createCachedOperator<TSource, TArgs extends unknown[]>(config:
|
|
|
478
465
|
* @group Factory Functions
|
|
479
466
|
*/
|
|
480
467
|
declare function createTerminalOperator<TSource, TArgs extends unknown[], TResult>(config: {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
468
|
+
name: string;
|
|
469
|
+
execute: (source: Enumerable<TSource>, ...args: TArgs) => TResult;
|
|
470
|
+
validate?: (...args: NoInfer<TArgs>) => void;
|
|
471
|
+
source?: OperatorSource;
|
|
485
472
|
}): void;
|
|
486
|
-
|
|
487
|
-
//#region src/plugin/registration/createOrderedTerminalOperator.d.ts
|
|
473
|
+
|
|
488
474
|
/**
|
|
489
475
|
* Registers a terminal operator available only on ordered sequences.
|
|
490
476
|
*
|
|
@@ -512,13 +498,12 @@ declare function createTerminalOperator<TSource, TArgs extends unknown[], TResul
|
|
|
512
498
|
* @group Factory Functions
|
|
513
499
|
*/
|
|
514
500
|
declare function createOrderedTerminalOperator<TSource, TArgs extends unknown[], TResult>(config: {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
501
|
+
name: string;
|
|
502
|
+
execute: (source: OrderedEnumerable<TSource>, ...args: TArgs) => TResult;
|
|
503
|
+
validate?: (...args: NoInfer<TArgs>) => void;
|
|
504
|
+
source?: OperatorSource;
|
|
519
505
|
}): void;
|
|
520
|
-
|
|
521
|
-
//#region src/plugin/registration/createCachedTerminalOperator.d.ts
|
|
506
|
+
|
|
522
507
|
/**
|
|
523
508
|
* Registers a terminal operator available only on cached sequences.
|
|
524
509
|
*
|
|
@@ -542,13 +527,12 @@ declare function createOrderedTerminalOperator<TSource, TArgs extends unknown[],
|
|
|
542
527
|
* @group Factory Functions
|
|
543
528
|
*/
|
|
544
529
|
declare function createCachedTerminalOperator<TSource, TArgs extends unknown[], TResult>(config: {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
530
|
+
name: string;
|
|
531
|
+
execute: (source: CachedEnumerable<TSource>, ...args: TArgs) => TResult;
|
|
532
|
+
validate?: (...args: NoInfer<TArgs>) => void;
|
|
533
|
+
source?: OperatorSource;
|
|
549
534
|
}): void;
|
|
550
|
-
|
|
551
|
-
//#region src/core/enumerators/TyneqBaseEnumerator.d.ts
|
|
535
|
+
|
|
552
536
|
/**
|
|
553
537
|
* Abstract base class implementing the pull-iterator lifecycle for all Tyneq enumerators.
|
|
554
538
|
*
|
|
@@ -569,50 +553,49 @@ declare function createCachedTerminalOperator<TSource, TArgs extends unknown[],
|
|
|
569
553
|
* @group Plugin
|
|
570
554
|
*/
|
|
571
555
|
declare abstract class TyneqBaseEnumerator<TInput, TOutput = TInput> implements Enumerator<TOutput> {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
556
|
+
private _initialized;
|
|
557
|
+
private _completed;
|
|
558
|
+
constructor();
|
|
559
|
+
/** Advances the iterator, calling `initialize()` on first call. Idempotent after completion. */
|
|
560
|
+
next(): IteratorResult<TOutput>;
|
|
561
|
+
/** Terminates iteration early, disposes resources, and marks completed. Idempotent. */
|
|
562
|
+
return(value?: unknown): IteratorResult<TOutput>;
|
|
563
|
+
/** Called once before the first `handleNext()` invocation. Override to set up state. */
|
|
564
|
+
protected initialize(): void;
|
|
565
|
+
/** Wraps `value` in a non-done `IteratorResult`. */
|
|
566
|
+
protected yield(value: TOutput): IteratorResult<TOutput>;
|
|
567
|
+
/** Returns a done `IteratorResult`. */
|
|
568
|
+
protected done(): IteratorResult<TOutput>;
|
|
569
|
+
/**
|
|
570
|
+
* Marks the enumerator completed and yields `value` as the final element.
|
|
571
|
+
*
|
|
572
|
+
* @remarks
|
|
573
|
+
* Use when the last element must be emitted together with completion in one step.
|
|
574
|
+
*/
|
|
575
|
+
protected doneWithYield(value: TOutput): IteratorResult<TOutput>;
|
|
576
|
+
/**
|
|
577
|
+
* Disposes resources, marks completed, and returns a done result.
|
|
578
|
+
*
|
|
579
|
+
* @remarks
|
|
580
|
+
* Use inside `handleNext()` to terminate iteration before the source is exhausted.
|
|
581
|
+
*/
|
|
582
|
+
protected earlyComplete(reason?: unknown): IteratorResult<TOutput>;
|
|
583
|
+
/** Calls `disposeSource()` then `disposeAdditional()`. */
|
|
584
|
+
protected dispose(value?: unknown): void;
|
|
585
|
+
/** Override to dispose the upstream source enumerator. */
|
|
586
|
+
protected disposeSource(): void;
|
|
587
|
+
/**
|
|
588
|
+
* Override to release any additional resources.
|
|
589
|
+
*
|
|
590
|
+
* @remarks
|
|
591
|
+
* Called after `disposeSource()`. `value` is the return value passed to `return()`.
|
|
592
|
+
* Must be idempotent and must not throw.
|
|
593
|
+
*/
|
|
594
|
+
protected disposeAdditional(_value?: unknown): void;
|
|
595
|
+
/** Produces the next element. Return `{ done: true }` to signal exhaustion. */
|
|
596
|
+
protected abstract handleNext(): IteratorResult<TOutput>;
|
|
613
597
|
}
|
|
614
|
-
|
|
615
|
-
//#region src/core/enumerators/TyneqEnumerator.d.ts
|
|
598
|
+
|
|
616
599
|
/**
|
|
617
600
|
* Base class for all pipeline operator enumerators (streaming and buffering).
|
|
618
601
|
*
|
|
@@ -626,13 +609,12 @@ declare abstract class TyneqBaseEnumerator<TInput, TOutput = TInput> implements
|
|
|
626
609
|
* @group Plugin
|
|
627
610
|
*/
|
|
628
611
|
declare abstract class TyneqEnumerator<TInput, TOutput = TInput> extends TyneqBaseEnumerator<TInput, TOutput> {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
612
|
+
protected readonly sourceEnumerator: Enumerator<TInput>;
|
|
613
|
+
private sourceDisposed;
|
|
614
|
+
constructor(sourceEnumerator: Enumerator<TInput>);
|
|
615
|
+
protected disposeSource(): void;
|
|
633
616
|
}
|
|
634
|
-
|
|
635
|
-
//#region src/core/enumerators/TyneqOrderedEnumerator.d.ts
|
|
617
|
+
|
|
636
618
|
/**
|
|
637
619
|
* Base class for enumerators that need the full ordered sequence (not just an Enumerator<T>).
|
|
638
620
|
* Lifecycle of the source is owned by the sequence, not the enumerator.
|
|
@@ -641,12 +623,11 @@ declare abstract class TyneqEnumerator<TInput, TOutput = TInput> extends TyneqBa
|
|
|
641
623
|
* @internal
|
|
642
624
|
*/
|
|
643
625
|
declare abstract class TyneqOrderedEnumerator<TSource> extends TyneqBaseEnumerator<TSource> {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
626
|
+
protected readonly orderedSource: OrderedEnumerable<TSource>;
|
|
627
|
+
constructor(orderedSource: OrderedEnumerable<TSource>);
|
|
628
|
+
protected disposeSource(): void;
|
|
647
629
|
}
|
|
648
|
-
|
|
649
|
-
//#region src/core/enumerators/TyneqCachedEnumerator.d.ts
|
|
630
|
+
|
|
650
631
|
/**
|
|
651
632
|
* Base class for enumerators that need the full cached sequence (not just an Enumerator<T>).
|
|
652
633
|
* Lifecycle of the source is owned by the sequence, not the enumerator.
|
|
@@ -655,12 +636,11 @@ declare abstract class TyneqOrderedEnumerator<TSource> extends TyneqBaseEnumerat
|
|
|
655
636
|
* @internal
|
|
656
637
|
*/
|
|
657
638
|
declare abstract class TyneqCachedEnumerator<TSource> extends TyneqBaseEnumerator<TSource> {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
639
|
+
protected readonly cachedSource: CachedEnumerable<TSource>;
|
|
640
|
+
constructor(cachedSource: CachedEnumerable<TSource>);
|
|
641
|
+
protected disposeSource(): void;
|
|
661
642
|
}
|
|
662
|
-
|
|
663
|
-
//#region src/core/terminal/TyneqTerminalOperator.d.ts
|
|
643
|
+
|
|
664
644
|
/**
|
|
665
645
|
* Abstract base for all terminal operators.
|
|
666
646
|
*
|
|
@@ -674,13 +654,12 @@ declare abstract class TyneqCachedEnumerator<TSource> extends TyneqBaseEnumerato
|
|
|
674
654
|
* @group Plugin
|
|
675
655
|
*/
|
|
676
656
|
declare abstract class TyneqTerminalOperator<TSource, TResult = TSource> {
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
657
|
+
protected readonly source: Enumerable<TSource>;
|
|
658
|
+
constructor(source: Enumerable<TSource>);
|
|
659
|
+
/** Executes the terminal operation and returns the result. */
|
|
660
|
+
abstract process(): TResult;
|
|
681
661
|
}
|
|
682
|
-
|
|
683
|
-
//#region src/core/terminal/TyneqOrderedTerminalOperator.d.ts
|
|
662
|
+
|
|
684
663
|
/**
|
|
685
664
|
* Abstract base for terminal operators that require a fully ordered sequence.
|
|
686
665
|
*
|
|
@@ -694,13 +673,12 @@ declare abstract class TyneqTerminalOperator<TSource, TResult = TSource> {
|
|
|
694
673
|
* @group Plugin
|
|
695
674
|
*/
|
|
696
675
|
declare abstract class TyneqOrderedTerminalOperator<TSource, TResult = TSource> {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
676
|
+
protected readonly source: OrderedEnumerable<TSource>;
|
|
677
|
+
constructor(source: OrderedEnumerable<TSource>);
|
|
678
|
+
/** Executes the terminal operation and returns the result. */
|
|
679
|
+
abstract process(): TResult;
|
|
701
680
|
}
|
|
702
|
-
|
|
703
|
-
//#region src/core/terminal/TyneqCachedTerminalOperator.d.ts
|
|
681
|
+
|
|
704
682
|
/**
|
|
705
683
|
* Abstract base for terminal operators that require a fully cached sequence.
|
|
706
684
|
*
|
|
@@ -714,11 +692,10 @@ declare abstract class TyneqOrderedTerminalOperator<TSource, TResult = TSource>
|
|
|
714
692
|
* @group Plugin
|
|
715
693
|
*/
|
|
716
694
|
declare abstract class TyneqCachedTerminalOperator<TSource, TResult = TSource> {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
695
|
+
protected readonly source: CachedEnumerable<TSource>;
|
|
696
|
+
constructor(source: CachedEnumerable<TSource>);
|
|
697
|
+
/** Executes the terminal operation and returns the result. */
|
|
698
|
+
abstract process(): TResult;
|
|
721
699
|
}
|
|
722
|
-
|
|
723
|
-
export {
|
|
724
|
-
//# sourceMappingURL=TyneqCachedTerminalOperator.d.ts.map
|
|
700
|
+
|
|
701
|
+
export { TyneqBaseEnumerator as T, TyneqCachedEnumerator as a, TyneqCachedTerminalOperator as b, TyneqEnumerator as c, TyneqOrderedEnumerator as d, TyneqOrderedTerminalOperator as e, TyneqTerminalOperator as f, cachedOperator as g, cachedTerminal as h, createCachedOperator as i, createCachedTerminalOperator as j, createGeneratorOperator as k, createOperator as l, createOrderedOperator as m, createOrderedTerminalOperator as n, createTerminalOperator as o, operator as p, orderedOperator as q, orderedTerminal as r, TyneqCachedEnumerable as s, terminal as t, TyneqOrderedEnumerable as u };
|