mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Move all packages to a types directory
This commit is contained in:
57
types/java-applet/index.d.ts
vendored
Normal file
57
types/java-applet/index.d.ts
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
// Type definitions for Java Applet
|
||||
// Project: https://www.java.com/
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* @summary Java applet Status. More details: {@link http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/applet_dev_guide.html#JSDPG719|Applet Status And Event Handlers}
|
||||
* @enum {number}
|
||||
* @readonly
|
||||
*/
|
||||
declare enum JavaAppletStatus {
|
||||
/**
|
||||
* @summary Applet is loading.
|
||||
*/
|
||||
Loading = 1,
|
||||
|
||||
/**
|
||||
* @summary Applet has loaded completely and is ready to receive JavaScript calls.
|
||||
*/
|
||||
Ready = 2,
|
||||
|
||||
/**
|
||||
* @summary Error while loading applet.
|
||||
*/
|
||||
Error = 3
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Interface for Java applet object.
|
||||
* @author Cyril Schumacher
|
||||
* @version 1.0
|
||||
*/
|
||||
interface JavaApplet extends HTMLAppletElement {
|
||||
/**
|
||||
* @summary Handler if the applet status is {@link JavaAppletStatus#Error}. An error has occurred while loading the applet.
|
||||
* @type {Function}
|
||||
*/
|
||||
onError?: Function;
|
||||
|
||||
/**
|
||||
* @summary Handler if the applet status is {@link JavaAppletStatus#Ready}. Applet has finished loading and is ready to receive JavaScript calls.
|
||||
* @type {Function}
|
||||
*/
|
||||
onLoad?: Function;
|
||||
|
||||
/**
|
||||
* @summary Handler if the applet has stopped.
|
||||
* @type {Function}
|
||||
*/
|
||||
onStop?: Function;
|
||||
|
||||
/**
|
||||
* @summary Java applet Status.
|
||||
* @type {JavaAppletStatus}
|
||||
*/
|
||||
status?: JavaAppletStatus;
|
||||
}
|
||||
29
types/java-applet/java-applet-tests.ts
Normal file
29
types/java-applet/java-applet-tests.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
/**
|
||||
* @summary Test for the typage.
|
||||
*/
|
||||
function testTypage() {
|
||||
var applet: HTMLAppletElement = <HTMLAppletElement>document.getElementById('applet');
|
||||
var javaApplet: JavaApplet = applet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the java applet status.
|
||||
*/
|
||||
function testStatus() {
|
||||
var applet: JavaApplet = <JavaApplet>document.getElementById('applet');
|
||||
var status: number = applet.status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the handlers.
|
||||
*/
|
||||
function testHandlers() {
|
||||
var applet: JavaApplet = <JavaApplet>document.getElementById('applet');
|
||||
|
||||
var handler: Function = () => {};
|
||||
applet.onError = handler;
|
||||
applet.onLoad = handler;
|
||||
applet.onStop = handler;
|
||||
}
|
||||
23
types/java-applet/tsconfig.json
Normal file
23
types/java-applet/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",
|
||||
"java-applet-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user