@types/jquery-countto
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

Installation

npm install --save @types/jquery-countto

Summary

This package contains type definitions for jquery-countto (https://github.com/mhuggins/jquery-countTo).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jquery-countto.

index.d.ts

/// <reference types="jquery" />

export type Options = Partial<{
    /**
     * The number to start counting from
     */
    from: number;

    /**
     * The number to stop counting at
     */
    to: number;

    /**
     * The number of milliseconds it should take to finish counting
     */
    speed: number;

    /**
     * The number of milliseconds to wait between refreshing the counter
     */
    refreshInterval: number;

    /**
     * The number of decimal places to show when using the default formatter
     */
    decimals: number;

    /**
     * A handler that is used to format the current value before rendering to the DOM
     */
    formatter: (value: number, options: Options) => string;

    /**
     * A callback function that is triggered for every iteration that the counter updates
     */
    onUpdate: (value: number) => void;

    /**
     * A callback function that is triggered when counting finishes
     */
    onComplete: (value: number) => void;
}>;

export type Method = "start" | "stop" | "toggle" | "restart";

declare global {
    interface JQuery {
        countTo(methodOrOptions?: Method | Options): JQuery;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/jquery

Credits

These definitions were written by Anderson Friaça.

Dependents (0)

Package Sidebar

Install

npm i @types/jquery-countto

Weekly Downloads

73

Version

1.2.4

License

MIT

Unpacked Size

5.02 kB

Total Files

5

Last publish

Collaborators

  • types