Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Prepare for TS DefinitelyTyped#32460

* Revert change
  • Loading branch information
ahejlsberg authored Jul 23, 2019
1 parent 518db03 commit b4584a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions types/react-dom/test-utils/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,8 @@ export function createRenderer(): ShallowRenderer;
* @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
*/
// the "void | undefined" is here to forbid any sneaky "Promise" returns.
// the actual return value is always a "DebugPromiseLike",
// but having an "| {}" makes it harder to accidentally use.
export function act(callback: () => void | undefined): DebugPromiseLike | {};
// the actual return value is always a "DebugPromiseLike".
export function act(callback: () => void | undefined): DebugPromiseLike;

// Intentionally doesn't extend PromiseLike<never>.
// Ideally this should be as hard to accidentally use as possible.
Expand Down
5 changes: 2 additions & 3 deletions types/react-test-renderer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ export function create(nextElement: ReactElement, options?: TestRendererOptions)
* @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
*/
// the "void | undefined" is here to forbid any sneaky "Promise" returns.
// the actual return value is always a "DebugPromiseLike",
// but having an "| {}" makes it harder to accidentally use.
export function act(callback: () => void | undefined): DebugPromiseLike | {};
// the actual return value is always a "DebugPromiseLike".
export function act(callback: () => void | undefined): DebugPromiseLike;

// Intentionally doesn't extend PromiseLike<never>.
// Ideally this should be as hard to accidentally use as possible.
Expand Down

0 comments on commit b4584a2

Please sign in to comment.