0.2.9 • Published 6 months ago

@types/jquery-toastmessage-plugin v0.2.9

Weekly downloads
6
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/jquery-toastmessage-plugin

Summary

This package contains type definitions for jquery-toastmessage-plugin (https://github.com/akquinet/jquery-toastmessage-plugin).

Details

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

index.d.ts

// Type definitions for non-npm package jquery-toastmessage-plugin 0.2
// Project: https://github.com/akquinet/jquery-toastmessage-plugin
// Definitions by: Joe Skeen <https://github.com/joeskeen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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

interface JQuery {
    toastmessage: JQueryToastmessage.ToastmessageStatic;
}

/** jQuery Toastmessage (http://akquinet.github.io/jquery-toastmessage-plugin/) */
declare namespace JQueryToastmessage {
    interface ToastmessageStatic {
        /* shows a toast message of the specified type */
        (command: ShowToastCommand, message: string): JQuery;
        /** shows a custom toast */
        (command: 'showToast', toastOpts: ToastOptions): JQuery;
        /** removes the specified toast and returns it */
        (command: 'removeToast', toast: JQuery, closeOpts?: ToastOptions): void;
        /** configures the default toast options */
        (toastOpts: ToastOptions): void;
    }

    type ShowToastCommand = 'showNoticeToast' | 'showSuccessToast' | 'showWarningToast' | 'showErrorToast';
    type ToastType = 'notice' | 'warning' | 'error' | 'success';
    type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right';

    interface ToastOptions {
        /** in effect duration in miliseconds @default 600 */
        inEffectDuration?: number | undefined;
        /**
         * time in miliseconds before the item has to disappear @default 3000
         */
        stayTime?: number | undefined;
        /** content of the item @default '' */
        text?: string | undefined;
        /** should the toast item sticky or not? @default false */
        sticky?: boolean | undefined;
        /** the type of toast @default 'notice' */
        type?: ToastType | undefined;
        /**
         * Position of the toast container holding different toast.
         * Position can be set only once at the very first call,
         * changing the position after the first call does nothing
         * @default 'top-right'
         */
        position?: ToastPosition | undefined;
        /**
         * text which will be shown as close button,
         * set to '' when you want to introduce an image via css
         * @default ''
         */
        closeText?: string | undefined;
        /** callback function when the toastmessage is closed @default null */
        close?(): void;
    }
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 16:22:31 GMT
  • Dependencies: @types/jquery
  • Global values: none

Credits

These definitions were written by Joe Skeen.

0.2.7

8 months ago

0.2.9

6 months ago

0.2.8

7 months ago

0.2.6

3 years ago

0.2.5

5 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago