Added types for jquery-toast-plugin

This commit is contained in:
Viqas Hussain 2018-06-21 13:38:50 +01:00
parent 0897921174
commit e528ae38eb
4 changed files with 56 additions and 0 deletions

32
types/jquery-toast-plugin/index.d.ts vendored Normal file
View File

@ -0,0 +1,32 @@
// Type definitions for jquery-toast-plugin
// Project: https://github.com/kamranahmedse/jquery-toast-plugin
// Definitions by: Viqas Hussain <https://github.com/viqashussain>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
/// <reference types="jquery"/>
interface JQueryStatic {
toast(options: toastOptions): void;
}
interface toastOptions
{
text: string;
heading?: string;
showHideTransition?: string;
allowToastClose?: boolean;
hideAfter?: number;
loader?: boolean;
loaderBg?: string;
stack?: number;
position?: string;
bgColor?: boolean;
textColor?: boolean;
textAlign?: string;
icon?: boolean;
beforeShow?: () => any;
afterShown?: () => any;
beforeHide?: () => any;
afterHidden?: () => any;
}

View File

@ -0,0 +1 @@
$.toast({ text: "test" })

View File

@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"jquery-toast-plugin-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }