Skip to content

Commit

Permalink
arg
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed May 9, 2022
1 parent 50180fd commit 3304d35
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/@types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import "@matrix-org/olm";
export {};

declare global {
namespace NodeJS {
// use `number` as the return type in all cases for global.set{Interval,Timeout},
// so we don't accidentally use the methods on NodeJS.Timeout - they only exist in a subset of environments.
// The overload for clear{Interval,Timeout} is resolved as expected.
// We use `ReturnType<typeof setTimeout>` in the code to be agnostic of if this definition gets loaded.
function setInterval(handler: TimerHandler, timeout: number, ...arguments: any[]): number;
function setTimeout(handler: TimerHandler, timeout: number, ...arguments: any[]): number;
// use `number` as the return type in all cases for global.set{Interval,Timeout},
// so we don't accidentally use the methods on NodeJS.Timeout - they only exist in a subset of environments.
// The overload for clear{Interval,Timeout} is resolved as expected.
// We use `ReturnType<typeof setTimeout>` in the code to be agnostic of if this definition gets loaded.
function setInterval(handler: TimerHandler, timeout: number, ...arguments: any[]): number;
function setTimeout(handler: TimerHandler, timeout: number, ...arguments: any[]): number;

namespace NodeJS {
interface Global {
localStorage: Storage;
}
Expand Down

0 comments on commit 3304d35

Please sign in to comment.