-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
104 lines (103 loc) · 5.17 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
declare class Enumerable<TSource> {
aggregate<TAccumulate, TResult>(
seed: TAccumulate,
accumulator: (result: TAccumulate, element: TSource, index: number) => TAccumulate,
resultSelector?: (element: TAccumulate) => TResult
): TResult;
aggregateBy<TAccumulate, TKey>(
keySelector: (element: TSource) => TKey,
seed: TAccumulate,
accumulator: (result: TAccumulate, element: TSource, index: number) => TAccumulate,
): Map<TKey, TAccumulate>;
all(predicate?: (element: TSource) => boolean): boolean;
any(predicate?: (element: TSource) => boolean): boolean;
append(...elements: TSource[]): Enumerable<TSource>;
asEnumerable(): Enumerable<TSource>;
average(selector: (element: TSource) => number): number;
cast<TResult>(selector: (element: TSource) => TResult): Enumerable<TResult>;
chunk(size: number): Enumerable<TSource>;
concat(second: Iterable<TSource>): Enumerable<TSource>;
contains(element: TSource): boolean;
count(predicate?: (element: TSource) => boolean): number;
countBy<TKey>(keySelector: (element: TSource) => TKey): Map<TKey, number>;
defaultIfEmpty(defaultValue: TSource): Enumerable<TSource>;
distinct(): Enumerable<TSource>;
distinctBy(keySelector?: (element: TSource) => string): Enumerable<TSource>;
elementAt(atIndex: number): TSource;
elementAtOrDefault(atIndex: number): TSource | undefined;
static empty<TResult>(): Enumerable<TResult>;
except(second: Iterable<TSource>): Enumerable<TSource>;
exceptBy(second: Iterable<TSource>, keySelector?: (element: TSource) => string): Enumerable<TSource>;
first(predicate?: (element: TSource) => boolean): TSource;
firstOrDefault(predicate?: (element: TSource) => boolean, defaultValue?: TSource): TSource | undefined;
static from<TResult>(iterator: Iterable<TResult>): Enumerable<TResult>;
groupBy<TElement, TResult>(
keySelector?: (element: TSource) => string,
elementSelector?: (element: TSource) => TElement,
resultSelector?: (element: TElement) => TResult
): Enumerable<TResult>;
groupJoin<TInner, TResult>(
inner: Iterable<TSource>,
outerKeySelector: (element: TSource) => string,
innerKeySelector: (element: TInner) => string,
resultSelector?: (element: TSource) => TResult
): Enumerable<TResult>;
intersect(second: Iterable<TSource>): Enumerable<TSource>;
intersectBy(second: Iterable<TSource>, keySelector?: (element: TSource) => string): Enumerable<TSource>;
join<TInner, TResult>(
inner: Iterable<TSource>,
outerKeySelector: (element: TSource) => string,
innerKeySelector: (element: TInner) => string,
resultSelector?: (element: TSource) => TResult
): Enumerable<TResult>;
last(predicate?: (element: TSource) => boolean): TSource;
lastOrDefault(predicate?: (element: TSource) => boolean, defaultValue?: TSource): TSource | undefined;
longCount(predicate?: (element: TSource) => boolean): BigInt;
max(): number;
maxBy(selector: (element: TSource) => number): number;
min(): number;
minBy(selector: (element: TSource) => number): number;
ofType(type: string): Enumerable<TSource>;
order(): Enumerable<TSource>;
orderBy(keySelector?: (element: TSource) => string): Enumerable<TSource>;
orderByDescending(keySelector?: (element: TSource) => string): Enumerable<TSource>;
prepend(...elements: TSource[]): Enumerable<TSource>;
static range(start: number, count: number): Enumerable<number>;
static repeat<TResult>(element: TResult, count: number): Enumerable<TResult>;
reverse(): Enumerable<TSource>;
select<TResult>(selector: (element: TSource) => TResult): Enumerable<TResult>;
selectMany<TCollection, TResult>(
collectionSelector: (element: TSource) => Iterable<TCollection>,
resultSelector?: (element: TSource, collection: TCollection) => TResult
): Enumerable<TResult>;
sequenceEqual(second: Iterable<TSource>): boolean;
single(predicate?: (element: TSource) => boolean): TSource;
singleOrDefault(predicate?: (element: TSource) => boolean, defaultValue?: TSource): TSource | undefined;
skip(skip: number): Enumerable<TSource>;
skipLast(count: number): Enumerable<TSource>;
skipWhile(predicate?: (element: TSource) => boolean): Enumerable<TSource>;
sum<TResult>(resultSelector?: (element: TSource) => TResult): TResult | number;
take(take: number): Enumerable<TSource>;
takeLast(count: number): Enumerable<TSource>;
takeWhile(predicate?: (element: TSource) => boolean): Enumerable<TSource>;
toArray(): Array<TSource>;
toDictionary<TResult, TKey>(
keySelector?: (element: TSource) => TKey,
elementSelector?: (element: TSource) => TResult
): Map<TKey, TResult>;
toHashSet(): Set<TSource>;
toList(): Array<TSource>;
toLookup<TResult, TKey>(
keySelector?: (element: TSource) => TKey,
elementSelector?: (element: TSource) => TResult
): Map<TKey, TResult>;
tryGetNonEnumeratedCount(): number | undefined;
union(second: Iterable<TSource>): Enumerable<TSource>;
unionBy(
second: Iterable<TSource>,
keySelector?: (element: TSource) => string
): Enumerable<TSource>;
where(predicate?: (element: TSource) => boolean): Enumerable<TSource>;
zip<TSecond, TResult>(second: Iterable<TSecond>, zipFn?: (a: TSource, b: TSecond) => TResult): Enumerable<TResult>;
}
export { Enumerable as jinq };