Skip to content

Commit

Permalink
Add type information for imitation to the exported typings file
Browse files Browse the repository at this point in the history
  • Loading branch information
lisaah committed Nov 29, 2018
1 parent 55b5a62 commit 908f9c2
Show file tree
Hide file tree
Showing 2 changed files with 1,417 additions and 1,637 deletions.
24 changes: 24 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,30 @@ export function object<T>(object: string): DoubledObject<T>;
*/
export function object<T>(object: T): DoubledObject<T>;

// fake: imitations

/**
* Create a fake object constructor for the given class.
*
* @export
* @template T
* @param {{ new (...args: any[]): T }} constructor
* @param {string} [name]
* @returns {TestDoubleConstructor<T>}
*/
export function imitate<T>(constructor: Constructor<T>, name?: string): TestDoubleConstructor<T>;

/**
* Create a fake object or function.
*
* @export
* @template T
* @param {T} original
* @param {string} [name]
* @returns {TestDouble<T>}
*/
export function imitate<T>(original: T, name?: string): TestDouble<T>;

//
// stubbing
// ----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 908f9c2

Please sign in to comment.