mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-03-31 10:44:33 +00:00
Move all packages to a types directory
This commit is contained in:
280
types/deployjava/deployjava-tests.ts
Normal file
280
types/deployjava/deployjava-tests.ts
Normal file
@@ -0,0 +1,280 @@
|
||||
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "allowPlugin".
|
||||
*/
|
||||
function testAllowPlugin() {
|
||||
var result: boolean = deployJava.allowPlugin();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "compareVersions".
|
||||
*/
|
||||
function testCompareVersions() {
|
||||
var installed = '1.8';
|
||||
var required = '1.7';
|
||||
|
||||
var result = deployJava.compareVersions(installed, required);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "compareVersionToPattern".
|
||||
*/
|
||||
function testCompareVersionToPattern() {
|
||||
var version: string = '1.8';
|
||||
var patternArray: Array<string> = ['1.6', '1.7', '1.8'];
|
||||
var familyMatch: boolean = false;
|
||||
var minMatch: boolean = true;
|
||||
|
||||
var result = deployJava.compareVersionToPattern(version, patternArray, familyMatch, minMatch);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "enableAlerts".
|
||||
*/
|
||||
function testEnableAlerts() {
|
||||
deployJava.enableAlerts();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "FFInstall".
|
||||
*/
|
||||
function testFFInstall() {
|
||||
var result: boolean = deployJava.FFInstall();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "getBrowser".
|
||||
*/
|
||||
function testGetBrowser() {
|
||||
var result: string = deployJava.getBrowser();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "getJPIVersionUsingMimeType".
|
||||
*/
|
||||
function testGetJPIVersionUsingMimeType() {
|
||||
deployJava.getJPIVersionUsingMimeType();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "getJREs".
|
||||
*/
|
||||
function testGetJREs() {
|
||||
var versions: Array<String> = deployJava.getJREs();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "getPlugin".
|
||||
*/
|
||||
function testGetPlugin() {
|
||||
var versions: HTMLElement = deployJava.getPlugin();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "IEInstall".
|
||||
*/
|
||||
function testIEInstall() {
|
||||
var result: boolean = deployJava.IEInstall();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "installJRE".
|
||||
*/
|
||||
function testInstallJRE() {
|
||||
var requestVersion: string = '1.8';
|
||||
var result: boolean = deployJava.installJRE(requestVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "installLatestJRE".
|
||||
*/
|
||||
function testInstallLatestJRE() {
|
||||
var installCallback: Function = () => {};
|
||||
var result: boolean = deployJava.installLatestJRE(installCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "isAutoInstallEnabled".
|
||||
*/
|
||||
function testIsAutoInstallEnabled() {
|
||||
var requestedJREVersion: string = '1.8';
|
||||
var result: boolean = deployJava.isAutoInstallEnabled();
|
||||
var result: boolean = deployJava.isAutoInstallEnabled(requestedJREVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "isAutoUpdateEnabled".
|
||||
*/
|
||||
function testIsAutoUpdateEnabled() {
|
||||
var result: boolean = deployJava.isAutoUpdateEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "isCallbackSupported".
|
||||
*/
|
||||
function testIsCallbackSupported() {
|
||||
var result: boolean = deployJava.isCallbackSupported();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "isPlugin2".
|
||||
*/
|
||||
function testIsPlugin2() {
|
||||
var result: boolean = deployJava.isPlugin2();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "isPluginInstalled".
|
||||
*/
|
||||
function testIsPluginInstalled() {
|
||||
var result: boolean = deployJava.isPluginInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "isWebStartInstalled".
|
||||
*/
|
||||
function testIsWebStartInstalled() {
|
||||
var minimumVersion: string = '1.7';
|
||||
var result: boolean = deployJava.isWebStartInstalled();
|
||||
var result: boolean = deployJava.isWebStartInstalled(minimumVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "launch".
|
||||
*/
|
||||
function testLaunch() {
|
||||
var jnlp: string = 'http://www.example.com/';
|
||||
var result: boolean = deployJava.launch(jnlp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "launchWebStartApplication".
|
||||
*/
|
||||
function testLaunchWebStartApplication() {
|
||||
var jnlp: string = 'http://www.example.com/';
|
||||
deployJava.launchWebStartApplication(jnlp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "poll".
|
||||
*/
|
||||
function testPool() {
|
||||
deployJava.poll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "refresh".
|
||||
*/
|
||||
function testRefresh() {
|
||||
deployJava.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "runApplet".
|
||||
*/
|
||||
function testRunApplet() {
|
||||
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 Test for the method: "setAdditionalPackages".
|
||||
*/
|
||||
function testSetAdditionalPackages() {
|
||||
var packageList: string = 'javax.swing';
|
||||
var result: boolean = deployJava.setAdditionalPackages(packageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "setAutoUpdateEnabled".
|
||||
*/
|
||||
function testSetAutoUpdateEnabled() {
|
||||
deployJava.setAutoUpdateEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "setEarlyAccess".
|
||||
*/
|
||||
function testSetEarlyAccess() {
|
||||
var enabled: string = 'true';
|
||||
deployJava.setEarlyAccess(enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "setInstallerType".
|
||||
*/
|
||||
function testSetInstallerType() {
|
||||
var type: string = 'kernel';
|
||||
deployJava.setInstallerType(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "testForMSVM".
|
||||
*/
|
||||
function testTestForMSVM() {
|
||||
var result: boolean = deployJava.testForMSVM();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "testUsingActiveX".
|
||||
*/
|
||||
function testTestUsingActiveX() {
|
||||
var version: string = '1.7.0';
|
||||
var result: boolean = deployJava.testUsingActiveX(version);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "testUsingMimeTypes".
|
||||
*/
|
||||
function testTestUsingMimeTypes() {
|
||||
var version: string = '1.7.0';
|
||||
var result: boolean = deployJava.testUsingMimeTypes(version);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "testUsingPluginsArray".
|
||||
*/
|
||||
function testTestUsingPluginsArray() {
|
||||
var version: string = '1.7.0';
|
||||
var result: boolean = deployJava.testUsingPluginsArray(version);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "versionCheck".
|
||||
*/
|
||||
function testVersionCheck() {
|
||||
deployJava.versionCheck('1.x');
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the method: "writeAppletTag".
|
||||
*/
|
||||
function testWriteAppletTag() {
|
||||
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 Test for the method: "writeEmbedTag".
|
||||
*/
|
||||
function testWriteEmbedTag() {
|
||||
deployJava.writeEmbedTag();
|
||||
}
|
||||
315
types/deployjava/index.d.ts
vendored
Normal file
315
types/deployjava/index.d.ts
vendored
Normal file
@@ -0,0 +1,315 @@
|
||||
// Type definitions for deployJava.js
|
||||
// Project: https://www.java.com/js/deployJava.txt
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace 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<string>}
|
||||
*/
|
||||
preInstallJREList: Array<string>;
|
||||
|
||||
/**
|
||||
* @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<string>} 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<string>, 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<string>} JRE Version list.
|
||||
*/
|
||||
getJREs(): Array<string>;
|
||||
|
||||
/**
|
||||
* 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 <applet> tag.
|
||||
* @param {Object} parameters Names and values of the <param> tags in the generated <applet> 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 <PARAM> 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 <applet> tag.
|
||||
* @param {Object} parameters Names and values of the <param> tags in the generated <applet> tag.
|
||||
*/
|
||||
writeAppletTag(attributes: Object, parameters: Object): void;
|
||||
|
||||
/**
|
||||
* @summary Write in outputs an embed tag for applet.
|
||||
*/
|
||||
writeEmbedTag(): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare var deployJava: DeployJava.DeployJavaStatic;
|
||||
23
types/deployjava/tsconfig.json
Normal file
23
types/deployjava/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"deployjava-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user