semantic-typescript 0.5.3 → 0.6.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.
- package/dist/asynchronous/collector.d.ts +231 -0
- package/dist/asynchronous/collector.js +800 -0
- package/dist/asynchronous/semantic.d.ts +257 -0
- package/dist/asynchronous/semantic.js +1853 -0
- package/dist/factory.d.ts +71 -37
- package/dist/factory.js +443 -262
- package/dist/guard.d.ts +24 -14
- package/dist/guard.js +73 -19
- package/dist/hook.d.ts +6 -6
- package/dist/hook.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/optional.d.ts +2 -2
- package/dist/symbol.d.ts +19 -10
- package/dist/symbol.js +19 -10
- package/dist/synchronous/collector.d.ts +232 -0
- package/dist/{collector.js → synchronous/collector.js} +160 -151
- package/dist/{semantic.d.ts → synchronous/semantic.d.ts} +111 -120
- package/dist/{semantic.js → synchronous/semantic.js} +299 -337
- package/dist/utility.d.ts +7 -1
- package/dist/utility.js +1 -0
- package/package.json +1 -1
- package/readme.cn.md +158 -697
- package/readme.de.md +163 -432
- package/readme.es.md +163 -433
- package/readme.fr.md +162 -444
- package/readme.jp.md +162 -442
- package/readme.kr.md +161 -430
- package/readme.md +157 -1009
- package/readme.ru.md +161 -426
- package/readme.tw.md +161 -436
- package/dist/collector.d.ts +0 -236
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -4
- package/dist/map.d.ts +0 -76
- package/dist/map.js +0 -245
- package/dist/node.d.ts +0 -182
- package/dist/node.js +0 -918
- package/dist/set.d.ts +0 -19
- package/dist/set.js +0 -65
- package/dist/tree.d.ts +0 -82
- package/dist/tree.js +0 -257
|
@@ -1,65 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Optional } from "
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
protected
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
concat(other:
|
|
10
|
-
|
|
11
|
-
distinct():
|
|
12
|
-
distinct<K>(keyExtractor:
|
|
13
|
-
|
|
14
|
-
dropWhile(predicate:
|
|
15
|
-
|
|
16
|
-
filter(predicate:
|
|
17
|
-
|
|
18
|
-
flat(mapper:
|
|
19
|
-
flat(mapper:
|
|
20
|
-
flat(mapper:
|
|
21
|
-
|
|
22
|
-
flatMap<R>(mapper:
|
|
23
|
-
flatMap<R>(mapper:
|
|
24
|
-
flatMap<R>(mapper:
|
|
25
|
-
|
|
26
|
-
limit(n:
|
|
27
|
-
|
|
28
|
-
map<R>(mapper:
|
|
29
|
-
|
|
30
|
-
peek(consumer:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
shuffle():
|
|
35
|
-
|
|
36
|
-
skip(n:
|
|
37
|
-
|
|
38
|
-
sorted():
|
|
39
|
-
sorted(comparator: Comparator<E>):
|
|
40
|
-
sub(start: bigint, end: bigint):
|
|
41
|
-
takeWhile(predicate: Predicate<E>):
|
|
42
|
-
takeWhile(predicate: BiPredicate<E, bigint>):
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
toBigintStatistics():
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
translate(offset:
|
|
52
|
-
translate(
|
|
53
|
-
translate(translator: BiFunctional<E, bigint, bigint>): Semantic<E>;
|
|
1
|
+
import { SynchronousCollector } from "./collector";
|
|
2
|
+
import type { Optional } from "../optional";
|
|
3
|
+
import type { BiConsumer, BiFunctional, BiPredicate, Comparator, Consumer, Functional, Indexed, Predicate, Supplier, SynchronousGenerator, TriFunctional, TriPredicate } from "../utility";
|
|
4
|
+
export declare class SynchronousSemantic<E> {
|
|
5
|
+
protected generator: SynchronousGenerator<E>;
|
|
6
|
+
protected readonly SynchronousSemantic: Symbol;
|
|
7
|
+
constructor(generator: SynchronousGenerator<E>);
|
|
8
|
+
concat(other: SynchronousSemantic<E>): SynchronousSemantic<E>;
|
|
9
|
+
concat(other: Iterable<E>): SynchronousSemantic<E>;
|
|
10
|
+
distinct(): SynchronousSemantic<E>;
|
|
11
|
+
distinct<K>(keyExtractor: Functional<E, K>): SynchronousSemantic<E>;
|
|
12
|
+
distinct<K>(keyExtractor: BiFunctional<E, bigint, K>): SynchronousSemantic<E>;
|
|
13
|
+
dropWhile(predicate: Predicate<E>): SynchronousSemantic<E>;
|
|
14
|
+
dropWhile(predicate: BiPredicate<E, bigint>): SynchronousSemantic<E>;
|
|
15
|
+
filter(predicate: Predicate<E>): SynchronousSemantic<E>;
|
|
16
|
+
filter(predicate: BiPredicate<E, bigint>): SynchronousSemantic<E>;
|
|
17
|
+
flat(mapper: Functional<E, Iterable<E>>): SynchronousSemantic<E>;
|
|
18
|
+
flat(mapper: BiFunctional<E, bigint, Iterable<E>>): SynchronousSemantic<E>;
|
|
19
|
+
flat(mapper: Functional<E, SynchronousSemantic<E>>): SynchronousSemantic<E>;
|
|
20
|
+
flat(mapper: BiFunctional<E, bigint, SynchronousSemantic<E>>): SynchronousSemantic<E>;
|
|
21
|
+
flatMap<R>(mapper: Functional<E, Iterable<R>>): SynchronousSemantic<R>;
|
|
22
|
+
flatMap<R>(mapper: BiFunctional<E, bigint, Iterable<R>>): SynchronousSemantic<R>;
|
|
23
|
+
flatMap<R>(mapper: Functional<E, SynchronousSemantic<R>>): SynchronousSemantic<R>;
|
|
24
|
+
flatMap<R>(mapper: BiFunctional<E, bigint, SynchronousSemantic<R>>): SynchronousSemantic<R>;
|
|
25
|
+
limit(n: number): SynchronousSemantic<E>;
|
|
26
|
+
limit(n: bigint): SynchronousSemantic<E>;
|
|
27
|
+
map<R>(mapper: Functional<E, R>): SynchronousSemantic<R>;
|
|
28
|
+
map<R>(mapper: BiFunctional<E, bigint, R>): SynchronousSemantic<R>;
|
|
29
|
+
peek(consumer: Consumer<E>): SynchronousSemantic<E>;
|
|
30
|
+
peek(consumer: BiConsumer<E, bigint>): SynchronousSemantic<E>;
|
|
31
|
+
redirect(redirector: BiFunctional<E, bigint, bigint>): SynchronousSemantic<E>;
|
|
32
|
+
reverse(): SynchronousSemantic<E>;
|
|
33
|
+
shuffle(): SynchronousSemantic<E>;
|
|
34
|
+
shuffle(mapper: BiFunctional<E, bigint, bigint>): SynchronousSemantic<E>;
|
|
35
|
+
skip(n: number): SynchronousSemantic<E>;
|
|
36
|
+
skip(n: bigint): SynchronousSemantic<E>;
|
|
37
|
+
source(): SynchronousGenerator<E>;
|
|
38
|
+
sorted(): SynchronousOrderedCollectable<E>;
|
|
39
|
+
sorted(comparator: Comparator<E>): SynchronousOrderedCollectable<E>;
|
|
40
|
+
sub(start: bigint, end: bigint): SynchronousSemantic<E>;
|
|
41
|
+
takeWhile(predicate: Predicate<E>): SynchronousSemantic<E>;
|
|
42
|
+
takeWhile(predicate: BiPredicate<E, bigint>): SynchronousSemantic<E>;
|
|
43
|
+
toSynchronousCollectable(): SynchronousCollectable<E>;
|
|
44
|
+
toSynchronousCollectable<C extends SynchronousCollectable<E>>(mapper: Functional<SynchronousGenerator<E>, C>): C;
|
|
45
|
+
toBigintStatistics(): SynchronousBigIntStatistics<E>;
|
|
46
|
+
toNumericStatistics(): SynchronousNumericStatistics<E>;
|
|
47
|
+
toOrdered(): SynchronousOrderedCollectable<E>;
|
|
48
|
+
toUnordered(): SynchronousUnorderedCollectable<E>;
|
|
49
|
+
toWindow(): SynchronousWindowCollectable<E>;
|
|
50
|
+
translate(offset: number): SynchronousSemantic<E>;
|
|
51
|
+
translate(offset: bigint): SynchronousSemantic<E>;
|
|
52
|
+
translate(translator: BiFunctional<E, bigint, bigint>): SynchronousSemantic<E>;
|
|
54
53
|
}
|
|
55
|
-
export declare abstract class
|
|
56
|
-
protected readonly
|
|
54
|
+
export declare abstract class SynchronousCollectable<E> {
|
|
55
|
+
protected readonly SynchronousCollectable: symbol;
|
|
57
56
|
constructor();
|
|
58
57
|
abstract [Symbol.iterator](): globalThis.Generator<E, void, undefined>;
|
|
59
58
|
abstract [Symbol.asyncIterator](): globalThis.AsyncGenerator<E, void, undefined>;
|
|
60
59
|
anyMatch(predicate: Predicate<E>): boolean;
|
|
61
60
|
allMatch(predicate: Predicate<E>): boolean;
|
|
62
|
-
collect<A, R>(collector:
|
|
61
|
+
collect<A, R>(collector: SynchronousCollector<E, A, R>): R;
|
|
63
62
|
collect<A, R>(identity: Supplier<A>, accumulator: BiFunctional<A, E, A>, finisher: Functional<A, R>): R;
|
|
64
63
|
collect<A, R>(identity: Supplier<A>, accumulator: TriFunctional<A, E, bigint, A>, finisher: Functional<A, R>): R;
|
|
65
64
|
collect<A, R>(identity: Supplier<A>, interruptor: Predicate<E>, accumulator: BiFunctional<A, E, A>, finisher: Functional<A, R>): R;
|
|
@@ -111,8 +110,8 @@ export declare abstract class Collectable<E> implements Iterable<E>, AsyncIterab
|
|
|
111
110
|
reduce(identity: E, accumulator: TriFunctional<E, E, bigint, E>): E;
|
|
112
111
|
reduce<R>(identity: R, accumulator: BiFunctional<R, E, R>, finisher: Functional<R, R>): R;
|
|
113
112
|
reduce<R>(identity: R, accumulator: TriFunctional<R, E, bigint, R>, finisher: Functional<R, R>): R;
|
|
114
|
-
semantic():
|
|
115
|
-
abstract source():
|
|
113
|
+
semantic(): SynchronousSemantic<E>;
|
|
114
|
+
abstract source(): SynchronousGenerator<E>;
|
|
116
115
|
toArray(): Array<E>;
|
|
117
116
|
toMap<K, E>(keyExtractor: Functional<E, K>): Map<K, E>;
|
|
118
117
|
toMap<K, V>(keyExtractor: Functional<E, K>, valueExtractor: Functional<E, V>): Map<K, V>;
|
|
@@ -122,36 +121,28 @@ export declare abstract class Collectable<E> implements Iterable<E>, AsyncIterab
|
|
|
122
121
|
write<S = string>(stream: WritableStream<S>, accumulator: BiFunctional<WritableStream<S>, E, WritableStream<S>>): Promise<WritableStream<S>>;
|
|
123
122
|
write<S = string>(stream: WritableStream<S>, accumulator: TriFunctional<WritableStream<S>, E, bigint, WritableStream<S>>): Promise<WritableStream<S>>;
|
|
124
123
|
}
|
|
125
|
-
export declare class
|
|
126
|
-
protected readonly
|
|
127
|
-
protected
|
|
128
|
-
constructor(generator:
|
|
129
|
-
|
|
124
|
+
export declare class SynchronousOrderedCollectable<E> extends SynchronousCollectable<E> {
|
|
125
|
+
protected readonly SynchronousOrderedCollectable: symbol;
|
|
126
|
+
protected buffer: Array<Indexed<E>>;
|
|
127
|
+
constructor(generator: SynchronousGenerator<E>);
|
|
128
|
+
constructor(generator: SynchronousGenerator<E>, comparator: Comparator<E>);
|
|
130
129
|
[Symbol.iterator](): globalThis.Generator<E, void, undefined>;
|
|
131
130
|
[Symbol.asyncIterator](): globalThis.AsyncGenerator<E, void, undefined>;
|
|
131
|
+
source(): SynchronousGenerator<E>;
|
|
132
|
+
isEmpty(): boolean;
|
|
132
133
|
}
|
|
133
|
-
export declare class
|
|
134
|
-
protected readonly
|
|
134
|
+
export declare class SynchronousUnorderedCollectable<E> extends SynchronousCollectable<E> {
|
|
135
|
+
protected readonly SynchronousUnorderedCollectable: symbol;
|
|
135
136
|
protected buffer: Map<bigint, E>;
|
|
136
|
-
constructor(generator:
|
|
137
|
-
source():
|
|
138
|
-
[Symbol.iterator](): globalThis.Generator<E, void, undefined>;
|
|
139
|
-
[Symbol.asyncIterator](): globalThis.AsyncGenerator<E, void, undefined>;
|
|
140
|
-
}
|
|
141
|
-
export declare class OrderedCollectable<E> extends Collectable<E> {
|
|
142
|
-
protected readonly OrderedCollectable: symbol;
|
|
143
|
-
protected buffer: Array<Indexed<E>>;
|
|
144
|
-
constructor(generator: Generator<E>);
|
|
145
|
-
constructor(generator: Generator<E>, comparator: Comparator<E>);
|
|
137
|
+
constructor(generator: SynchronousGenerator<E>);
|
|
138
|
+
source(): SynchronousGenerator<E>;
|
|
146
139
|
[Symbol.iterator](): globalThis.Generator<E, void, undefined>;
|
|
147
140
|
[Symbol.asyncIterator](): globalThis.AsyncGenerator<E, void, undefined>;
|
|
148
|
-
source(): Generator<E>;
|
|
149
|
-
isEmpty(): boolean;
|
|
150
141
|
}
|
|
151
|
-
export declare abstract class
|
|
152
|
-
protected readonly
|
|
153
|
-
constructor(generator:
|
|
154
|
-
constructor(generator:
|
|
142
|
+
export declare abstract class SynchronousStatistics<E, D extends number | bigint> extends SynchronousOrderedCollectable<E> {
|
|
143
|
+
protected readonly SynchronousStatistics: symbol;
|
|
144
|
+
constructor(generator: SynchronousGenerator<E>);
|
|
145
|
+
constructor(generator: SynchronousGenerator<E>, comparator: Comparator<E>);
|
|
155
146
|
[Symbol.iterator](): globalThis.Generator<E, void, undefined>;
|
|
156
147
|
[Symbol.asyncIterator](): globalThis.AsyncGenerator<E, void, undefined>;
|
|
157
148
|
count(): bigint;
|
|
@@ -181,41 +172,10 @@ export declare abstract class Statistics<E, D extends number | bigint> extends O
|
|
|
181
172
|
abstract kurtosis(): D;
|
|
182
173
|
abstract kurtosis(mapper: Functional<E, D>): D;
|
|
183
174
|
}
|
|
184
|
-
export declare class
|
|
185
|
-
protected readonly NumericStatistics: symbol;
|
|
186
|
-
constructor(generator: Generator<E>);
|
|
187
|
-
constructor(generator: Generator<E>, comparator: Comparator<E>);
|
|
188
|
-
[Symbol.iterator](): globalThis.Generator<E, void, undefined>;
|
|
189
|
-
[Symbol.asyncIterator](): globalThis.AsyncGenerator<E, void, undefined>;
|
|
190
|
-
average(): number;
|
|
191
|
-
average(mapper: Functional<E, number>): number;
|
|
192
|
-
range(): number;
|
|
193
|
-
range(mapper: Functional<E, number>): number;
|
|
194
|
-
variance(): number;
|
|
195
|
-
variance(mapper: Functional<E, number>): number;
|
|
196
|
-
standardDeviation(): number;
|
|
197
|
-
standardDeviation(mapper: Functional<E, number>): number;
|
|
198
|
-
mean(): number;
|
|
199
|
-
mean(mapper: Functional<E, number>): number;
|
|
200
|
-
median(): number;
|
|
201
|
-
median(mapper: Functional<E, number>): number;
|
|
202
|
-
mode(): number;
|
|
203
|
-
mode(mapper: Functional<E, number>): number;
|
|
204
|
-
summate(): number;
|
|
205
|
-
summate(mapper: Functional<E, number>): number;
|
|
206
|
-
quantile(quantile: number): number;
|
|
207
|
-
quantile(quantile: number, mapper: Functional<E, number>): number;
|
|
208
|
-
interquartileRange(): number;
|
|
209
|
-
interquartileRange(mapper: Functional<E, number>): number;
|
|
210
|
-
skewness(): number;
|
|
211
|
-
skewness(mapper: Functional<E, number>): number;
|
|
212
|
-
kurtosis(): number;
|
|
213
|
-
kurtosis(mapper: Functional<E, number>): number;
|
|
214
|
-
}
|
|
215
|
-
export declare class BigIntStatistics<E> extends Statistics<E, bigint> {
|
|
175
|
+
export declare class SynchronousBigIntStatistics<E> extends SynchronousStatistics<E, bigint> {
|
|
216
176
|
protected readonly BigIntStatistics: symbol;
|
|
217
|
-
constructor(generator:
|
|
218
|
-
constructor(generator:
|
|
177
|
+
constructor(generator: SynchronousGenerator<E>);
|
|
178
|
+
constructor(generator: SynchronousGenerator<E>, comparator: Comparator<E>);
|
|
219
179
|
[Symbol.iterator](): globalThis.Generator<E, void, undefined>;
|
|
220
180
|
[Symbol.asyncIterator](): globalThis.AsyncGenerator<E, void, undefined>;
|
|
221
181
|
average(): bigint;
|
|
@@ -243,12 +203,43 @@ export declare class BigIntStatistics<E> extends Statistics<E, bigint> {
|
|
|
243
203
|
kurtosis(): bigint;
|
|
244
204
|
kurtosis(mapper: Functional<E, bigint>): bigint;
|
|
245
205
|
}
|
|
246
|
-
export declare class
|
|
206
|
+
export declare class SynchronousNumericStatistics<E> extends SynchronousStatistics<E, number> {
|
|
207
|
+
protected readonly SynchronousNumericStatistics: symbol;
|
|
208
|
+
constructor(generator: SynchronousGenerator<E>);
|
|
209
|
+
constructor(generator: SynchronousGenerator<E>, comparator: Comparator<E>);
|
|
210
|
+
[Symbol.iterator](): globalThis.Generator<E, void, undefined>;
|
|
211
|
+
[Symbol.asyncIterator](): globalThis.AsyncGenerator<E, void, undefined>;
|
|
212
|
+
average(): number;
|
|
213
|
+
average(mapper: Functional<E, number>): number;
|
|
214
|
+
range(): number;
|
|
215
|
+
range(mapper: Functional<E, number>): number;
|
|
216
|
+
variance(): number;
|
|
217
|
+
variance(mapper: Functional<E, number>): number;
|
|
218
|
+
standardDeviation(): number;
|
|
219
|
+
standardDeviation(mapper: Functional<E, number>): number;
|
|
220
|
+
mean(): number;
|
|
221
|
+
mean(mapper: Functional<E, number>): number;
|
|
222
|
+
median(): number;
|
|
223
|
+
median(mapper: Functional<E, number>): number;
|
|
224
|
+
mode(): number;
|
|
225
|
+
mode(mapper: Functional<E, number>): number;
|
|
226
|
+
summate(): number;
|
|
227
|
+
summate(mapper: Functional<E, number>): number;
|
|
228
|
+
quantile(quantile: number): number;
|
|
229
|
+
quantile(quantile: number, mapper: Functional<E, number>): number;
|
|
230
|
+
interquartileRange(): number;
|
|
231
|
+
interquartileRange(mapper: Functional<E, number>): number;
|
|
232
|
+
skewness(): number;
|
|
233
|
+
skewness(mapper: Functional<E, number>): number;
|
|
234
|
+
kurtosis(): number;
|
|
235
|
+
kurtosis(mapper: Functional<E, number>): number;
|
|
236
|
+
}
|
|
237
|
+
export declare class SynchronousWindowCollectable<E> extends SynchronousOrderedCollectable<E> {
|
|
247
238
|
protected readonly WindowCollectable: symbol;
|
|
248
|
-
constructor(generator:
|
|
249
|
-
constructor(generator:
|
|
239
|
+
constructor(generator: SynchronousGenerator<E>);
|
|
240
|
+
constructor(generator: SynchronousGenerator<E>, comparator: Comparator<E>);
|
|
250
241
|
[Symbol.iterator](): globalThis.Generator<E, void, undefined>;
|
|
251
242
|
[Symbol.asyncIterator](): globalThis.AsyncGenerator<E, void, undefined>;
|
|
252
|
-
slide(size: bigint, step?: bigint):
|
|
253
|
-
tumble(size: bigint):
|
|
243
|
+
slide(size: bigint, step?: bigint): SynchronousSemantic<SynchronousSemantic<E>>;
|
|
244
|
+
tumble(size: bigint): SynchronousSemantic<SynchronousSemantic<E>>;
|
|
254
245
|
}
|