@fluffy-spoon/substitute
Advanced tools
Comparing version 1.0.61 to 1.0.62
@@ -15,6 +15,9 @@ import { AllArguments } from "./Arguments"; | ||
export declare type ObjectSubstitute<T extends Object, K extends Object = T> = ObjectSubstituteTransformation<T> & { | ||
received(amount?: number): K; | ||
didNotReceive(amount?: number): K; | ||
received(amount?: number): TerminatingObject<K>; | ||
didNotReceive(amount?: number): TerminatingObject<K>; | ||
mimick(instance: T): void; | ||
}; | ||
declare type TerminatingObject<T> = { | ||
[P in keyof T]: T[P] extends () => infer R ? () => void : T[P] extends (...args: infer F) => infer R ? (...args: F) => void : T[P]; | ||
}; | ||
declare type ObjectSubstituteTransformation<T extends Object> = { | ||
@@ -21,0 +24,0 @@ [P in keyof T]: T[P] extends () => infer R ? NoArgumentFunctionSubstitute<R> : T[P] extends (...args: infer F) => infer R ? FunctionSubstitute<F, R> : PropertySubstitute<T[P]>; |
{ | ||
"name": "@fluffy-spoon/substitute", | ||
"version": "1.0.61", | ||
"version": "1.0.62", | ||
"description": "An NSubstitute port to TypeScript called substitute.js.", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/Index.js", |
@@ -25,7 +25,14 @@ import { AllArguments } from "./Arguments"; | ||
export type ObjectSubstitute<T extends Object, K extends Object = T> = ObjectSubstituteTransformation<T> & { | ||
received(amount?: number): K; | ||
didNotReceive(amount?: number): K; | ||
received(amount?: number): TerminatingObject<K>; | ||
didNotReceive(amount?: number): TerminatingObject<K>; | ||
mimick(instance: T): void; | ||
} | ||
type TerminatingObject<T> = { | ||
[P in keyof T]: | ||
T[P] extends () => infer R ? () => void : | ||
T[P] extends (...args: infer F) => infer R ? (...args: F) => void : | ||
T[P]; | ||
} | ||
type ObjectSubstituteTransformation<T extends Object> = { | ||
@@ -32,0 +39,0 @@ [P in keyof T]: |
Sorry, the diff of this file is not supported yet
135814
1577