diff --git a/types/emoji-js/emoji-js-tests.ts b/types/emoji-js/emoji-js-tests.ts new file mode 100644 index 0000000000..0f8c92d1ac --- /dev/null +++ b/types/emoji-js/emoji-js-tests.ts @@ -0,0 +1,24 @@ +import emojijs = require('emoji-js'); + +const emoji = new emojijs.EmojiConvertor(); + +emoji.replace_colons(':smile:'); + +emoji.replace_unified('\u{1F604}'); + +emoji.text_mode = true; + +emoji.include_title = true; + +emoji.img_sets.apple.path = 'http://my-cdn.com/emoji-apple-64/'; + +emoji.img_sets.apple.sheet = 'http://my-cdn.com/emoji-apple-sheet-64.png'; + +emoji.use_sheet = true; + +emoji.addAliases({ + doge: '1f415', + cat: '1f346', +}); + +emoji.removeAliases(['doge', 'cat']); diff --git a/types/emoji-js/index.d.ts b/types/emoji-js/index.d.ts new file mode 100644 index 0000000000..162f682165 --- /dev/null +++ b/types/emoji-js/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for emoji-js 3.4 +// Project: https://github.com/iamcal/js-emoji +// Definitions by: Jason Di Benedetto +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export as namespace EmojiConvertor; + +export class EmojiConvertor { + addAliases: (aliases: { [key: string]: string }) => void; + + allow_caps: boolean; + + allow_native: boolean; + + avoid_ms_emoji: boolean; + + colons_mode: boolean; + + img_set: string; + + img_sets: { [key: string]: { path: string; sheet: string; sheet_size: number; mask: number } }; + + include_text: boolean; + + include_title: boolean; + + img_suffix: string; + + removeAliases: (aliases: string[]) => void; + + replace_colons: (str: string) => string; + + replace_emoticons: (str: string) => string; + + replace_emoticons_with_colons: (str: string) => string; + + replace_mode: string; + + replace_unified: (str: string) => string; + + text_mode: boolean; + + use_css_imgs: boolean; + + use_sheet: boolean; +} diff --git a/types/emoji-js/tsconfig.json b/types/emoji-js/tsconfig.json new file mode 100644 index 0000000000..00b6ee9845 --- /dev/null +++ b/types/emoji-js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "emoji-js-tests.ts" + ] +} diff --git a/types/emoji-js/tslint.json b/types/emoji-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/emoji-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }