Socket
Socket
Sign inDemoInstall

@types/debounce-promise

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/debounce-promise

TypeScript definitions for debounce-promise


Version published
Maintainers
1
Install size
4.37 kB
Created

Readme

Source

Installation

npm install --save @types/debounce-promise

Summary

This package contains type definitions for debounce-promise (https://github.com/bjoerge/debounce-promise).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/debounce-promise.

index.d.ts

declare namespace debounce {
    interface DebounceOptions {
        leading?: boolean | undefined;
        accumulate?: boolean | undefined;
    }
}

// func is called with an array of array of parameters if accumulate is true
// Use Array<[arg0, arg1, ..., argN]> as func's first parameter type for correct hints
declare function debounce<T extends any[], R>(
    func: (args: Array<[...T]>) => R,
    wait?: number,
    options?: debounce.DebounceOptions & { accumulate: true },
): (
    ...args: T
) => R extends Promise<any> ? R
    : Promise<R>;

declare function debounce<T extends (...args: any[]) => any>(
    func: T,
    wait?: number | (() => number),
    options?: debounce.DebounceOptions,
): (
    ...args: Parameters<T>
) => ReturnType<T> extends Promise<any> ? ReturnType<T>
    : Promise<ReturnType<T>>;

export = debounce;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by Wu Haotian, and Trevor Robinson.

FAQs

Last updated on 07 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc