diff --git a/iban/iban.d.ts b/iban/iban.d.ts index b39f5908ce..6a7bd803d3 100644 --- a/iban/iban.d.ts +++ b/iban/iban.d.ts @@ -3,58 +3,56 @@ // Definitions by: Cyril Schumacher // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module ARHS { +/** + * @summary Interface for {@link IBAN} object. + * @author Cyril Schumacher + * @version 1.0 + */ +interface IBANStatic { /** - * @summary Interface for {@link IBAN} object. - * @author Cyril Schumacher - * @version 1.0 + * @summary Returns the IBAN in a electronic format. + * @param {string} iban The IBAN to convert. + * @param {string} The IBAN in electronic format. */ - interface IBANStatic { - /** - * @summary Returns the IBAN in a electronic format. - * @param {string} iban The IBAN to convert. - * @param {string} The IBAN in electronic format. - */ - electronicFormat(iban: string): string; + electronicFormat(iban: string): string; - /** - * @summary Convert the passed BBAN to an IBAN for this country specification. - * @param {string} countryCode The country of the BBAN. - * @param {string} bban The BBAN to convert to IBAN. - * @returns {string} The IBAN. - */ - fromBBAN(countryCode: string, bban: string): string; + /** + * @summary Convert the passed BBAN to an IBAN for this country specification. + * @param {string} countryCode The country of the BBAN. + * @param {string} bban The BBAN to convert to IBAN. + * @returns {string} The IBAN. + */ + fromBBAN(countryCode: string, bban: string): string; - /** - * @summary Check if the passed iban is valid according to this specification. - * @param {string} iban The iban to validate. - * @returns {boolean} True if valid, false otherwise. - */ - isValid(iban: string): boolean; + /** + * @summary Check if the passed iban is valid according to this specification. + * @param {string} iban The iban to validate. + * @returns {boolean} True if valid, false otherwise. + */ + isValid(iban: string): boolean; - /** - * @summary Check of the passed BBAN is valid. - * @param {string} countryCode The country of the BBAN. - * @param {string} bban The BBAN to validate. - * @returns {boolean} True if valid, false otherwise. - */ - isValidBBAN(countryCode: string, bban: string): boolean; + /** + * @summary Check of the passed BBAN is valid. + * @param {string} countryCode The country of the BBAN. + * @param {string} bban The BBAN to validate. + * @returns {boolean} True if valid, false otherwise. + */ + isValidBBAN(countryCode: string, bban: string): boolean; - /** - * @summary Returns the IBAN in a print format. - * @param {string} iban The IBAN to convert. - * @param {string} The IBAN in print format. - */ - printFormat(iban: string, separator: string[]): string; + /** + * @summary Returns the IBAN in a print format. + * @param {string} iban The IBAN to convert. + * @param {string} The IBAN in print format. + */ + printFormat(iban: string, separator: string[]): string; - /** - * @summary Convert the passed IBAN to a country-specific BBAN. - * @param {string} iban The IBAN to convert. - * @param {string[]} Separator the separator to use between BBAN blocks. - * @returns {string} The BBAN - */ - toBBAN(iban: string, separator: string[]): string; - } + /** + * @summary Convert the passed IBAN to a country-specific BBAN. + * @param {string} iban The IBAN to convert. + * @param {string[]} Separator the separator to use between BBAN blocks. + * @returns {string} The BBAN + */ + toBBAN(iban: string, separator: string[]): string; } -declare var IBAN: ARHS.IBANStatic; \ No newline at end of file +declare var IBAN: IBANStatic; \ No newline at end of file diff --git a/java-applet/java-applet-tests.ts b/java-applet/java-applet-tests.ts new file mode 100644 index 0000000000..6705279997 --- /dev/null +++ b/java-applet/java-applet-tests.ts @@ -0,0 +1,22 @@ +/// + +/** + * @summary Test for the applet status. + */ +function testStatus() { + var java: Java = { + status: AppletStatus.Loading + }; +} + +/** + * @summary Test for the handlers. + */ +function testHandlers() { + var handler: Function = () => {}; + var java: Java = { + onError: handler, + onLoad: handler, + onStop: handler + }; +} diff --git a/java-applet/java-applet-tests.ts.tscparams b/java-applet/java-applet-tests.ts.tscparams new file mode 100644 index 0000000000..934bc29ef2 --- /dev/null +++ b/java-applet/java-applet-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny \ No newline at end of file diff --git a/java-applet/java-applet.d.ts b/java-applet/java-applet.d.ts new file mode 100644 index 0000000000..0102b3b75b --- /dev/null +++ b/java-applet/java-applet.d.ts @@ -0,0 +1,52 @@ +// Type definitions for Java Applet +// Project: https://www.java.com/ +// Definitions by: Cyril Schumacher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * @summary Applet Status. + * {@link http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/applet_dev_guide.html#JSDPG719|Applet Status And Event Handlers} + */ +declare enum AppletStatus { + /** + * @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 object. + * @author Cyril Schumacher + * @version 1.0 + */ +interface Java { + /** + * Handler if the applet status is ERROR. An error has occurred while loading the applet. + */ + onError?: Function; + + /** + * Handler if the applet status is READY. Applet has finished loading and is ready to receive JavaScript calls. + */ + onLoad?: Function; + + /** + * Handler if the applet has stopped. + */ + onStop?: Function; + + /** + * @summary Applet Status. + */ + status?: AppletStatus; +}