diff --git a/types/debounce/debounce-tests.ts b/types/debounce/debounce-tests.ts index 4acff7c446..5f0463a4c1 100644 --- a/types/debounce/debounce-tests.ts +++ b/types/debounce/debounce-tests.ts @@ -14,6 +14,9 @@ const imm1: number = (debounce((x: number) => x * 2, 100, true))(2); const clearable = debounce(doThings); clearable.clear(); +const flushable = debounce(doThings); +flushable.flush(); + // Intentionally asserts that the member variable has all the same benefits as the direct export. // Eventually, if debounce stop supporting the CommonJS-only module calling (`require("debounce")(...)`), // we can remove this and change the top import&require to `import { debounce } from "debounce";`. diff --git a/types/debounce/index.d.ts b/types/debounce/index.d.ts index fa244351d6..e561cb51fe 100644 --- a/types/debounce/index.d.ts +++ b/types/debounce/index.d.ts @@ -1,13 +1,15 @@ -// Type definitions for debounce 3.0 +// Type definitions for debounce 1.2 // Project: https://github.com/component/debounce // Definitions by: Denis Sokolov // Josh Goldberg +// Wayne Carson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace _debounce { const debounce: typeof _debounce; } -declare function _debounce(f: A, interval?: number, immediate?: boolean): A & { clear(): void; }; +declare function _debounce(f: A, interval?: number, immediate?: boolean): A & { clear(): void; } + & { flush(): void }; export = _debounce;