mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #22312 from DefinitelyTyped/not-needed-confirmdialog
confirmdialog: Provides its own types
This commit is contained in:
@@ -180,6 +180,12 @@
|
||||
"sourceRepoURL": "https://github.com/tj/commander.js",
|
||||
"asOfVersion": "2.12.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "confirmdialog",
|
||||
"typingsPackageName": "confirmdialog",
|
||||
"sourceRepoURL": "https://github.com/allipierre/Type-definitions-for-jquery-confirm/tree/master/types/confirmDialog-js",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "constant-case",
|
||||
"typingsPackageName": "constant-case",
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
class Confirm {
|
||||
private title_: string;
|
||||
private conTent_: string;
|
||||
constructor(title: string, content: string) {
|
||||
this.title_ = title;
|
||||
this.conTent_ = content;
|
||||
}
|
||||
|
||||
confirm() {
|
||||
$.confirm({
|
||||
title: 'Confirm!',
|
||||
content: 'Simple confirm!',
|
||||
buttons: {
|
||||
confirm: () => {
|
||||
$.alert('Confirmed!');
|
||||
},
|
||||
cancel: (cancel: string) => {
|
||||
$.alert('Canceled! ' + cancel);
|
||||
},
|
||||
somethingElse: {
|
||||
text: 'Something else',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter', 'shift'],
|
||||
action: () => {
|
||||
alert('Something else?');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
alert() {
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: 'Simple alert!',
|
||||
});
|
||||
}
|
||||
|
||||
globalSettings() {
|
||||
jconfirm.defaults = {
|
||||
title: 'Hello',
|
||||
titleClass: '',
|
||||
type: 'default',
|
||||
typeAnimated: true,
|
||||
draggable: true,
|
||||
dragWindowGap: 15,
|
||||
dragWindowBorder: true,
|
||||
animateFromElement: true,
|
||||
smoothContent: true,
|
||||
content: 'Are you sure to continue?',
|
||||
buttons: {},
|
||||
defaultButtons: {
|
||||
ok: {
|
||||
action: () => {
|
||||
}
|
||||
},
|
||||
close: {
|
||||
action: () => {
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
icon: '',
|
||||
lazyOpen: false,
|
||||
bgOpacity: null,
|
||||
theme: 'light',
|
||||
animation: 'scale',
|
||||
closeAnimation: 'scale',
|
||||
animationSpeed: 400,
|
||||
animationBounce: 1,
|
||||
rtl: false,
|
||||
container: 'body',
|
||||
containerFluid: false,
|
||||
backgroundDismiss: false,
|
||||
backgroundDismissAnimation: 'shake',
|
||||
autoClose: false,
|
||||
closeIcon: null,
|
||||
closeIconClass: false,
|
||||
watchInterval: 100,
|
||||
columnClass: 'col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1',
|
||||
boxWidth: '50%',
|
||||
scrollToPreviousElement: true,
|
||||
scrollToPreviousElementAnimate: true,
|
||||
useBootstrap: true,
|
||||
offsetTop: 40,
|
||||
offsetBottom: 40,
|
||||
bootstrapClasses: {
|
||||
container: 'container',
|
||||
containerFluid: 'container-fluid',
|
||||
row: 'row',
|
||||
},
|
||||
onContentReady: () => {},
|
||||
onOpenBefore: () => {},
|
||||
onOpen: () => {},
|
||||
onClose: () => {},
|
||||
onDestroy: () => {},
|
||||
onAction: () => {}
|
||||
};
|
||||
}
|
||||
|
||||
api() {
|
||||
const jc = $.confirm({
|
||||
title: 'awesome',
|
||||
onContentReady: () => {
|
||||
jc.setTitle();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
confirm_84() {
|
||||
$.confirm({
|
||||
closeIcon: true,
|
||||
buttons: {
|
||||
buttonA: {
|
||||
text: 'button a',
|
||||
action: (buttonA: string) => {
|
||||
return false; // prevent the modal from closing
|
||||
}
|
||||
},
|
||||
resetButton: (resetButton: string) => {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let firstName = 'Pierre';
|
||||
let lastName = 'Yotti';
|
||||
let type = new Confirm(firstName, lastName);
|
||||
Vendored
-93
@@ -1,93 +0,0 @@
|
||||
// Type definitions for confirmdialog 3.3
|
||||
// Project: https://github.com/allipierre/Type-definitions-for-jquery-confirm/tree/master/types/confirmDialog-js
|
||||
// Definitions by: Alli Pierre Yotti <https://github.com/allipierre>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
interface JQueryStatic {
|
||||
/**
|
||||
* confirm Dialog
|
||||
* {confirmOptions} pOtions
|
||||
*/
|
||||
confirm(pOtions: options.confirmOptions | string, title?: string): any;
|
||||
|
||||
/**
|
||||
* confirm alert
|
||||
* {any} pMessage
|
||||
*/
|
||||
alert(pMessage?: any, title?: string): any;
|
||||
|
||||
/**
|
||||
* confirm Dialog
|
||||
* {any} pMessage
|
||||
*/
|
||||
dialog(pOtions: options.confirmOptions | string): any;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* confirm Dialog
|
||||
* {confirmOptions} pOtions
|
||||
*/
|
||||
confirm(pOtions: options.confirmOptions | string, title?: string): any;
|
||||
|
||||
/**
|
||||
* confirm alert
|
||||
* {any} pMessage
|
||||
*/
|
||||
alert(pMessage?: any, title?: string): any;
|
||||
|
||||
/**
|
||||
* confirm Dialog
|
||||
* {any} pMessage
|
||||
*/
|
||||
dialog(pOtions: options.confirmOptions): any;
|
||||
}
|
||||
|
||||
interface Window {
|
||||
setContentAppend: any;
|
||||
}
|
||||
|
||||
declare namespace options {
|
||||
interface confirmOptions {
|
||||
buttons?: any;
|
||||
title?: string | boolean;
|
||||
content?: any;
|
||||
onContentReady?: any;
|
||||
lazyOpen?: boolean;
|
||||
closeIcon?: any;
|
||||
type?: string;
|
||||
typeAnimated?: boolean;
|
||||
icon?: string;
|
||||
closeIconClass?: string;
|
||||
columnClass?: string;
|
||||
containerFluid?: boolean;
|
||||
boxWidth?: string;
|
||||
useBootstrap?: boolean;
|
||||
bootstrapClasses?: any;
|
||||
draggable?: boolean;
|
||||
dragWindowBorder?: boolean;
|
||||
dragWindowGap?: number;
|
||||
contentLoaded?: () => void;
|
||||
autoClose?: string;
|
||||
backgroundDismiss?: any;
|
||||
backgroundDismissAnimation?: string;
|
||||
escapeKey?: string | boolean;
|
||||
onOpenBefore?: () => void;
|
||||
onOpen?: () => void;
|
||||
onClose?: () => void;
|
||||
onDestroy?: () => void;
|
||||
onAction?: () => void;
|
||||
}
|
||||
|
||||
interface buttonOptionss {
|
||||
cancel?: () => void;
|
||||
confirm?: () => void;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace jconfirm {
|
||||
let defaults: any;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"target": "es6"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"confirmdialog-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user