Add typings for emoji-strip (#39272)

* generate types/emoji-strip dir with dts-gen

* finish emoji-strip/index.d.ts

* finish emoji-strip tests

* Fix version

* More fixes for emoij-strip.

* fix require
This commit is contained in:
garyking 2019-10-22 17:06:45 -04:00 committed by Wesley Wigham
parent e47ab14b90
commit 2f441237fc
4 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,3 @@
import emojiStrip = require('emoji-strip');
const text: string = emojiStrip('Smile emoji: 😀');

15
types/emoji-strip/index.d.ts vendored Normal file
View File

@ -0,0 +1,15 @@
// Type definitions for emoji-strip 1.0
// Project: https://github.com/nizaroni/emoji-strip
// Definitions by: Gary King <https://github.com/garyking>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.7
/**
* Strip emojis from text.
*
* @param text The text from which to strip the emojis.
* @returns The text, with emojis removed.
*/
declare function emojiStrip(text: string): string;
export = emojiStrip;

View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"files": [
"index.d.ts",
"emoji-strip-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }