1 |
|
2 |
|
3 | declare module 'typemoq' {
|
4 | export { MockBehavior } from "typemoq/Api/MockBehavior";
|
5 | export { MockApi as Mock } from "typemoq/Api/MockApi";
|
6 | export { IMock } from "typemoq/Api/IMock";
|
7 | export { It } from "typemoq/Api/It";
|
8 | export { Times } from "typemoq/Api/Times";
|
9 | export { ExpectedCallType } from "typemoq/Api/ExpectedCallType";
|
10 | export { GlobalMockApi as GlobalMock } from "typemoq/Api/GlobalMockApi";
|
11 | export { IGlobalMock } from "typemoq/Api/IGlobalMock";
|
12 | export { GlobalScopeApi as GlobalScope } from "typemoq/Api/GlobalScopeApi";
|
13 | export { MockException } from "typemoq/Error/MockException";
|
14 | }
|
15 |
|
16 | declare module 'typemoq/Api/MockBehavior' {
|
17 | export enum MockBehavior {
|
18 | Loose = 0,
|
19 | Strict = 1,
|
20 | }
|
21 | }
|
22 |
|
23 | declare module 'typemoq/Api/MockApi' {
|
24 | import * as common from "typemoq/Common/_all";
|
25 | import { MockBehavior } from "typemoq/Api/MockBehavior";
|
26 | import { IMock } from "typemoq/Api/IMock";
|
27 | export class MockApi {
|
28 | static ofInstance<U>(targetInstance: U, behavior?: MockBehavior, shouldOverrideTarget?: boolean): IMock<U>;
|
29 | static ofType<U>(targetConstructor?: common.CtorWithArgs<U>, behavior?: MockBehavior, shouldOverrideTarget?: boolean, ...targetConstructorArgs: any[]): IMock<U>;
|
30 | static ofType2<U>(targetConstructor: common.CtorWithArgs<U>, targetConstructorArgs: any[], behavior?: MockBehavior, shouldOverrideTarget?: boolean): IMock<U>;
|
31 | }
|
32 | }
|
33 |
|
34 | declare module 'typemoq/Api/IMock' {
|
35 | import * as common from "typemoq/Common/_all";
|
36 | import { MethodCallReturn } from "typemoq/MethodCallReturn";
|
37 | import { MockBehavior } from "typemoq/Api/MockBehavior";
|
38 | import { Times } from "typemoq/Api/Times";
|
39 | export interface IMock<T> {
|
40 | readonly object: T;
|
41 | readonly target: T;
|
42 | readonly name: string;
|
43 | readonly behavior: MockBehavior;
|
44 | callBase: boolean;
|
45 | setup<TResult>(expression: common.IFunc2<T, TResult>): MethodCallReturn<T, TResult>;
|
46 | verify<TResult>(expression: common.IFunc2<T, TResult>, times: Times): void;
|
47 | verifyAll(): void;
|
48 | reset(): void;
|
49 | }
|
50 | }
|
51 |
|
52 | declare module 'typemoq/Api/It' {
|
53 | import * as common from "typemoq/Common/_all";
|
54 | export class It {
|
55 | static isValue<T>(x: T): T;
|
56 | static isObjectWith<T>(x: {
|
57 | [P in keyof T]?: T[P];
|
58 | }): T;
|
59 | static isAnyObject<T>(x: common.Ctor<T>): T;
|
60 | static isAny(): any;
|
61 | static isAnyString(): string;
|
62 | static isAnyNumber(): number;
|
63 | static is<T>(predicate: common.IFunc2<T, boolean>): T;
|
64 | }
|
65 | }
|
66 |
|
67 | declare module 'typemoq/Api/Times' {
|
68 | import * as proxy from "typemoq/Proxy/_all";
|
69 | export class Times {
|
70 | readonly min: number;
|
71 | readonly max: number;
|
72 | failMessage(call: proxy.ICallContext): string;
|
73 | verify(callCount: number): boolean;
|
74 | static exactly(n: number): Times;
|
75 | static atLeast(n: number): Times;
|
76 | static atMost(n: number): Times;
|
77 | static never(): Times;
|
78 | static once(): Times;
|
79 | static atLeastOnce(): Times;
|
80 | static atMostOnce(): Times;
|
81 | toString(): string;
|
82 | }
|
83 | }
|
84 |
|
85 | declare module 'typemoq/Api/ExpectedCallType' {
|
86 | export enum ExpectedCallType {
|
87 | InAnyOrder = 0,
|
88 | InSequence = 1,
|
89 | }
|
90 | }
|
91 |
|
92 | declare module 'typemoq/Api/GlobalMockApi' {
|
93 | import * as common from "typemoq/Common/_all";
|
94 | import { MockBehavior } from "typemoq/Api/MockBehavior";
|
95 | import { IGlobalMock } from "typemoq/Api/IGlobalMock";
|
96 | export class GlobalMockApi {
|
97 | static ofInstance<U>(targetInstance: U, globalName?: string, container?: Object, behavior?: MockBehavior): IGlobalMock<U>;
|
98 | static ofType<U>(targetConstructor: common.Ctor<U>, container?: Object, behavior?: MockBehavior): IGlobalMock<U>;
|
99 | static ofType2<U>(globalName: string, container?: Object, behavior?: MockBehavior): IGlobalMock<U>;
|
100 | }
|
101 | }
|
102 |
|
103 | declare module 'typemoq/Api/IGlobalMock' {
|
104 | import { IMock } from "typemoq/Api/IMock";
|
105 | import { GlobalType } from "typemoq/GlobalMock";
|
106 | export interface IGlobalMock<T> extends IMock<T> {
|
107 | readonly mock: IMock<T>;
|
108 | readonly type: GlobalType;
|
109 | readonly container: Object;
|
110 | }
|
111 | }
|
112 |
|
113 | declare module 'typemoq/Api/GlobalScopeApi' {
|
114 | import * as all from "typemoq/Api/_all";
|
115 | import { IUsingResult } from "typemoq/Api/IUsing";
|
116 | export class GlobalScopeApi {
|
117 | static using(...args: all.IGlobalMock<any>[]): IUsingResult;
|
118 | }
|
119 | }
|
120 |
|
121 | declare module 'typemoq/Error/MockException' {
|
122 | import { Exception } from "typemoq/Error/Exception";
|
123 | export enum MockExceptionReason {
|
124 | NoSetup,
|
125 | MoreThanOneSetup,
|
126 | InvalidArg,
|
127 | InvalidSetup,
|
128 | InvalidMatcher,
|
129 | UnknownGlobalType,
|
130 | CallCountVerificationFailed,
|
131 | CallOrderVerificationFailed,
|
132 | InvalidDynamicProxyRuntime,
|
133 | }
|
134 | export class MockException extends Exception {
|
135 | readonly reason: MockExceptionReason;
|
136 | readonly ctx: any;
|
137 | readonly message: string;
|
138 | constructor(reason: MockExceptionReason, ctx: any, message?: string);
|
139 | toString(): string;
|
140 | }
|
141 | }
|
142 |
|
143 | declare module 'typemoq/Common/_all' {
|
144 | export * from "typemoq/Common/Ctor";
|
145 | export * from "typemoq/Common/Func";
|
146 | export * from "typemoq/Common/PropertyRetriever";
|
147 | export * from "typemoq/Common/PropDescriptor";
|
148 | export * from "typemoq/Common/Utils";
|
149 | }
|
150 |
|
151 | declare module 'typemoq/MethodCallReturn' {
|
152 | import * as all from "typemoq/_all";
|
153 | import { MockBase } from "typemoq/MockBase";
|
154 | import { MethodCall } from "typemoq/MethodCall";
|
155 | export class MethodCallReturn<T, TResult> extends MethodCall<T, TResult> implements all.ISetup<T, TResult>, all.IReturnsResult<T> {
|
156 | protected _returnValueFunc: all.IFuncN<any, TResult>;
|
157 | hasReturnValue: boolean;
|
158 | protected _callBase: boolean;
|
159 | static ofStaticMock<U, UResult>(mock: MockBase<U>, setupExpression: all.IFunc2<U, UResult>): MethodCallReturn<U, UResult>;
|
160 | static ofDynamicMock<U, UResult>(mock: MockBase<U>, setupExpression: all.IFunc2<U, UResult>): MethodCallReturn<U, UResult>;
|
161 | execute(call: all.ICallContext): void;
|
162 | callback(action: all.IActionN<any>): all.IReturnsThrows<T, TResult>;
|
163 | throws(exception: Error): all.IThrowsResult;
|
164 | returns(valueFunc: all.IFuncN<any, TResult>): all.IReturnsResult<T>;
|
165 | callBase(): all.IReturnsResult<T>;
|
166 | }
|
167 | }
|
168 |
|
169 | declare module 'typemoq/Proxy/_all' {
|
170 | export * from "typemoq/Proxy/ICallContext";
|
171 | export * from "typemoq/Proxy/ICallInterceptor";
|
172 | export * from "typemoq/Proxy/Invocation";
|
173 | export * from "typemoq/Proxy/IProxyCall";
|
174 | export * from "typemoq/Proxy/IProxy";
|
175 | export * from "typemoq/Proxy/ProxyES5";
|
176 | export * from "typemoq/Proxy/ProxyES6";
|
177 | export * from "typemoq/Proxy/ProxyFactory";
|
178 | }
|
179 |
|
180 | declare module 'typemoq/GlobalMock' {
|
181 | import * as all from "typemoq/_all";
|
182 | import { MockBehavior } from "typemoq/_all";
|
183 | import { MethodCallReturn } from "typemoq/MethodCallReturn";
|
184 | export enum GlobalType {
|
185 | Class = 0,
|
186 | Function = 1,
|
187 | Value = 2,
|
188 | }
|
189 | export class GlobalMock<T> implements all.IGlobalMock<T> {
|
190 | mock: all.IMock<T>;
|
191 | container: Object;
|
192 | constructor(mock: all.IMock<T>, _name: string, _type: GlobalType, container: Object);
|
193 | readonly object: T;
|
194 | readonly target: T;
|
195 | readonly name: string;
|
196 | readonly behavior: MockBehavior;
|
197 | callBase: boolean;
|
198 | readonly type: GlobalType;
|
199 | setup<TResult>(expression: all.IFunc2<T, TResult>): MethodCallReturn<T, TResult>;
|
200 | verify<TResult>(expression: all.IFunc2<T, TResult>, times: all.Times): void;
|
201 | verifyAll(): void;
|
202 | reset(): void;
|
203 | }
|
204 | }
|
205 |
|
206 | declare module 'typemoq/Api/_all' {
|
207 | export * from "typemoq/Api/ICallback";
|
208 | export * from "typemoq/Api/IGlobalMock";
|
209 | export * from "typemoq/Api/IMock";
|
210 | export * from "typemoq/Api/IReturns";
|
211 | export * from "typemoq/Api/ISetup";
|
212 | export * from "typemoq/Api/IThrows";
|
213 | export * from "typemoq/Api/IUsing";
|
214 | export * from "typemoq/Api/IVerifies";
|
215 | export * from "typemoq/Api/MockBehavior";
|
216 | export * from "typemoq/Api/ExpectedCallType";
|
217 | export * from "typemoq/Api/Times";
|
218 | }
|
219 |
|
220 | declare module 'typemoq/Api/IUsing' {
|
221 | import * as common from "typemoq/Common/_all";
|
222 | export interface IUsingResult {
|
223 | with(action: common.IAction): void;
|
224 | }
|
225 | }
|
226 |
|
227 | declare module 'typemoq/Error/Exception' {
|
228 | export class Exception extends Error {
|
229 | name: string;
|
230 | constructor(name: string, message: string);
|
231 | toString(): string;
|
232 | }
|
233 | }
|
234 |
|
235 | declare module 'typemoq/Common/Ctor' {
|
236 | export type Ctor<T> = {
|
237 | new (): T;
|
238 | prototype: Object;
|
239 | };
|
240 | export type CtorWithArgs<T> = {
|
241 | new (...ctorArgs: any[]): T;
|
242 | prototype: Object;
|
243 | };
|
244 | }
|
245 |
|
246 | declare module 'typemoq/Common/Func' {
|
247 | export type IAction = () => void;
|
248 | export type IAction1<T> = (x: T) => void;
|
249 | export type IActionN<T> = (...x: T[]) => void;
|
250 | export type IFunc1<TResult> = () => TResult;
|
251 | export type IFunc2<T, TResult> = (x: T) => TResult;
|
252 | export type IFuncN<T, TResult> = (...x: T[]) => TResult;
|
253 | }
|
254 |
|
255 | declare module 'typemoq/Common/PropertyRetriever' {
|
256 | import { PropDescriptor } from "typemoq/Common/PropDescriptor";
|
257 | export class PropertyRetriever {
|
258 | static getOwnEnumerables(obj: any): {
|
259 | name: string;
|
260 | desc: PropDescriptor;
|
261 | }[];
|
262 | static getOwnNonenumerables(obj: any): {
|
263 | name: string;
|
264 | desc: PropDescriptor;
|
265 | }[];
|
266 | static getOwnEnumerablesAndNonenumerables(obj: any): {
|
267 | name: string;
|
268 | desc: PropDescriptor;
|
269 | }[];
|
270 | static getPrototypeEnumerables(obj: any): {
|
271 | name: string;
|
272 | desc: PropDescriptor;
|
273 | }[];
|
274 | static getPrototypeNonenumerables(obj: any): {
|
275 | name: string;
|
276 | desc: PropDescriptor;
|
277 | }[];
|
278 | static getPrototypeEnumerablesAndNonenumerables(obj: any): {
|
279 | name: string;
|
280 | desc: PropDescriptor;
|
281 | }[];
|
282 | static getOwnAndPrototypeEnumerables(obj: any): {
|
283 | name: string;
|
284 | desc: PropDescriptor;
|
285 | }[];
|
286 | static getOwnAndPrototypeNonenumerables(obj: any): {
|
287 | name: string;
|
288 | desc: PropDescriptor;
|
289 | }[];
|
290 | static getOwnAndPrototypeEnumerablesAndNonenumerables(obj: any): {
|
291 | name: string;
|
292 | desc: PropDescriptor;
|
293 | }[];
|
294 | }
|
295 | }
|
296 |
|
297 | declare module 'typemoq/Common/PropDescriptor' {
|
298 | export interface PropDescriptor {
|
299 | configurable?: boolean;
|
300 | enumerable?: boolean;
|
301 | value?: any;
|
302 | writable?: boolean;
|
303 | get?(): any;
|
304 | set?(v: any): void;
|
305 | }
|
306 | export interface PropDescriptorMap {
|
307 | [s: string]: PropDescriptor;
|
308 | }
|
309 | }
|
310 |
|
311 | declare module 'typemoq/Common/Utils' {
|
312 | import { CtorWithArgs } from "typemoq/Common/Ctor";
|
313 | export class Utils {
|
314 | static functionName(fun: Object): string;
|
315 | static objectName(obj: Object): string;
|
316 | static argsName(args: IArguments): string;
|
317 | static conthunktor<U>(ctor: CtorWithArgs<U>, args: any[]): U;
|
318 | static clone(target: Object, source: Object): void;
|
319 | }
|
320 | }
|
321 |
|
322 | declare module 'typemoq/_all' {
|
323 | export * from "typemoq/Api/_all";
|
324 | export * from "typemoq/Common/_all";
|
325 | export * from "typemoq/Error/_all";
|
326 | export * from "typemoq/Match/_all";
|
327 | export * from "typemoq/Proxy/_all";
|
328 | }
|
329 |
|
330 | declare module 'typemoq/MockBase' {
|
331 | import * as all from "typemoq/_all";
|
332 | import { InterceptorExecute } from "typemoq/InterceptorExecute";
|
333 | import { MethodCallReturn } from "typemoq/MethodCallReturn";
|
334 | export abstract class MockBase<T> implements all.IMock<T> {
|
335 | readonly target: T;
|
336 | readonly canOverrideTarget: boolean;
|
337 | readonly behavior: all.MockBehavior;
|
338 | protected _name: string;
|
339 | protected _interceptor: InterceptorExecute<T>;
|
340 | protected _proxy: T;
|
341 | constructor(target: T, canOverrideTarget: boolean, behavior?: all.MockBehavior);
|
342 | readonly object: T;
|
343 | readonly name: string;
|
344 | callBase: boolean;
|
345 | abstract setup<TResult>(expression: all.IFunc2<T, TResult>): MethodCallReturn<T, TResult>;
|
346 | abstract verify<TResult>(expression: all.IFunc2<T, TResult>, times: all.Times): void;
|
347 | verifyAll(): void;
|
348 | reset(): void;
|
349 | }
|
350 | }
|
351 |
|
352 | declare module 'typemoq/MethodCall' {
|
353 | import * as all from "typemoq/_all";
|
354 | import { MockBase } from "typemoq/MockBase";
|
355 | import { InterceptorSetup } from "typemoq/InterceptorSetup";
|
356 | export class MethodCall<T, TResult> implements all.IProxyCall<T>, all.IVerifies {
|
357 | mock: MockBase<T>;
|
358 | protected _id: string;
|
359 | protected _setupCall: all.ICallContext;
|
360 | protected _setupCallback: all.IAction;
|
361 | protected _isVerifiable: boolean;
|
362 | protected _expectedCallCount: all.Times;
|
363 | protected _expectedCallType: all.ExpectedCallType;
|
364 | protected _isInvoked: boolean;
|
365 | protected _callCount: number;
|
366 | protected _thrownException: Error;
|
367 | protected _evaluatedSuccessfully: boolean;
|
368 | protected constructor(mock: MockBase<T>, _setupExpression: all.IFunc2<T, TResult>, interceptor: InterceptorSetup<T>, proxy: T);
|
369 | static ofStaticMock<U, UResult>(mock: MockBase<U>, setupExpression: all.IFunc2<U, UResult>): MethodCall<U, UResult>;
|
370 | static ofDynamicMock<U, UResult>(mock: MockBase<U>, setupExpression: all.IFunc2<U, UResult>): MethodCall<U, UResult>;
|
371 | readonly id: string;
|
372 | readonly setupExpression: all.IAction1<T>;
|
373 | readonly setupCall: all.ICallContext;
|
374 | readonly isVerifiable: boolean;
|
375 | readonly isInSequence: boolean;
|
376 | readonly expectedCallCount: all.Times;
|
377 | readonly isInvoked: boolean;
|
378 | readonly callCount: number;
|
379 | setVerifiable(times?: all.Times, expectedCallType?: all.ExpectedCallType): void;
|
380 | evaluatedSuccessfully(): void;
|
381 | matches(call: all.ICallContext): boolean;
|
382 | execute(call: all.ICallContext): void;
|
383 | verifiable(times?: all.Times, expectedCallType?: all.ExpectedCallType): void;
|
384 | toString(): string;
|
385 | }
|
386 | }
|
387 |
|
388 | declare module 'typemoq/Proxy/ICallContext' {
|
389 | import { IPropertyInfo, InvocationType } from "typemoq/Proxy/Invocation";
|
390 | export enum CallType {
|
391 | UNKNOWN = 0,
|
392 | PROPERTY = 1,
|
393 | FUNCTION = 2,
|
394 | }
|
395 | export enum ProxyType {
|
396 | STATIC = 0,
|
397 | DYNAMIC = 1,
|
398 | }
|
399 | export interface ICallContext {
|
400 | args: IArguments;
|
401 | property: IPropertyInfo;
|
402 | returnValue: any;
|
403 | invokeBase(): void;
|
404 | invocationType: InvocationType;
|
405 | callType: CallType;
|
406 | proxyType: ProxyType;
|
407 | isAnUnknownDynamicCallAtExecution: boolean;
|
408 | }
|
409 | }
|
410 |
|
411 | declare module 'typemoq/Proxy/ICallInterceptor' {
|
412 | import { ICallContext } from "typemoq/Proxy/ICallContext";
|
413 | export interface ICallInterceptor {
|
414 | intercept(context: ICallContext): void;
|
415 | removeInvocation(context: ICallContext): void;
|
416 | }
|
417 | }
|
418 |
|
419 | declare module 'typemoq/Proxy/Invocation' {
|
420 | import * as common from "typemoq/Common/_all";
|
421 | import { ICallContext, CallType, ProxyType } from "typemoq/Proxy/ICallContext";
|
422 | export enum InvocationType {
|
423 | NONE = 0,
|
424 | SETUP = 1,
|
425 | EXECUTE = 2,
|
426 | }
|
427 | export abstract class BaseInvocation implements ICallContext {
|
428 | readonly proxyType: ProxyType;
|
429 | callType: CallType;
|
430 | returnValue: any;
|
431 | invocationType: InvocationType;
|
432 | constructor(proxyType: ProxyType, callType: CallType);
|
433 | abstract args: IArguments;
|
434 | readonly abstract property: IPropertyInfo;
|
435 | abstract invokeBase(): void;
|
436 | readonly isAnUnknownDynamicCallAtExecution: boolean;
|
437 | }
|
438 | export class MethodInvocation extends BaseInvocation {
|
439 | constructor(_that: Object, _property: MethodInfo, args?: IArguments, proxyType?: ProxyType, callType?: CallType);
|
440 | args: IArguments;
|
441 | readonly property: IPropertyInfo;
|
442 | invokeBase(): void;
|
443 | toString(): string;
|
444 | }
|
445 | export class ValueGetterInvocation extends BaseInvocation {
|
446 | readonly value: any;
|
447 | constructor(_property: IPropertyInfo, value: any, proxyType?: ProxyType, callType?: CallType);
|
448 | args: IArguments;
|
449 | readonly property: IPropertyInfo;
|
450 | invokeBase(): void;
|
451 | toString(): string;
|
452 | }
|
453 | export class DynamicGetInvocation extends ValueGetterInvocation {
|
454 | constructor(property: IPropertyInfo, value: any);
|
455 | }
|
456 | export class ValueSetterInvocation extends BaseInvocation {
|
457 | constructor(_property: IPropertyInfo, args: IArguments, proxyType?: ProxyType, callType?: CallType);
|
458 | args: IArguments;
|
459 | readonly property: IPropertyInfo;
|
460 | invokeBase(): void;
|
461 | toString(): string;
|
462 | }
|
463 | export class MethodGetterInvocation extends BaseInvocation {
|
464 | constructor(_property: IPropertyInfo, _getter: () => any, proxyType?: ProxyType, callType?: CallType);
|
465 | args: IArguments;
|
466 | readonly property: IPropertyInfo;
|
467 | invokeBase(): void;
|
468 | toString(): string;
|
469 | }
|
470 | export class MethodSetterInvocation extends BaseInvocation {
|
471 | constructor(_property: IPropertyInfo, _setter: (v: any) => void, args: IArguments, proxyType?: ProxyType, callType?: CallType);
|
472 | args: IArguments;
|
473 | readonly property: IPropertyInfo;
|
474 | invokeBase(): void;
|
475 | toString(): string;
|
476 | }
|
477 | export class MethodInfo implements IPropertyInfo {
|
478 | readonly obj: any;
|
479 | readonly name: string;
|
480 | readonly desc: common.PropDescriptor;
|
481 | constructor(obj: any, name: string, desc?: common.PropDescriptor);
|
482 | readonly toFunc: Function;
|
483 | toString(): string;
|
484 | }
|
485 | export class PropertyInfo implements IPropertyInfo {
|
486 | readonly obj: Object;
|
487 | readonly name: string;
|
488 | readonly desc: common.PropDescriptor;
|
489 | constructor(obj: Object, name: string, desc?: common.PropDescriptor);
|
490 | toString(): string;
|
491 | }
|
492 | export interface IPropertyInfo {
|
493 | obj: Object;
|
494 | name: string;
|
495 | desc?: common.PropDescriptor;
|
496 | }
|
497 | }
|
498 |
|
499 | declare module 'typemoq/Proxy/IProxyCall' {
|
500 | import * as common from "typemoq/Common/_all";
|
501 | import * as api from "typemoq/Api/_all";
|
502 | import { ICallContext } from "typemoq/Proxy/ICallContext";
|
503 | export interface IProxyCall<T> {
|
504 | id: string;
|
505 | setupExpression: common.IAction1<T>;
|
506 | setupCall: ICallContext;
|
507 | isVerifiable: boolean;
|
508 | isInSequence: boolean;
|
509 | expectedCallCount: api.Times;
|
510 | isInvoked: boolean;
|
511 | callCount: number;
|
512 | setVerifiable(times?: api.Times, expectedCallType?: api.ExpectedCallType): void;
|
513 | evaluatedSuccessfully(): void;
|
514 | matches(call: ICallContext): boolean;
|
515 | execute(call: ICallContext): void;
|
516 | }
|
517 | }
|
518 |
|
519 | declare module 'typemoq/Proxy/IProxy' {
|
520 | export interface IProxy {
|
521 | ___id: string;
|
522 | }
|
523 | }
|
524 |
|
525 | declare module 'typemoq/Proxy/ProxyES5' {
|
526 | import { IProxy } from "typemoq/Proxy/IProxy";
|
527 | import { ICallInterceptor } from "typemoq/Proxy/ICallInterceptor";
|
528 | export class ProxyES5<T> implements IProxy {
|
529 | readonly ___id: string;
|
530 | static of<U>(target: U, interceptor: ICallInterceptor): ProxyES5<U>;
|
531 | static isProxy(obj: any): boolean;
|
532 | }
|
533 | }
|
534 |
|
535 | declare module 'typemoq/Proxy/ProxyES6' {
|
536 | import { IProxy } from "typemoq/Proxy/IProxy";
|
537 | import { IProxyHandler } from "typemoq/Proxy/IProxyHandler";
|
538 | export class ProxyES6<T> implements IProxy {
|
539 | readonly ___id: string;
|
540 | static of<U>(target: U, handler: IProxyHandler<U>): ProxyES6<U>;
|
541 | }
|
542 | }
|
543 |
|
544 | declare module 'typemoq/Proxy/ProxyFactory' {
|
545 | import { ICallInterceptor } from "typemoq/Proxy/ICallInterceptor";
|
546 | export class ProxyFactory {
|
547 | static createProxy<T>(target: T, interceptor: ICallInterceptor): T;
|
548 | static createProxyES6<T>(target: T, interceptor: ICallInterceptor): T;
|
549 | }
|
550 | }
|
551 |
|
552 | declare module 'typemoq/Api/ICallback' {
|
553 | import * as common from "typemoq/Common/_all";
|
554 | import { IReturnsThrows } from "typemoq/Api/IReturns";
|
555 | export interface ICallback<T, TResult> {
|
556 | callback(action: common.IAction): IReturnsThrows<T, TResult>;
|
557 | callback(action: common.IAction1<T>): IReturnsThrows<T, TResult>;
|
558 | }
|
559 | }
|
560 |
|
561 | declare module 'typemoq/Api/IReturns' {
|
562 | import * as common from "typemoq/Common/_all";
|
563 | import { IVerifies } from "typemoq/Api/IVerifies";
|
564 | import { IThrows } from "typemoq/Api/IThrows";
|
565 | export interface IReturns<T, TResult> {
|
566 | returns(valueFunction: common.IFuncN<any, TResult>): IReturnsResult<T>;
|
567 | callBase(): IReturnsResult<T>;
|
568 | }
|
569 | export interface IReturnsResult<T> extends IVerifies {
|
570 | }
|
571 | export interface IReturnsThrows<T, TResult> extends IReturns<T, TResult>, IVerifies, IThrows {
|
572 | }
|
573 | }
|
574 |
|
575 | declare module 'typemoq/Api/ISetup' {
|
576 | import { ICallback } from "typemoq/Api/ICallback";
|
577 | import { IReturnsThrows } from "typemoq/Api/IReturns";
|
578 | import { IVerifies } from "typemoq/Api/IVerifies";
|
579 | export interface ISetup<T, TResult> extends ICallback<T, TResult>, IReturnsThrows<T, TResult>, IVerifies {
|
580 | }
|
581 | }
|
582 |
|
583 | declare module 'typemoq/Api/IThrows' {
|
584 | import { IVerifies } from "typemoq/Api/IVerifies";
|
585 | export interface IThrows {
|
586 | throws<T extends Error>(exception: T): IThrowsResult;
|
587 | }
|
588 | export interface IThrowsResult extends IVerifies {
|
589 | }
|
590 | }
|
591 |
|
592 | declare module 'typemoq/Api/IVerifies' {
|
593 | import { Times } from "typemoq/Api/Times";
|
594 | export interface IVerifies {
|
595 | verifiable(times?: Times): void;
|
596 | }
|
597 | }
|
598 |
|
599 | declare module 'typemoq/Error/_all' {
|
600 | export * from "typemoq/Error/Exception";
|
601 | export * from "typemoq/Error/MockException";
|
602 | }
|
603 |
|
604 | declare module 'typemoq/Match/_all' {
|
605 | export * from "typemoq/Match/IMatch";
|
606 | export * from "typemoq/Match/Match";
|
607 | export * from "typemoq/Match/MatchAny";
|
608 | export * from "typemoq/Match/MatchPred";
|
609 | export * from "typemoq/Match/MatchValue";
|
610 | export * from "typemoq/Match/MatchObjectWith";
|
611 | }
|
612 |
|
613 | declare module 'typemoq/InterceptorExecute' {
|
614 | import * as all from "typemoq/_all";
|
615 | import { InterceptorContext } from "typemoq/InterceptorContext";
|
616 | export class InterceptorExecute<T> implements all.ICallInterceptor {
|
617 | constructor(mock: all.IMock<T>);
|
618 | readonly interceptorContext: InterceptorContext<T>;
|
619 | intercept(invocation: all.ICallContext): void;
|
620 | removeInvocation(invocation: all.ICallContext): void;
|
621 | addExpectedCall(call: all.IProxyCall<T>): void;
|
622 | verify(): void;
|
623 | verifyCallCount<T>(call: all.IProxyCall<T>, times: all.Times): void;
|
624 | reset(): void;
|
625 | }
|
626 | }
|
627 |
|
628 | declare module 'typemoq/InterceptorSetup' {
|
629 | import * as all from "typemoq/_all";
|
630 | export class InterceptorSetup<T> implements all.ICallInterceptor {
|
631 | readonly interceptedCall: all.ICallContext;
|
632 | intercept(invocation: all.ICallContext): void;
|
633 | removeInvocation(invocation: all.ICallContext): void;
|
634 | }
|
635 | }
|
636 |
|
637 | declare module 'typemoq/Proxy/IProxyHandler' {
|
638 | import * as common from "typemoq/Common/_all";
|
639 | export type PropKey = string | number | symbol;
|
640 | export interface IProxyHandler<T> {
|
641 | getPrototypeOf?(target: T): Object | null;
|
642 | setPrototypeOf?(target: T, v: any): boolean;
|
643 | isExtensible?(target: T): boolean;
|
644 | preventExtensions?(target: T): boolean;
|
645 | getOwnPropertyDescriptor?(target: T, p: PropKey): common.PropDescriptor;
|
646 | has?(target: T, p: PropKey): boolean;
|
647 | get?(target: T, p: PropKey, receiver: any): any;
|
648 | set?(target: T, p: PropKey, value: any, receiver: any): boolean;
|
649 | deleteProperty?(target: T, p: PropKey): boolean;
|
650 | defineProperty?(target: T, p: PropKey, attributes: common.PropDescriptor): boolean;
|
651 | enumerate?(target: T): PropKey[];
|
652 | ownKeys?(target: T): PropKey[];
|
653 | apply?(target: T, thisArg: any, argArray?: any): any;
|
654 | construct?(target: T, argArray: any, newTarget?: any): Object;
|
655 | }
|
656 | }
|
657 |
|
658 | declare module 'typemoq/Match/IMatch' {
|
659 | export interface IMatch {
|
660 | readonly ___id: string;
|
661 | ___matches(object: Object): boolean;
|
662 | }
|
663 | }
|
664 |
|
665 | declare module 'typemoq/Match/Match' {
|
666 | export class Match {
|
667 | static isMatcher(x: any): boolean;
|
668 | }
|
669 | }
|
670 |
|
671 | declare module 'typemoq/Match/MatchAny' {
|
672 | import * as common from "typemoq/Common/_all";
|
673 | import { IMatch } from "typemoq/Match/IMatch";
|
674 | export class MatchAnyObject<T> implements IMatch {
|
675 | readonly ___id: string;
|
676 | constructor(_ctor: common.Ctor<T>);
|
677 | ___matches(object: Object): boolean;
|
678 | toString(): string;
|
679 | }
|
680 | export class MatchAny implements IMatch {
|
681 | readonly ___id: string;
|
682 | ___matches(object: Object): boolean;
|
683 | toString(): string;
|
684 | }
|
685 | export class MatchAnyString implements IMatch {
|
686 | readonly ___id: string;
|
687 | ___matches(object: Object): boolean;
|
688 | toString(): string;
|
689 | }
|
690 | export class MatchAnyNumber implements IMatch {
|
691 | readonly ___id: string;
|
692 | ___matches(object: Object): boolean;
|
693 | toString(): string;
|
694 | }
|
695 | }
|
696 |
|
697 | declare module 'typemoq/Match/MatchPred' {
|
698 | import * as common from "typemoq/Common/_all";
|
699 | import { IMatch } from "typemoq/Match/IMatch";
|
700 | export class MatchPred<T> implements IMatch {
|
701 | readonly ___id: string;
|
702 | constructor(_pred: common.IFunc2<T, boolean>);
|
703 | ___matches(object: Object): boolean;
|
704 | toString(): string;
|
705 | }
|
706 | }
|
707 |
|
708 | declare module 'typemoq/Match/MatchValue' {
|
709 | import { IMatch } from "typemoq/Match/IMatch";
|
710 | export class MatchValue<T> implements IMatch {
|
711 | readonly ___id: string;
|
712 | constructor(value: T);
|
713 | ___matches(object: any): boolean;
|
714 | toString(): string;
|
715 | }
|
716 | }
|
717 |
|
718 | declare module 'typemoq/Match/MatchObjectWith' {
|
719 | import { IMatch } from "typemoq/Match/IMatch";
|
720 | export class MatchObjectWith<T> implements IMatch {
|
721 | readonly ___id: string;
|
722 | constructor(value: T);
|
723 | ___matches(object: Object): boolean;
|
724 | toString(): string;
|
725 | }
|
726 | }
|
727 |
|
728 | declare module 'typemoq/InterceptorContext' {
|
729 | import * as all from "typemoq/_all";
|
730 | import { CurrentInterceptContext } from "typemoq/CurrentInterceptContext";
|
731 | export enum InterceptionAction {
|
732 | Continue = 0,
|
733 | Stop = 1,
|
734 | }
|
735 | export interface IInterceptStrategy<T> {
|
736 | handleIntercept(invocation: all.ICallContext, ctx: InterceptorContext<T>, localCtx: CurrentInterceptContext<T>): InterceptionAction;
|
737 | }
|
738 | export class InterceptorContext<T> {
|
739 | mock: all.IMock<T>;
|
740 | constructor(mock: all.IMock<T>);
|
741 | readonly behavior: all.MockBehavior;
|
742 | addInvocation(invocation: all.ICallContext): void;
|
743 | removeInvocation(invocation: all.ICallContext): void;
|
744 | actualInvocations(): all.ICallContext[];
|
745 | addExpectedCall(call: all.IProxyCall<T>): void;
|
746 | removeExpectedCall(call: all.IProxyCall<T>): void;
|
747 | expectedCalls(): all.IProxyCall<T>[];
|
748 | reset(): void;
|
749 | }
|
750 | }
|
751 |
|
752 | declare module 'typemoq/CurrentInterceptContext' {
|
753 | import * as all from "typemoq/_all";
|
754 | export class CurrentInterceptContext<T> {
|
755 | call: all.IProxyCall<T>;
|
756 | }
|
757 | }
|
758 |
|