mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added type definitions for smartwizard (#37895)
* Added type definitions for smartwizard * Correct package name in the header
This commit is contained in:
parent
296094758a
commit
8590aaecf8
61
types/smartwizard/index.d.ts
vendored
Normal file
61
types/smartwizard/index.d.ts
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
// Type definitions for smartwizard 4.3
|
||||
// Project: https://github.com/techlab/SmartWizard
|
||||
// Definitions by: Stan Kurek <https://github.com/stankurek>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
declare namespace JQuerySmartwizard {
|
||||
type TransitionEffect = 'none' | 'slide' | 'fade';
|
||||
type ToolbarPosition = 'none' | 'top' | 'bottom' | 'both';
|
||||
type ToolbarButtonPosition = 'left' | 'right';
|
||||
|
||||
interface ToolbarSettings {
|
||||
toolbarPosition?: ToolbarPosition;
|
||||
toolbarButtonPosition?: ToolbarButtonPosition;
|
||||
showNextButton?: boolean;
|
||||
showPreviousButton?: boolean;
|
||||
toolbarExtraButtons?: JQuery[];
|
||||
}
|
||||
|
||||
interface AnchorSettings {
|
||||
anchorClickable?: boolean;
|
||||
enableAllAnchors?: boolean;
|
||||
markDoneStep?: boolean;
|
||||
markAllPreviousStepsAsDone?: boolean;
|
||||
removeDoneStepOnNavigateBack?: boolean;
|
||||
enableAnchorOnDoneStep?: boolean;
|
||||
}
|
||||
|
||||
interface Lang {
|
||||
next?: string;
|
||||
previous?: string;
|
||||
}
|
||||
|
||||
interface SmartWizardOptions {
|
||||
selected?: number;
|
||||
keyNavigation?: boolean;
|
||||
autoAdjustHeight?: boolean;
|
||||
cycleSteps?: boolean;
|
||||
backButtonSupport?: boolean;
|
||||
useURLhash?: boolean;
|
||||
showStepURLhash?: boolean;
|
||||
contentURL?: null | string;
|
||||
contentCache?: boolean;
|
||||
ajaxSettings?: JQueryAjaxSettings;
|
||||
disabledSteps?: number[];
|
||||
errorSteps?: number[];
|
||||
hiddenSteps?: number[];
|
||||
theme?: string;
|
||||
transitionEffect?: TransitionEffect;
|
||||
transitionSpeed?: string | number;
|
||||
toolbarSettings?: ToolbarSettings;
|
||||
anchorSettings?: AnchorSettings;
|
||||
lang?: Lang;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
smartWizard(options?: JQuerySmartwizard.SmartWizardOptions): JQuery;
|
||||
}
|
||||
57
types/smartwizard/smartwizard-tests.ts
Normal file
57
types/smartwizard/smartwizard-tests.ts
Normal file
@ -0,0 +1,57 @@
|
||||
import 'jquery';
|
||||
import 'smartwizard';
|
||||
|
||||
$('#smartwizard').smartWizard({
|
||||
selected: 0,
|
||||
keyNavigation: true,
|
||||
autoAdjustHeight: true,
|
||||
cycleSteps: false,
|
||||
backButtonSupport: true,
|
||||
useURLhash: true,
|
||||
showStepURLhash: true,
|
||||
contentURL: null,
|
||||
contentCache: true,
|
||||
ajaxSettings: {
|
||||
async: true,
|
||||
cache: true,
|
||||
timeout: 60000,
|
||||
},
|
||||
disabledSteps: [2],
|
||||
errorSteps: [3, 4],
|
||||
hiddenSteps: [1],
|
||||
theme: 'dots',
|
||||
transitionEffect: 'fade',
|
||||
transitionSpeed: '400',
|
||||
toolbarSettings: {
|
||||
toolbarPosition: 'bottom',
|
||||
toolbarButtonPosition: 'right',
|
||||
showNextButton: true,
|
||||
showPreviousButton: true,
|
||||
toolbarExtraButtons: [
|
||||
$('<button></button>')
|
||||
.text('Finish')
|
||||
.addClass('btn btn-info')
|
||||
.on('click', () => {
|
||||
alert('Finsih button click');
|
||||
}),
|
||||
$('<button></button>')
|
||||
.text('Cancel')
|
||||
.addClass('btn btn-danger')
|
||||
.on('click', () => {
|
||||
alert('Cancel button click');
|
||||
}),
|
||||
],
|
||||
},
|
||||
anchorSettings: {
|
||||
anchorClickable: true,
|
||||
enableAllAnchors: false,
|
||||
markDoneStep: true,
|
||||
markAllPreviousStepsAsDone: true,
|
||||
removeDoneStepOnNavigateBack: false,
|
||||
enableAnchorOnDoneStep: true,
|
||||
},
|
||||
lang: {
|
||||
next: 'Next',
|
||||
previous: 'Previous',
|
||||
},
|
||||
});
|
||||
24
types/smartwizard/tsconfig.json
Normal file
24
types/smartwizard/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"smartwizard-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/smartwizard/tslint.json
Normal file
1
types/smartwizard/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user