diff --git a/iban/iban.d.ts b/iban/iban.d.ts new file mode 100644 index 0000000000..55efdaa2ad --- /dev/null +++ b/iban/iban.d.ts @@ -0,0 +1,58 @@ +// Type definitions for iban.js 0.0.5 +// Project: https://github.com/arhs/iban.js/ +// 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 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; + + /** + * @summary Convert the passed BBAN to an IBAN for this country specification. + * @param {string} bban The BBAN to convert to IBAN + * @returns {string} The IBAN + */ + fromBBAN(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 of the passed BBAN is valid. + * @param {string} bban The BBAN to validate + * @returns {boolean} True if valid, false otherwise. + */ + isValidBBAN(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 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