npm.io
1.2.4 • Published 2 years ago

@types/jquery-countto

Licence
MIT
Version
1.2.4
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

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 0337 GMT
  • Dependencies: @types/jquery

Credits

These definitions were written by Anderson Friaça.