From 24d312ae3d5bd666ccf13f861f1ff9b5e16133e6 Mon Sep 17 00:00:00 2001 From: Cyril Schumacher Date: Fri, 16 Jan 2015 11:47:17 +0100 Subject: [PATCH 1/8] Add definition for "deployJava". --- deployJava/deployJava-tests.ts | 280 +++++++++++++++++++++++++++++ deployJava/deployJava.d.ts | 315 +++++++++++++++++++++++++++++++++ 2 files changed, 595 insertions(+) create mode 100644 deployJava/deployJava-tests.ts create mode 100644 deployJava/deployJava.d.ts diff --git a/deployJava/deployJava-tests.ts b/deployJava/deployJava-tests.ts new file mode 100644 index 000000000..cb0d16acc --- /dev/null +++ b/deployJava/deployJava-tests.ts @@ -0,0 +1,280 @@ +/// + +/** + * @summary Asserts for the method: "allowPlugin". + */ +function assertAllowPlugin() { + var result: boolean = deployJava.allowPlugin(); +} + +/** + * @summary Asserts for the method: "compareVersions". + */ +function assertCompareVersions() { + var installed = '1.8'; + var required = '1.7'; + + var result = deployJava.compareVersions(installed, required); +} + +/** + * @summary Asserts for the method: "compareVersionToPattern". + */ +function assertCompareVersionToPattern() { + var version: string = '1.8'; + var patternArray: Array = ['1.6', '1.7', '1.8']; + var familyMatch: boolean = false; + var minMatch: boolean = true; + + var result = deployJava.compareVersionToPattern(version, patternArray, familyMatch, minMatch); +} + +/** + * @summary Asserts for the method: "enableAlerts". + */ +function assertEnableAlerts() { + deployJava.enableAlerts(); +} + +/** + * @summary Asserts for the method: "FFInstall". + */ +function assertFFInstall() { + var result: boolean = deployJava.FFInstall(); +} + +/** + * @summary Asserts for the method: "getBrowser". + */ +function assertGetBrowser() { + var result: string = deployJava.getBrowser(); +} + +/** + * @summary Asserts for the method: "getJPIVersionUsingMimeType". + */ +function assertGetJPIVersionUsingMimeType() { + deployJava.getJPIVersionUsingMimeType(); +} + +/** + * @summary Asserts for the method: "getJREs". + */ +function assertGetJREs() { + var versions: Array = deployJava.getJREs(); +} + +/** + * @summary Asserts for the method: "getPlugin". + */ +function assertGetPlugin() { + var versions: HTMLElement = deployJava.getPlugin(); +} + +/** + * @summary Asserts for the method: "IEInstall". + */ +function assertIEInstall() { + var result: boolean = deployJava.IEInstall(); +} + +/** + * @summary Asserts for the method: "installJRE". + */ +function assertInstallJRE() { + var requestVersion: string = '1.8'; + var result: boolean = deployJava.installJRE(requestVersion); +} + +/** + * @summary Asserts for the method: "installLatestJRE". + */ +function assertInstallLatestJRE() { + var installCallback: Function = () => {}; + var result: boolean = deployJava.installLatestJRE(installCallback); +} + +/** + * @summary Asserts for the method: "isAutoInstallEnabled". + */ +function assertIsAutoInstallEnabled() { + var requestedJREVersion: string = '1.8'; + var result: boolean = deployJava.isAutoInstallEnabled(); + var result: boolean = deployJava.isAutoInstallEnabled(requestedJREVersion); +} + +/** + * @summary Asserts for the method: "isAutoUpdateEnabled". + */ +function assertIsAutoUpdateEnabled() { + var result: boolean = deployJava.isAutoUpdateEnabled(); +} + +/** + * @summary Asserts for the method: "isCallbackSupported". + */ +function assertIsCallbackSupported() { + var result: boolean = deployJava.isCallbackSupported(); +} + +/** + * @summary Asserts for the method: "isPlugin2". + */ +function assertIsPlugin2() { + var result: boolean = deployJava.isPlugin2(); +} + +/** + * @summary Asserts for the method: "isPluginInstalled". + */ +function assertIsPluginInstalled() { + var result: boolean = deployJava.isPluginInstalled(); +} + +/** + * @summary Asserts for the method: "isWebStartInstalled". + */ +function assertIsWebStartInstalled() { + var minimumVersion: string = '1.7'; + var result: boolean = deployJava.isWebStartInstalled(); + var result: boolean = deployJava.isWebStartInstalled(minimumVersion); +} + +/** + * @summary Asserts for the method: "launch". + */ +function assertLaunch() { + var jnlp: string = 'http://www.example.com/'; + var result: boolean = deployJava.launch(jnlp); +} + +/** + * @summary Asserts for the method: "launchWebStartApplication". + */ +function assertLaunchWebStartApplication() { + var jnlp: string = 'http://www.example.com/'; + deployJava.launchWebStartApplication(jnlp); +} + +/** + * @summary Asserts for the method: "poll". + */ +function assertPool() { + deployJava.poll(); +} + +/** + * @summary Asserts for the method: "refresh". + */ +function assertRefresh() { + deployJava.refresh(); +} + +/** + * @summary Asserts for the method: "runApplet". + */ +function assertRunApplet() { + var attributes: Object = { + code:'java2d.Java2DemoApplet.class', + archive:'Java2Demo.jar', + width:710, + height:540 + }; + + var parameters: Object = { fontSize:16, permissions:'sandbox' }; + var version: string = '1.8'; + + deployJava.runApplet(attributes, parameters); + deployJava.runApplet(attributes, parameters, version); +} + +/** + * @summary Asserts for the method: "setAdditionalPackages". + */ +function assertSetAdditionalPackages() { + var packageList: string = 'javax.swing'; + var result: boolean = deployJava.setAdditionalPackages(packageList); +} + +/** + * @summary Asserts for the method: "setAutoUpdateEnabled". + */ +function assertSetAutoUpdateEnabled() { + deployJava.setAutoUpdateEnabled(); +} + +/** + * @summary Asserts for the method: "setEarlyAccess". + */ +function assertSetEarlyAccess() { + var enabled: string = 'true'; + deployJava.setEarlyAccess(enabled); +} + +/** + * @summary Asserts for the method: "setInstallerType". + */ +function assertSetInstallerType() { + var type: string = 'kernel'; + deployJava.setInstallerType(type); +} + +/** + * @summary Asserts for the method: "testForMSVM". + */ +function assertTestForMSVM() { + var result: boolean = deployJava.testForMSVM(); +} + +/** + * @summary Asserts for the method: "testUsingActiveX". + */ +function assertTestUsingActiveX() { + var version: string = '1.7.0'; + var result: boolean = deployJava.testUsingActiveX(version); +} + +/** + * @summary Asserts for the method: "testUsingMimeTypes". + */ +function assertTestUsingMimeTypes() { + var version: string = '1.7.0'; + var result: boolean = deployJava.testUsingMimeTypes(version); +} + +/** + * @summary Asserts for the method: "testUsingPluginsArray". + */ +function assertTestUsingPluginsArray() { + var version: string = '1.7.0'; + var result: boolean = deployJava.testUsingPluginsArray(version); +} + +/** + * @summary Asserts for the method: "versionCheck". + */ +function assertVersionCheck() { + deployJava.versionCheck('1.x'); +} + +/** + * @summary Asserts for the method: "writeAppletTag". + */ +function assertWriteAppletTag() { + var attributes: Object = { + code:'java2d.Java2DemoApplet.class', + archive:'Java2Demo.jar', + width:710, + height:540 + }; + + var parameters: Object = { fontSize:16, permissions:'sandbox' }; + deployJava.writeAppletTag(attributes, parameters); +} + +/** + * @summary Asserts for the method: "writeEmbedTag". + */ +function assertWriteEmbedTag() { + deployJava.writeEmbedTag(); +} \ No newline at end of file diff --git a/deployJava/deployJava.d.ts b/deployJava/deployJava.d.ts new file mode 100644 index 000000000..76ff5d8cd --- /dev/null +++ b/deployJava/deployJava.d.ts @@ -0,0 +1,315 @@ +// Type definitions for deployJava.js +// Project: https://www.java.com/js/deployJava.txt +// Definitions by: Cyril Schumacher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module DeployJava { + /** + * @summary Interface for {@link deployJava} object. + * @author Cyril Schumacher + * @version 1.0 + */ + interface DeployJavaStatic { + /** + * @summary Brand name. + * @member {string} + */ + brand: string; + + /** + * @summary Debug mode. + * @member {boolean} + */ + debug: boolean; + + /** + * @summary Early Access state. + * @member {string} + */ + EAInstallEnabled: boolean; + + /** + * @summary URL to early access. + * @member {string} + */ + EarlyAccessURL: string; + + /** + * @summary Preferred install type (null, online, kernel). + * @member {string} + */ + installType: string; + + /** + * @summary Locale. + * @member {string} + */ + locale: string; + + /** + * @summary Interval for check versions of JRE available. + * @member {number} + */ + myInterval: number; + + /** + * @summary JRE versions installed. + * @member {Array} + */ + preInstallJREList: Array; + + /** + * @summary URL of current document. + * @member {string} + */ + returnPage: string; + + /** + * @summary Determines if the browser has allowed the Java plugin. + * @return {boolean} True if the Java plugin is allowed, otherwise, False. + */ + allowPlugin(): boolean; + + /** + * @summary Compares a installed version and required version. + * @param {string} installed JRE installed version. + * @param {string} required JRE required version. + * @return {boolean} True if installed version is greater than or equal to required version. + */ + compareVersions(installed: string, required: string): boolean; + + /** + * @summary Compares a version with a pattern. + * @param {string} version Version to compare. + * @param {Array} patternArray Patterns to compare. + * @param {boolean} familyMatch Family match. + * @param {boolean} minMatch Minimum version match. + * @return {boolean} True if a or many patterns are identical to version, otherwise, False. + */ + compareVersionToPattern(version: string, patternArray: Array, familyMatch: boolean, minMatch: boolean): boolean; + + /** + * @summary Enable alerts. + */ + enableAlerts(): void; + + /** + * @summary Redirect to Java plugin website for Mozilla Firefox. + * @return {boolean} True if the redirection to Java plugin website was performed, otherwise, False. + */ + FFInstall(): boolean; + + /** + * @summary Gets browser name. + * @return {string} Browser name. + */ + getBrowser(): string; + + /** + * @summary Obtains JPI version using {@link navigator.mimeTypes} array if found, + * set the version to {@link firefoxJavaVersion}. + */ + getJPIVersionUsingMimeType(): void; + + /** + * @summary Get JRE versions (in format : "#.#[.#[_#]]") installed. + * @return {Array} JRE Version list. + */ + getJREs(): Array; + + /** + * Gets a Java plugin. + * @return {HTMLElement} Java plugin. + */ + getPlugin(): HTMLElement; + + /** + * Redirect to Java plugin website for Internet Explorer. + * @return {boolean} True if the redirection to Java plugin website was performed, otherwise, False. + */ + IEInstall(): boolean; + + /** + * @summary Triggers a JRE installation. + * @param {string} requestVersion JRE request version. + * @return {boolean} True if the install is succeeded, otherwise, False. + */ + installJRE(requestVersion: string): boolean; + + /** + * @summary Triggers a installation of the latest version of JRE. + * @param {Function} installCallback A reference to a javascript callback function for reporting install status. + * @return {boolean} True if the install is succeeded, otherwise, False. + */ + installLatestJRE(installCallback?: Function): boolean; + + /** + * @summary Determines if JRE auto install for the version is enabled for the local system. + * + * DT plugin for 6uX only knows about JRE installer signed by SUN cert. + * If it encounter Oracle signed JRE installer, it will have chance of + * deadlock when running with IE. This function is to guard against this. + * + * @param {string} requestedJREVersion JRE version. If not specified, it will be treated as installing any JRE version. + * @return {boolean} True if JRE auto install for the version is enabled for the local system, otherwise, False. + */ + isAutoInstallEnabled(requestedJREVersion?: string): boolean; + + /** + * @summary Determines if the plugin is installed and AutoUpdate is enabled. + * @return {boolean} True if the plugin is installed and AutoUpdate is enabled, otherwise, False. + */ + isAutoUpdateEnabled(): boolean; + + /** + * @summary Determines if JRE install callback is supported. + * @return {boolean} True if JRE install callback is supported, otherwise, False. + */ + isCallbackSupported(): boolean; + + /** + * @summary Determines if the next generation plugin (Plugin II) is default. + * @return {boolean} True if next generation plugin is default, otherwise, False. + */ + isPlugin2(): boolean; + + /** + * @summary Determines if the ActiveX or XPI plugin is installed. + * @return {boolean} True if the ActiveX or XPI plugin is installed, otherwise, False. + */ + isPluginInstalled(): boolean; + + /** + * @summary Checks if an installation of Java Web Start of the specified minimum version can be detected. + * @param {string} minimumVersion Minimum version. + * @return {boolean} True if an installation of Java Web Start of the specified minimum version can be detected + */ + isWebStartInstalled(minimumVersion?: string): boolean; + + /** + * @summary Launch a JNLP application (using the plugin if available). + * @param {string} jnlp JNLP file. + * @return {boolean} True if a JNLP application is launched, otherwise, False. + */ + launch(jnlp: string): boolean; + + /** + * @summary Launch the specified JNLP application using the passed in jnlp file. + * @param {string} jnlp JNLP file. + */ + launchWebStartApplication(jnlp: string): void; + + /** + * @summary Checks versions of JRE available. + */ + poll(): void; + + /** + * @summary Writes embed tags if JRE plugin is available. + */ + refresh(): void; + + /** + * @summary Ensures that an appropriate JRE is installed and then runs an applet. + * + * After installJRE() is called, the script will attempt to detect that the + * JRE installation has completed and begin running the applet, but there + * are circumstances (such as when the JRE installation requires a browser + * restart) when this cannot be fulfilled. + * As with writeAppletTag(), this function should only be called prior to + * the web page being completely rendered. Note that version wildcards + * (star (*) and plus (+)) are not supported, and including them in the + * minimumVersion will result in an error message. + * + * @param {Object} attributes Names and values of the attributes of the generated tag. + * @param {Object} parameters Names and values of the tags in the generated tag. + * @param {string} minimumVersion A minimum version of the JRE software that is required to run this applet. Default value is : "1.1". + */ + runApplet(attributes: Object, parameters: Object, minimumVersion?: string): void; + + /** + * @summary Sets additional package list. + * + * Note: To be used by kernel installer. + * + * @param {string} packageList Package list. + * @return {boolean} True if the value was set, otherwise, False if the plugin is already installed. + */ + setAdditionalPackages(packageList: string): boolean; + + /** + * @summary Sets AutoUpdate on if plugin is installed. + */ + setAutoUpdateEnabled(): void; + + /** + * @summary Sets preference to install Early Access versions if available. + * @param {string} enabled Preference to install Early Access versions. + */ + setEarlyAccess(enabled: string): void; + + /** + * @summary Sets the preferred install type. + * @param {string} type Preferred install (null, online or kernel). + * @return {boolean} True if the value was set, otherwise, False if the plugin is already installed. + */ + setInstallerType(type: string): boolean; + + /** + * @summary Detects the Microsoft virtual machine. + * @return {boolean} True if the Microsoft virtual machine exists, otherwise, False. + */ + testForMSVM(): boolean; + + /** + * @summary Checks if ActiveX can be used with Java plugin. + * @param {string} Java version. + * @return {boolean} True if ActiveX can be used, otherwise, False. + */ + testUsingActiveX(version: string): boolean; + + /** + * @summary Checks if MIME types can be used with Java plugin. + * @param {string} Java version. + * @return {boolean} True if MIME types can be used, otherwise, False. + */ + testUsingMimeTypes(version: string): boolean; + + /** + * @summary Checks if plugins can be used with Java plugin. + * @param {string} Java version. + * @return {boolean} True if plugins can be used, otherwise, False. + */ + testUsingPluginsArray(version: string): boolean; + + /** + * @summary Check if there is a matching JRE version currently installed. + * @param {string} versionPattern Java version pattern (in format : #[.#[.#[_#]]][+|*]). + * @return {boolean} True if there is a matching JRE version currently installed, otherwise, False. + */ + versionCheck(versionPattern: string): boolean; + + /** + * @summary Write in outputs an applet tag for applet with the specified attributes and parameters. + * + * Each key/value pair in attributes becomes an attribute of the applet tag + * itself, while key/value pairs in parameters become tags. + * No version checking or other special behaviors are performed; the tag is + * simply written to the page using document.writeln(). + * As document.writeln() is generally only safe to use while the page is + * being rendered, you should never call this function after the page + * has been completed. + * + * @param {Object} attributes Names and values of the attributes of the generated tag. + * @param {Object} parameters Names and values of the tags in the generated tag. + */ + writeAppletTag(attributes: Object, parameters: Object): void; + + /** + * @summary Write in outputs an embed tag for applet. + */ + writeEmbedTag(): void; + } +} + +declare var deployJava: DeployJava.DeployJavaStatic; \ No newline at end of file From 4fe2667ed5c4c712db45e9ef1a72e8edb88526b6 Mon Sep 17 00:00:00 2001 From: Cyril Schumacher Date: Fri, 16 Jan 2015 14:00:57 +0100 Subject: [PATCH 2/8] 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 cb0d16acc..3e4c491d8 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 000000000..934bc29ef --- /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 000000000..1fe881ee4 --- /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 000000000..1651b24a1 --- /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 000000000..934bc29ef --- /dev/null +++ b/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.ts.tscparam @@ -0,0 +1 @@ +--noImplicitAny \ No newline at end of file From e3f1f8e4914484bea141f78240999bbfbc930ac9 Mon Sep 17 00:00:00 2001 From: Cyril Schumacher Date: Fri, 16 Jan 2015 14:04:51 +0100 Subject: [PATCH 3/8] Update header for "Twitter Bootstrap Wizard Plugin". --- .../twitter-bootstrap-wizard-plugin.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.d.ts b/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.d.ts index 1651b24a1..6d9a51fda 100644 --- a/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.d.ts +++ b/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Twitter Bootstrap Wizard Plugin. +// 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 From 0a484fcb02e58daf221091369ce4d11a4c9291b4 Mon Sep 17 00:00:00 2001 From: Cyril Schumacher Date: Fri, 16 Jan 2015 14:25:53 +0100 Subject: [PATCH 4/8] Add definition for "FileSaver.js" --- fileSaver/fileSaver-tests.ts | 11 +++++++++++ fileSaver/fileSaver-tests.ts.tscparams | 1 + fileSaver/fileSaver.d.ts | 27 ++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 fileSaver/fileSaver-tests.ts create mode 100644 fileSaver/fileSaver-tests.ts.tscparams create mode 100644 fileSaver/fileSaver.d.ts diff --git a/fileSaver/fileSaver-tests.ts b/fileSaver/fileSaver-tests.ts new file mode 100644 index 000000000..65059d772 --- /dev/null +++ b/fileSaver/fileSaver-tests.ts @@ -0,0 +1,11 @@ +/// + +/** + * @summary Test for "saveAs" function. + */ +function testSaveAs() { + var data: Blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); + var filename: string = 'hello world.txt'; + + saveAs(data, filename); +} \ No newline at end of file diff --git a/fileSaver/fileSaver-tests.ts.tscparams b/fileSaver/fileSaver-tests.ts.tscparams new file mode 100644 index 000000000..934bc29ef --- /dev/null +++ b/fileSaver/fileSaver-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny \ No newline at end of file diff --git a/fileSaver/fileSaver.d.ts b/fileSaver/fileSaver.d.ts new file mode 100644 index 000000000..0b6cc75d6 --- /dev/null +++ b/fileSaver/fileSaver.d.ts @@ -0,0 +1,27 @@ +// Type definitions for FileSaver.js +// Project: https://github.com/eligrey/FileSaver.js/ +// Definitions by: Cyril Schumacher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * @summary Interface for "saveAs" function. + * @author Cyril Schumacher + * @version 1.0 + */ +interface FileSaver { + ( + /** + * @summary Data. + * @type {Blob} + */ + data: Blob, + + /** + * @summary File name. + * @type {DOMString} + */ + filename: string + ): void +} + +declare var saveAs: FileSaver; \ No newline at end of file From 503bffdd6a5a363ec08f8c4151c8d7ab0e005641 Mon Sep 17 00:00:00 2001 From: Cyril Schumacher Date: Fri, 16 Jan 2015 15:35:38 +0100 Subject: [PATCH 5/8] Delete "Twitter Bootstrap Wizard Plugin": a definition file already exists. --- .../twitter-bootstrap-wizard-plugin-test.ts | 29 --- .../twitter-bootstrap-wizard-plugin.d.ts | 175 ------------------ ...witter-bootstrap-wizard-plugin.ts.tscparam | 1 - 3 files changed, 205 deletions(-) delete mode 100644 twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin-test.ts delete mode 100644 twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.d.ts delete mode 100644 twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.ts.tscparam diff --git a/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin-test.ts b/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin-test.ts deleted file mode 100644 index 1fe881ee4..000000000 --- a/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin-test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/// -/// - -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 deleted file mode 100644 index 6d9a51fda..000000000 --- a/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.d.ts +++ /dev/null @@ -1,175 +0,0 @@ -// 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 deleted file mode 100644 index 934bc29ef..000000000 --- a/twitter-bootstrap-wizard-plugin/twitter-bootstrap-wizard-plugin.ts.tscparam +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny \ No newline at end of file From 2f0d46a901c8a4daf879035ebe336900c11117da Mon Sep 17 00:00:00 2001 From: cyrilschumacher Date: Sat, 17 Jan 2015 11:15:19 +0100 Subject: [PATCH 6/8] Rename directory: "fileSaver" to "FileSaver". --- {fileSaver => FileSaver}/fileSaver-tests.ts | 0 {fileSaver => FileSaver}/fileSaver-tests.ts.tscparams | 0 {fileSaver => FileSaver}/fileSaver.d.ts | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {fileSaver => FileSaver}/fileSaver-tests.ts (100%) rename {fileSaver => FileSaver}/fileSaver-tests.ts.tscparams (100%) rename {fileSaver => FileSaver}/fileSaver.d.ts (100%) diff --git a/fileSaver/fileSaver-tests.ts b/FileSaver/fileSaver-tests.ts similarity index 100% rename from fileSaver/fileSaver-tests.ts rename to FileSaver/fileSaver-tests.ts diff --git a/fileSaver/fileSaver-tests.ts.tscparams b/FileSaver/fileSaver-tests.ts.tscparams similarity index 100% rename from fileSaver/fileSaver-tests.ts.tscparams rename to FileSaver/fileSaver-tests.ts.tscparams diff --git a/fileSaver/fileSaver.d.ts b/FileSaver/fileSaver.d.ts similarity index 100% rename from fileSaver/fileSaver.d.ts rename to FileSaver/fileSaver.d.ts From 9d25fa00cb092ba01bce58c1796917bd9b490af8 Mon Sep 17 00:00:00 2001 From: cyrilschumacher Date: Sat, 17 Jan 2015 11:22:32 +0100 Subject: [PATCH 7/8] Rename files from "FileSaver". --- FileSaver/{fileSaver-tests.ts => FileSaver-tests.ts} | 0 ...{fileSaver-tests.ts.tscparams => FileSaver-tests.ts.tscparams} | 0 FileSaver/{fileSaver.d.ts => FileSaver.d.ts} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename FileSaver/{fileSaver-tests.ts => FileSaver-tests.ts} (100%) rename FileSaver/{fileSaver-tests.ts.tscparams => FileSaver-tests.ts.tscparams} (100%) rename FileSaver/{fileSaver.d.ts => FileSaver.d.ts} (100%) diff --git a/FileSaver/fileSaver-tests.ts b/FileSaver/FileSaver-tests.ts similarity index 100% rename from FileSaver/fileSaver-tests.ts rename to FileSaver/FileSaver-tests.ts diff --git a/FileSaver/fileSaver-tests.ts.tscparams b/FileSaver/FileSaver-tests.ts.tscparams similarity index 100% rename from FileSaver/fileSaver-tests.ts.tscparams rename to FileSaver/FileSaver-tests.ts.tscparams diff --git a/FileSaver/fileSaver.d.ts b/FileSaver/FileSaver.d.ts similarity index 100% rename from FileSaver/fileSaver.d.ts rename to FileSaver/FileSaver.d.ts From 5ad0d64b2c268179fcc1d002f01458776f4bc631 Mon Sep 17 00:00:00 2001 From: cyrilschumacher Date: Sat, 17 Jan 2015 11:24:08 +0100 Subject: [PATCH 8/8] Update reference. --- FileSaver/FileSaver-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FileSaver/FileSaver-tests.ts b/FileSaver/FileSaver-tests.ts index 65059d772..6a5426a6a 100644 --- a/FileSaver/FileSaver-tests.ts +++ b/FileSaver/FileSaver-tests.ts @@ -1,4 +1,4 @@ -/// +/// /** * @summary Test for "saveAs" function. @@ -8,4 +8,4 @@ function testSaveAs() { var filename: string = 'hello world.txt'; saveAs(data, filename); -} \ No newline at end of file +}