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

1.12.3 • Public • Published

Installation

npm install --save @types/toastify-js

Summary

This package contains type definitions for toastify-js (https://github.com/apvarun/toastify-js#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/toastify-js.

index.d.ts

declare namespace StartToastifyInstance {
    function reposition(): void;
    interface Offset {
        x: number | string;
        y: number | string;
    }

    interface Options {
        text?: string | undefined;
        node?: Node | undefined;
        duration?: number | undefined;
        selector?: string | Node | undefined;
        destination?: string | undefined;
        newWindow?: boolean | undefined;
        close?: boolean | undefined;
        gravity?: "top" | "bottom" | undefined;
        position?: "left" | "center" | "right" | undefined;
        /**
         * Announce the toast to screen readers
         * @default 'polite'
         */
        ariaLive?: "off" | "polite" | "assertive" | undefined;
        /**
         * @deprecated use style.background option instead
         */
        backgroundColor?: string | undefined;
        /**
         * Image/icon to be shown before text
         */
        avatar?: string | undefined;
        className?: string | undefined;
        /**
         * @default true
         */
        stopOnFocus?: boolean | undefined;
        /**
         * Invoked when the toast is dismissed
         */
        callback?: (() => void) | undefined;
        onClick?: (() => void) | undefined;
        offset?: Offset | undefined;
        /**
         * Toggle the default behavior of escaping HTML markup
         */
        escapeMarkup?: boolean | undefined;
        /**
         * HTML DOM Style properties to add any style directly to toast
         */
        style?: { [cssRule: string]: string };
        /**
         * Set the order in which toasts are stacked in page
         */
        oldestFirst?: boolean | undefined;
    }
}

declare class Toastify {
    /**
     * The configuration object to configure Toastify
     */
    readonly options: StartToastifyInstance.Options;
    /**
     * The element that is the Toast
     */
    readonly toastElement: Element | null;
    /**
     * Display the toast
     */
    showToast(): void;
    /**
     * Hide the toast
     */
    hideToast(): void;
}
declare function StartToastifyInstance(options?: Toastify.Options): Toastify;

export as namespace Toastify;

export = StartToastifyInstance;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by adblanc, and Piotr Błażejewicz.

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @types/toastify-js

Weekly Downloads

18,348

Version

1.12.3

License

MIT

Unpacked Size

7.22 kB

Total Files

5

Last publish

Collaborators

  • types