mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
add type definition for p-loading (#22952)
This commit is contained in:
committed by
Wesley Wigham
parent
b47a6d3d07
commit
3a8270c12c
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
// Type definitions for p-loading 1.2
|
||||
// Project: http://joseshiru.github.io/p-loading/
|
||||
// Definitions by: Soner Köksal <https://github.com/renjfk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
interface PLoadingOptions {
|
||||
action?: "show" | "hide" | "destroy";
|
||||
maskColor?: string;
|
||||
containerHTML?: string;
|
||||
containerAttrs?: object;
|
||||
containerClass?: string;
|
||||
spinnerHTML?: string;
|
||||
spinnerAttrs?: object;
|
||||
spinnerClass?: string;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
onShowContainer?: ($pluginElement: JQuery, $container: JQuery) => void;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
onHideContainer?: ($pluginElement: JQuery, $container: JQuery) => void;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
onDestroyContainer?: ($container: JQuery) => void;
|
||||
hideAnimation?: ($container: JQuery) => void;
|
||||
showAnimation?: ($container: JQuery) => void;
|
||||
destroyAfterHide?: boolean;
|
||||
idPrefix?: string;
|
||||
pluginNameSpace?: string;
|
||||
useAddOns?: string [];
|
||||
}
|
||||
|
||||
interface PLoading {
|
||||
(options: PLoadingOptions): void;
|
||||
|
||||
defaults: PLoadingOptions;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
ploading: PLoading;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
ploading: PLoading;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
$('#test').ploading({action: 'show'});
|
||||
|
||||
$('#test').ploading({action: 'hide'});
|
||||
|
||||
$('#test').ploading({action: 'destroy'});
|
||||
|
||||
$('#test').ploading({action: 'hide', useAddOns: ['addOnName']});
|
||||
|
||||
$.fn.ploading.defaults = {
|
||||
// ploading static settings
|
||||
useAddOns: ['addOnName']
|
||||
};
|
||||
|
||||
$.fn.ploading.defaults = {
|
||||
spinnerClass: 'your-spinner-class'
|
||||
};
|
||||
|
||||
$.fn.ploading.defaults = {
|
||||
spinnerHTML: '<i></i>',
|
||||
spinnerClass: 'fa fa-spinner fa-spin p-loading-fontawesome'
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"p-loading-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user