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 new file mode 100644 index 000000000..b2f0bc577 --- /dev/null +++ b/unorm/unorm.d.ts @@ -0,0 +1,19 @@ +// 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; + nfkd(str: string): string; + nfc(str: string): string; + nfkc(str: string): string; + } +} + +declare var unorm: unorm.Static; + +declare module "unorm" { + export = unorm; +}