-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathindex.lodash.d.ts
210 lines (184 loc) · 6.84 KB
/
index.lodash.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
import { LoDashStatic } from 'lodash';
export = _;
export as namespace _;
declare var _: _.LoDashJoinsStatic;
declare namespace _ {
export interface LoDashJoinsStatic extends LoDashStatic {
cartesianProduct: ICartesianProduct;
hashFullOuterJoin: IOuterJoin;
hashInnerJoin: IInnerJoin;
hashLeftAntiJoin: INonMergeLeftJoin;
hashLeftOuterJoin: IMergeLeftJoin;
hashLeftSemiJoin: INonMergeLeftJoin;
hashRightAntiJoin: INonMergeRightJoin;
hashRightOuterJoin: IMergeRightJoin;
hashRightSemiJoin: INonMergeRightJoin;
nestedLoopFullOuterJoin: IOuterJoin;
nestedLoopInnerJoin: IInnerJoin;
nestedLoopLeftAntiJoin: INonMergeLeftJoin;
nestedLoopLeftOuterJoin: IMergeLeftJoin;
nestedLoopLeftSemiJoin: INonMergeLeftJoin;
nestedLoopRightAntiJoin: INonMergeRightJoin;
nestedLoopRightOuterJoin: IMergeRightJoin;
nestedLoopRightSemiJoin: INonMergeRightJoin;
sortedMergeFullOuterJoin: IOuterJoin;
sortedMergeInnerJoin: IInnerJoin;
sortedMergeLeftAntiJoin: INonMergeLeftJoin;
sortedMergeLeftOuterJoin: IMergeLeftJoin;
sortedMergeLeftSemiJoin: INonMergeLeftJoin;
sortedMergeRightAntiJoin: INonMergeRightJoin;
sortedMergeRightOuterJoin: IMergeRightJoin;
sortedMergeRightSemiJoin: INonMergeRightJoin;
}
/**
* An accessor is a function that returns a coercive value from an item. Coercive
* items include:
* - Primitives (boolean, number, string)
* - Dates
* - Objects that implement .valueOf()
* - Arrays of the previous 3
*
* Key comparisons within the library are performed using the following trick:
*
* const equals = a <= b & a >= b;
*
* This is done because == and === are either not coercive or type converting:
* @example
* var x = ['a', 'b'];
* var y = ['a', 'c'];
* var z = ['a', 'b'];
* x == z // false
* x === z // false
* x <= z && x >= z // true (converts to String)
* x <= y && x >= y //false
*
* x = new Date();
* y = new Date(x.getTime());
* x == y // false
* x === y // false
* x <= y && x >= y // true (converts to Integer)
*/
export interface IAccessor<TObject, TValueOf extends Object> extends Function {
(a: TObject): TValueOf
}
export interface IMerger<TLeft, TRight, TMergeResult> extends Function {
(left: TLeft, right: TRight): TMergeResult;
}
export interface ICartesianProduct extends Function {
(
...arrays: any[][]
): any[][]
}
export interface SelfJoin extends Function {
<TLeft, TValueOf>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>
): TLeft[];
}
export interface IOuterJoin extends SelfJoin {
<TLeft, TRight, TValueOf>(
left: TLeft[],
accessor: IAccessor<TLeft | TRight, TValueOf>,
right: TRight[]
): (TLeft | TRight | TLeft & TRight)[];
<TLeft, TRight, TValueOf>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>,
right: TRight[],
rightAccessor: IAccessor<TRight, TValueOf>
): (TLeft | TRight | TLeft & TRight)[];
<TLeft, TRight, TValueOf, TMergeResult>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>,
right: TRight[],
rightAccessor: IAccessor<TRight, TValueOf>,
merger: IMerger<TLeft | undefined, TRight | undefined, TMergeResult>
): TMergeResult[];
}
export interface IInnerJoin extends SelfJoin {
<TLeft, TRight, TValueOf>(
left: TLeft[],
accessor: IAccessor<TLeft | TRight, TValueOf>,
right: TRight[]
): (TLeft & TRight)[];
<TLeft, TRight, TValueOf>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>,
right: TRight[],
rightAccessor: IAccessor<TRight, TValueOf>
): (TLeft & TRight)[];
<TLeft, TRight, TValueOf, TMergeResult>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>,
right: TRight[],
rightAccessor: IAccessor<TRight, TValueOf>,
merger: IMerger<TLeft, TRight, TMergeResult>
): TMergeResult[];
}
export interface IMergeLeftJoin extends SelfJoin {
<TLeft, TRight, TValueOf>(
left: TLeft[],
accessor: IAccessor<TLeft | TRight, TValueOf>,
right: TRight[]
): (TLeft | TLeft & TRight)[];
<TLeft, TRight, TValueOf>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>,
right: TRight[],
rightAccessor: IAccessor<TRight, TValueOf>
): (TLeft | TLeft & TRight)[];
<TLeft, TRight, TValueOf, TMergeResult>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>,
right: TRight[],
rightAccessor: IAccessor<TRight, TValueOf>,
merger: IMerger<TLeft, TRight | undefined, TMergeResult>
): TMergeResult[];
}
export interface IMergeRightJoin extends SelfJoin {
<TLeft, TRight, TValueOf>(
left: TLeft[],
accessor: IAccessor<TLeft | TRight, TValueOf>,
right: TRight[]
): (TRight | TLeft & TRight)[];
<TLeft, TRight, TValueOf>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>,
right: TRight[],
rightAccessor: IAccessor<TRight, TValueOf>
): (TRight | TLeft & TRight)[];
<TLeft, TRight, TValueOf, TMergeResult>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>,
right: TRight[],
rightAccessor: IAccessor<TRight, TValueOf>,
merger: IMerger<TLeft | undefined, TRight, TMergeResult>
): TMergeResult[];
}
export interface INonMergeLeftJoin extends SelfJoin {
<TLeft, TRight, TValueOf>(
left: TLeft[],
accessor: IAccessor<TLeft | TRight, TValueOf>,
right: TRight[]
): TLeft[];
<TLeft, TRight, TValueOf>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>,
right: TRight[],
rightAccessor: IAccessor<TRight, TValueOf>
): TLeft[];
}
export interface INonMergeRightJoin extends SelfJoin {
<TLeft, TRight, TValueOf>(
left: TLeft[],
accessor: IAccessor<TLeft | TRight, TValueOf>,
right: TRight[]
): TRight[];
<TLeft, TRight, TValueOf>(
left: TLeft[],
leftAccessor: IAccessor<TLeft, TValueOf>,
right: TRight[],
rightAccessor: IAccessor<TRight, TValueOf>
): TRight[];
}
}