From 4fe2667ed5c4c712db45e9ef1a72e8edb88526b6 Mon Sep 17 00:00:00 2001 From: Cyril Schumacher Date: Fri, 16 Jan 2015 14:00:57 +0100 Subject: [PATCH] Add definition for "Twitter Bootstrap Wizard Plugin". Add for parameters file for TypeScript compiler. --- deployJava/deployJava-tests.ts | 136 +++++++------- deployJava/deployJava-tests.ts.tscparams | 1 + .../twitter-bootstrap-wizard-plugin-test.ts | 29 +++ .../twitter-bootstrap-wizard-plugin.d.ts | 175 ++++++++++++++++++ ...witter-bootstrap-wizard-plugin.ts.tscparam | 1 + 5 files changed, 274 insertions(+), 68 deletions(-) create mode 100644 deployJava/deployJava-tests.ts.tscparams create mode 100644 twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin-test.ts create mode 100644 twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.d.ts create mode 100644 twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.ts.tscparam diff --git a/deployJava/deployJava-tests.ts b/deployJava/deployJava-tests.ts index cb0d16accb..3e4c491d87 100644 --- a/deployJava/deployJava-tests.ts +++ b/deployJava/deployJava-tests.ts @@ -1,16 +1,16 @@ /// /** - * @summary Asserts for the method: "allowPlugin". + * @summary Test for the method: "allowPlugin". */ -function assertAllowPlugin() { +function testAllowPlugin() { var result: boolean = deployJava.allowPlugin(); } /** - * @summary Asserts for the method: "compareVersions". + * @summary Test for the method: "compareVersions". */ -function assertCompareVersions() { +function testCompareVersions() { var installed = '1.8'; var required = '1.7'; @@ -18,9 +18,9 @@ function assertCompareVersions() { } /** - * @summary Asserts for the method: "compareVersionToPattern". + * @summary Test for the method: "compareVersionToPattern". */ -function assertCompareVersionToPattern() { +function testCompareVersionToPattern() { var version: string = '1.8'; var patternArray: Array = ['1.6', '1.7', '1.8']; var familyMatch: boolean = false; @@ -30,150 +30,150 @@ function assertCompareVersionToPattern() { } /** - * @summary Asserts for the method: "enableAlerts". + * @summary Test for the method: "enableAlerts". */ -function assertEnableAlerts() { +function testEnableAlerts() { deployJava.enableAlerts(); } /** - * @summary Asserts for the method: "FFInstall". + * @summary Test for the method: "FFInstall". */ -function assertFFInstall() { +function testFFInstall() { var result: boolean = deployJava.FFInstall(); } /** - * @summary Asserts for the method: "getBrowser". + * @summary Test for the method: "getBrowser". */ -function assertGetBrowser() { +function testGetBrowser() { var result: string = deployJava.getBrowser(); } /** - * @summary Asserts for the method: "getJPIVersionUsingMimeType". + * @summary Test for the method: "getJPIVersionUsingMimeType". */ -function assertGetJPIVersionUsingMimeType() { +function testGetJPIVersionUsingMimeType() { deployJava.getJPIVersionUsingMimeType(); } /** - * @summary Asserts for the method: "getJREs". + * @summary Test for the method: "getJREs". */ -function assertGetJREs() { +function testGetJREs() { var versions: Array = deployJava.getJREs(); } /** - * @summary Asserts for the method: "getPlugin". + * @summary Test for the method: "getPlugin". */ -function assertGetPlugin() { +function testGetPlugin() { var versions: HTMLElement = deployJava.getPlugin(); } /** - * @summary Asserts for the method: "IEInstall". + * @summary Test for the method: "IEInstall". */ -function assertIEInstall() { +function testIEInstall() { var result: boolean = deployJava.IEInstall(); } /** - * @summary Asserts for the method: "installJRE". + * @summary Test for the method: "installJRE". */ -function assertInstallJRE() { +function testInstallJRE() { var requestVersion: string = '1.8'; var result: boolean = deployJava.installJRE(requestVersion); } /** - * @summary Asserts for the method: "installLatestJRE". + * @summary Test for the method: "installLatestJRE". */ -function assertInstallLatestJRE() { +function testInstallLatestJRE() { var installCallback: Function = () => {}; var result: boolean = deployJava.installLatestJRE(installCallback); } /** - * @summary Asserts for the method: "isAutoInstallEnabled". + * @summary Test for the method: "isAutoInstallEnabled". */ -function assertIsAutoInstallEnabled() { +function testIsAutoInstallEnabled() { var requestedJREVersion: string = '1.8'; var result: boolean = deployJava.isAutoInstallEnabled(); var result: boolean = deployJava.isAutoInstallEnabled(requestedJREVersion); } /** - * @summary Asserts for the method: "isAutoUpdateEnabled". + * @summary Test for the method: "isAutoUpdateEnabled". */ -function assertIsAutoUpdateEnabled() { +function testIsAutoUpdateEnabled() { var result: boolean = deployJava.isAutoUpdateEnabled(); } /** - * @summary Asserts for the method: "isCallbackSupported". + * @summary Test for the method: "isCallbackSupported". */ -function assertIsCallbackSupported() { +function testIsCallbackSupported() { var result: boolean = deployJava.isCallbackSupported(); } /** - * @summary Asserts for the method: "isPlugin2". + * @summary Test for the method: "isPlugin2". */ -function assertIsPlugin2() { +function testIsPlugin2() { var result: boolean = deployJava.isPlugin2(); } /** - * @summary Asserts for the method: "isPluginInstalled". + * @summary Test for the method: "isPluginInstalled". */ -function assertIsPluginInstalled() { +function testIsPluginInstalled() { var result: boolean = deployJava.isPluginInstalled(); } /** - * @summary Asserts for the method: "isWebStartInstalled". + * @summary Test for the method: "isWebStartInstalled". */ -function assertIsWebStartInstalled() { +function testIsWebStartInstalled() { var minimumVersion: string = '1.7'; var result: boolean = deployJava.isWebStartInstalled(); var result: boolean = deployJava.isWebStartInstalled(minimumVersion); } /** - * @summary Asserts for the method: "launch". + * @summary Test for the method: "launch". */ -function assertLaunch() { +function testLaunch() { var jnlp: string = 'http://www.example.com/'; var result: boolean = deployJava.launch(jnlp); } /** - * @summary Asserts for the method: "launchWebStartApplication". + * @summary Test for the method: "launchWebStartApplication". */ -function assertLaunchWebStartApplication() { +function testLaunchWebStartApplication() { var jnlp: string = 'http://www.example.com/'; deployJava.launchWebStartApplication(jnlp); } /** - * @summary Asserts for the method: "poll". + * @summary Test for the method: "poll". */ -function assertPool() { +function testPool() { deployJava.poll(); } /** - * @summary Asserts for the method: "refresh". + * @summary Test for the method: "refresh". */ -function assertRefresh() { +function testRefresh() { deployJava.refresh(); } /** - * @summary Asserts for the method: "runApplet". + * @summary Test for the method: "runApplet". */ -function assertRunApplet() { +function testRunApplet() { var attributes: Object = { code:'java2d.Java2DemoApplet.class', archive:'Java2Demo.jar', @@ -189,78 +189,78 @@ function assertRunApplet() { } /** - * @summary Asserts for the method: "setAdditionalPackages". + * @summary Test for the method: "setAdditionalPackages". */ -function assertSetAdditionalPackages() { +function testSetAdditionalPackages() { var packageList: string = 'javax.swing'; var result: boolean = deployJava.setAdditionalPackages(packageList); } /** - * @summary Asserts for the method: "setAutoUpdateEnabled". + * @summary Test for the method: "setAutoUpdateEnabled". */ -function assertSetAutoUpdateEnabled() { +function testSetAutoUpdateEnabled() { deployJava.setAutoUpdateEnabled(); } /** - * @summary Asserts for the method: "setEarlyAccess". + * @summary Test for the method: "setEarlyAccess". */ -function assertSetEarlyAccess() { +function testSetEarlyAccess() { var enabled: string = 'true'; deployJava.setEarlyAccess(enabled); } /** - * @summary Asserts for the method: "setInstallerType". + * @summary Test for the method: "setInstallerType". */ -function assertSetInstallerType() { +function testSetInstallerType() { var type: string = 'kernel'; deployJava.setInstallerType(type); } /** - * @summary Asserts for the method: "testForMSVM". + * @summary Test for the method: "testForMSVM". */ -function assertTestForMSVM() { +function testTestForMSVM() { var result: boolean = deployJava.testForMSVM(); } /** - * @summary Asserts for the method: "testUsingActiveX". + * @summary Test for the method: "testUsingActiveX". */ -function assertTestUsingActiveX() { +function testTestUsingActiveX() { var version: string = '1.7.0'; var result: boolean = deployJava.testUsingActiveX(version); } /** - * @summary Asserts for the method: "testUsingMimeTypes". + * @summary Test for the method: "testUsingMimeTypes". */ -function assertTestUsingMimeTypes() { +function testTestUsingMimeTypes() { var version: string = '1.7.0'; var result: boolean = deployJava.testUsingMimeTypes(version); } /** - * @summary Asserts for the method: "testUsingPluginsArray". + * @summary Test for the method: "testUsingPluginsArray". */ -function assertTestUsingPluginsArray() { +function testTestUsingPluginsArray() { var version: string = '1.7.0'; var result: boolean = deployJava.testUsingPluginsArray(version); } /** - * @summary Asserts for the method: "versionCheck". + * @summary Test for the method: "versionCheck". */ -function assertVersionCheck() { +function testVersionCheck() { deployJava.versionCheck('1.x'); } /** - * @summary Asserts for the method: "writeAppletTag". + * @summary Test for the method: "writeAppletTag". */ -function assertWriteAppletTag() { +function testWriteAppletTag() { var attributes: Object = { code:'java2d.Java2DemoApplet.class', archive:'Java2Demo.jar', @@ -273,8 +273,8 @@ function assertWriteAppletTag() { } /** - * @summary Asserts for the method: "writeEmbedTag". + * @summary Test for the method: "writeEmbedTag". */ -function assertWriteEmbedTag() { +function testWriteEmbedTag() { deployJava.writeEmbedTag(); } \ No newline at end of file diff --git a/deployJava/deployJava-tests.ts.tscparams b/deployJava/deployJava-tests.ts.tscparams new file mode 100644 index 0000000000..934bc29ef2 --- /dev/null +++ b/deployJava/deployJava-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny \ No newline at end of file diff --git a/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin-test.ts b/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin-test.ts new file mode 100644 index 0000000000..1fe881ee41 --- /dev/null +++ b/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin-test.ts @@ -0,0 +1,29 @@ +/// +/// + +var rootwizard: JQuery = $('#rootwizard'); + +/** + * @summary Test for basic usage. + */ +function testBasicUsage() { + rootwizard.bootstrapWizard(); +} + +/** + * @summary Test for basic pills usage. + */ +function testOptions() { + var options: TwitterBootstrapWizard = {'tabClass': 'nav nav-pills', 'backSelector': 'back'}; + rootwizard.bootstrapWizard(options); +} + +/** + * @summary Test for event. + */ +function testEvent() { + var onTabShowEvent: TwitterBootstrapWizardEvent = (activeTab: JQuery, navigation: JQuery, index: number) => {} + + var options: TwitterBootstrapWizard = {onTabShow: onTabShowEvent}; + rootwizard.bootstrapWizard(options); +} \ No newline at end of file diff --git a/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.d.ts b/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.d.ts new file mode 100644 index 0000000000..1651b24a12 --- /dev/null +++ b/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.d.ts @@ -0,0 +1,175 @@ +// Type definitions for Twitter Bootstrap Wizard Plugin. +// Project: https://github.com/VinceG/twitter-bootstrap-wizard +// Definitions by: Cyril Schumacher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * @summary Interface for event. + * @author Cyril Schumacher + * @version 1.0 + */ +interface TwitterBootstrapWizardEvent extends Function { + ( + /** + * @summary Active tab. + * @type {jQuery} + */ + activeTab: JQuery, + + /** + * @summary Navigation. + * @type {jQuery} + */ + navigation: JQuery, + + /** + * @summary Index. + * @type {number} + */ + index: number + ): void; +} + +/** + * @summary Interface for events. + * @author Cyril Schumacher + * @version 1.0 + */ +interface TwitterBootstrapWizardEvents { + /** + * @summary Fired when back button is clicked (return false to disable moving backwards in navigation history). + * @type {TwitterBootstrapWizardEvent} + */ + onBack?: TwitterBootstrapWizardEvent; + + /** + * @summary Fired when finish button is clicked (return value is irrelevant). + * @type {TwitterBootstrapWizardEvent} + */ + onFinish?: TwitterBootstrapWizardEvent; + + /** + * @summary Fired when first button is clicked (return false to disable moving to the first step). + * @type {TwitterBootstrapWizardEvent} + */ + onFirst?: TwitterBootstrapWizardEvent; + + /** + * @summary Fired when last button is clicked (return false to disable moving to the last step). + * @type {TwitterBootstrapWizardEvent} + */ + onLast?: TwitterBootstrapWizardEvent; + + /** + * @summary Fired when plugin is initialized. + * @type {TwitterBootstrapWizardEvent} + */ + onInit?: TwitterBootstrapWizardEvent; + + /** + * @summary Fired when next button is clicked (return false to disable moving to the next step). + * @type {TwitterBootstrapWizardEvent} + */ + onNext?: TwitterBootstrapWizardEvent; + + /** + * @summary Fired when previous button is clicked (return false to disable moving to the previous step). + * @type {TwitterBootstrapWizardEvent} + */ + onPrevious?: TwitterBootstrapWizardEvent; + + /** + * @summary Fired when plugin data is shown. + * @type {TwitterBootstrapWizardEvent} + */ + onShow?: TwitterBootstrapWizardEvent; + + /** + * @summary Fired when a tab is changed (return false to disable moving to that tab and showing its contents). + * @type {TwitterBootstrapWizardEvent} + */ + onTabChange?: TwitterBootstrapWizardEvent; + + /** + * @summary Fired when a tab is clicked (return false to disable moving to that tab and showing its contents). + * @type {TwitterBootstrapWizardEvent} + */ + onTabClick?: TwitterBootstrapWizardEvent; + + /** + * @summary Fired when a tab content is shown (return false to disable showing that tab content). + * @type {TwitterBootstrapWizardEvent} + */ + onTabShow?: TwitterBootstrapWizardEvent; +} + +/** + * @summary Interface for options. + * @author Cyril Schumacher + * @version 1.0 + */ +interface TwitterBootstrapWizardOptions { + + /** + * @summary Back element selector. + * @type {string} + */ + backSelector?: string; + + /** + * @summary Finish element selector. + * @type {string} + */ + finishSelector?: string; + + /** + * @summary First element selector. + * @type {string} + */ + firstSelector?: string; + + /** + * @summary Last element selector. + * @type {string} + */ + lastSelector?: string; + + /** + * @summary Next element selector. + * @type {string} + */ + nextSelector?: string; + + /** + * @summary Previous element selector. + * @type {string} + */ + previousSelector?: string; + + /** + * @summary Navigation class. + */ + tabClass?: string; +} + +/** + * @summary Interface for options. + * @author Cyril Schumacher + * @version 1.0 + */ +interface TwitterBootstrapWizard extends TwitterBootstrapWizardOptions, TwitterBootstrapWizardEvents { + // to leave empty: it contains the other two interfaces: "TwitterBootstrapWizardOptions" and "TwitterBootstrapWizardEvents". +} + +/** + * @summary JQuery interface. + * @author Cyril Schumacher + * @version 1.0 + */ +interface JQuery { + /** + * Configure wizard. + * @param {ITwitterBootstrapWizardOptions} options Options. + */ + bootstrapWizard(options?: TwitterBootstrapWizard): void; +} \ No newline at end of file diff --git a/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.ts.tscparam b/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.ts.tscparam new file mode 100644 index 0000000000..934bc29ef2 --- /dev/null +++ b/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.ts.tscparam @@ -0,0 +1 @@ +--noImplicitAny \ No newline at end of file