Merge pull request #4307 from chbrown/unorm

Add type declarations for unorm: both importable module and ambient var
This commit is contained in:
Masahiro Wakame
2015-06-14 17:01:42 +09:00
2 changed files with 30 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
/// <reference path="unorm.d.ts" />
import unorm = require("unorm");
function listNormalizations(raw: string) {
return [
unorm.nfd(raw),
unorm.nfkd(raw),
unorm.nfc(raw),
unorm.nfkc(raw),
];
}
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for unorm 1.3.3
// Project: https://github.com/walling/unorm
// Definitions by: Christopher Brown <https://github.com/chbrown>
// 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;
}