mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat(@types/emoji-js) create types (#39026)
This commit is contained in:
parent
122f665640
commit
2250810353
24
types/emoji-js/emoji-js-tests.ts
Normal file
24
types/emoji-js/emoji-js-tests.ts
Normal file
@ -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']);
|
||||
47
types/emoji-js/index.d.ts
vendored
Normal file
47
types/emoji-js/index.d.ts
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
// Type definitions for emoji-js 3.4
|
||||
// Project: https://github.com/iamcal/js-emoji
|
||||
// Definitions by: Jason Di Benedetto <https://github.com/jasondibenedetto>
|
||||
// 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;
|
||||
}
|
||||
23
types/emoji-js/tsconfig.json
Normal file
23
types/emoji-js/tsconfig.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
1
types/emoji-js/tslint.json
Normal file
1
types/emoji-js/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user