1 | import _ = require("../index");
|
2 | declare module "../index" {
|
3 |
|
4 | interface LoDashStatic {
|
5 | |
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | chain<TrapAny extends { __lodashAnyHack: any }>(value: TrapAny): CollectionChain<any> & FunctionChain<any> & ObjectChain<any> & PrimitiveChain<any> & StringChain;
|
12 | |
13 |
|
14 |
|
15 | chain<T extends null | undefined>(value: T): PrimitiveChain<T>;
|
16 | |
17 |
|
18 |
|
19 | chain<T extends string>(value: T): StringChain<T>;
|
20 | |
21 |
|
22 |
|
23 | chain(value: string | null | undefined): StringNullableChain;
|
24 | |
25 |
|
26 |
|
27 | chain<T extends (...args: any[]) => any>(value: T): FunctionChain<T>;
|
28 | |
29 |
|
30 |
|
31 | chain<T = any>(value: List<T> | null | undefined): CollectionChain<T>;
|
32 | |
33 |
|
34 |
|
35 | chain<T extends object>(value: T | null | undefined): ObjectChain<T>;
|
36 | |
37 |
|
38 |
|
39 | chain<T>(value: T): PrimitiveChain<T>;
|
40 | }
|
41 | interface Collection<T> {
|
42 | |
43 |
|
44 |
|
45 | chain(): CollectionChain<T>;
|
46 | }
|
47 | interface String {
|
48 | |
49 |
|
50 |
|
51 | chain<T extends string>(): StringChain<T>;
|
52 | }
|
53 | interface Object<T> {
|
54 | |
55 |
|
56 |
|
57 | chain(): ObjectChain<T>;
|
58 | }
|
59 | interface Primitive<T> {
|
60 | |
61 |
|
62 |
|
63 | chain(): PrimitiveChain<T>;
|
64 | }
|
65 | interface Function<T extends (...args: any) => any> {
|
66 | |
67 |
|
68 |
|
69 | chain(): FunctionChain<T>;
|
70 | }
|
71 | interface LoDashExplicitWrapper<TValue> {
|
72 | |
73 |
|
74 |
|
75 | chain(): this;
|
76 | }
|
77 |
|
78 | interface LoDashImplicitWrapper<TValue> {
|
79 | |
80 |
|
81 |
|
82 | commit(): this;
|
83 | }
|
84 | interface LoDashExplicitWrapper<TValue> {
|
85 | |
86 |
|
87 |
|
88 | commit(): this;
|
89 | }
|
90 |
|
91 | interface LoDashImplicitWrapper<TValue> {
|
92 | |
93 |
|
94 |
|
95 | plant(value: unknown): this;
|
96 | }
|
97 | interface LoDashExplicitWrapper<TValue> {
|
98 | |
99 |
|
100 |
|
101 | plant(value: unknown): this;
|
102 | }
|
103 |
|
104 | interface LoDashImplicitWrapper<TValue> {
|
105 | |
106 |
|
107 |
|
108 | reverse(): this;
|
109 | }
|
110 | interface LoDashExplicitWrapper<TValue> {
|
111 | |
112 |
|
113 |
|
114 | reverse(): this;
|
115 | }
|
116 |
|
117 | interface LoDashImplicitWrapper<TValue> {
|
118 | |
119 |
|
120 |
|
121 | toJSON(): TValue;
|
122 | }
|
123 | interface LoDashExplicitWrapper<TValue> {
|
124 | |
125 |
|
126 |
|
127 | toJSON(): TValue;
|
128 | }
|
129 |
|
130 | interface LoDashWrapper<TValue> {
|
131 | |
132 |
|
133 |
|
134 | toString(): string;
|
135 | }
|
136 |
|
137 | interface LoDashImplicitWrapper<TValue> {
|
138 | |
139 |
|
140 |
|
141 | value(): TValue;
|
142 | }
|
143 | interface LoDashExplicitWrapper<TValue> {
|
144 | |
145 |
|
146 |
|
147 | value(): TValue;
|
148 | }
|
149 |
|
150 | interface LoDashImplicitWrapper<TValue> {
|
151 | |
152 |
|
153 |
|
154 | valueOf(): TValue;
|
155 | }
|
156 | interface LoDashExplicitWrapper<TValue> {
|
157 | |
158 |
|
159 |
|
160 | valueOf(): TValue;
|
161 | }
|
162 |
|
163 | interface LoDashStatic {
|
164 | |
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 | tap<T>(value: T, interceptor: (value: T) => void): T;
|
174 | }
|
175 | interface LoDashImplicitWrapper<TValue> {
|
176 | /**
|
177 | * @see _.tap
|
178 | */
|
179 | tap(interceptor: (value: TValue) => void): this;
|
180 | }
|
181 | interface LoDashExplicitWrapper<TValue> {
|
182 | /**
|
183 | * @see _.tap
|
184 | */
|
185 | tap(interceptor: (value: TValue) => void): this;
|
186 | }
|
187 | // thru
|
188 | interface LoDashStatic {
|
189 | /**
|
190 | * This method is like _.tap except that it returns the result of interceptor.
|
191 | *
|
192 | * @param value The value to provide to interceptor.
|
193 | * @param interceptor The function to invoke.
|
194 | * @return Returns the result of interceptor.
|
195 | */
|
196 | thru<T, TResult>(value: T, interceptor: (value: T) => TResult): TResult;
|
197 | }
|
198 | interface LoDashImplicitWrapper<TValue> {
|
199 | /**
|
200 | * @see _.thru
|
201 | */
|
202 | thru<TResult>(interceptor: (value: TValue) => TResult): ImpChain<TResult>;
|
203 | }
|
204 | interface LoDashExplicitWrapper<TValue> {
|
205 | /**
|
206 | * @see _.thru
|
207 | */
|
208 | thru<TResult>(interceptor: (value: TValue) => TResult): ExpChain<TResult>;
|
209 | }
|
210 | }
|
211 |
|
\ | No newline at end of file |