From 5ea1c5b513fee483cd2ee02e3c93d4d1b62cad2d Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Mon, 4 May 2015 15:11:12 -0500 Subject: [PATCH 1/2] Add type declarations for unorm: both importable module and ambient var --- unorm/unorm.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 unorm/unorm.d.ts diff --git a/unorm/unorm.d.ts b/unorm/unorm.d.ts new file mode 100644 index 000000000..9f96fcef0 --- /dev/null +++ b/unorm/unorm.d.ts @@ -0,0 +1,14 @@ +declare module unorm { + interface Static { + nfd(str: string): string; + nfkd(str: string): string; + nfc(str: string): string; + nfkc(str: string): string; + } +} + +declare var unorm: unorm.Static; + +declare module "unorm" { + export = unorm; +} From e75a0e995133de6ae22f7df7e3b9aad22819b185 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Wed, 10 Jun 2015 12:39:40 -0500 Subject: [PATCH 2/2] Add unorm.d.ts header and unorm tests file --- unorm/unorm-tests.ts | 11 +++++++++++ unorm/unorm.d.ts | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 unorm/unorm-tests.ts diff --git a/unorm/unorm-tests.ts b/unorm/unorm-tests.ts new file mode 100644 index 000000000..6d2ba030d --- /dev/null +++ b/unorm/unorm-tests.ts @@ -0,0 +1,11 @@ +/// +import unorm = require("unorm"); + +function listNormalizations(raw: string) { + return [ + unorm.nfd(raw), + unorm.nfkd(raw), + unorm.nfc(raw), + unorm.nfkc(raw), + ]; +} diff --git a/unorm/unorm.d.ts b/unorm/unorm.d.ts index 9f96fcef0..b2f0bc577 100644 --- a/unorm/unorm.d.ts +++ b/unorm/unorm.d.ts @@ -1,3 +1,8 @@ +// Type definitions for unorm 1.3.3 +// Project: https://github.com/walling/unorm +// Definitions by: Christopher Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + declare module unorm { interface Static { nfd(str: string): string;