1.5.5 • Published 7 months ago

@types/roll-a-die v1.5.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Installation

npm install --save @types/roll-a-die

Summary

This package contains type definitions for roll-a-die (https://github.com/chukwumaijem/roll-a-die).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/roll-a-die.

index.d.ts

// Type definitions for roll-a-die 1.5
// Project: https://github.com/chukwumaijem/roll-a-die
// Definitions by: Romilo <https://github.com/romilodev>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export interface Options {
    /** The element to render die animation on. */
    element: HTMLElement;
    /** The number of dice to use. */
    numberOfDice: number;
    /**
     * Called when animation is finished.
     * @param values An array of the values from throw.
     */
    callback: (values: number[]) => any;
    /**
     * Roll the die without sound.
     * @default false
     */
    noSound?: boolean | undefined;
    /**
     * Time in milliseconds to delay before removing animations
     * @default 3000
     */
    delay?: number | undefined;
    /**
     * Values to show on die face.
     * When provided, it overrides library genrated values.
     */
    values?: number[] | undefined;
  }

/**
 * Run 3D dice roll animation.
 *
 * @param options
 *
 * @example
 * rollADie({ element, numberOfDice: 2, callback});
 *
 * @example
 * rollADie({ element, numberOfDice: 2, callback, noSound: true});
 *
 * @example
 * rollADie({ element, numberOfDice: 2, callback, delay: 1000});
 *
 * @example
 * rollADie({ element, numberOfDice: 2, callback, values: [3, 4]});
 *
 * @see {@link https://github.com/chukwumaijem/roll-a-die|Github}
 * @see {@link https://www.npmjs.com/package/roll-a-die|NPM}
 * @see {@link https://codepen.io/chukwuma-ezumezu/pen/qYKOGW|Demo}
 */
export default function(options: Options): void;

Additional Details

  • Last updated: Thu, 08 Jul 2021 22:42:07 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Romilo.

1.5.5

7 months ago

1.5.4

7 months ago

1.5.3

8 months ago

1.5.2

2 years ago

1.5.1

3 years ago

1.5.0

3 years ago