[string-strip-html] add type definition (#40481)

This commit is contained in:
Chris Shaw
2019-11-19 12:57:38 -08:00
committed by Sheetal Nandi
parent a707b32b0b
commit c95dfe4932
4 changed files with 54 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
// Type definitions for string-strip-html 4.3
// Project: https://gitlab.com/codsen/codsen/tree/master/packages/string-strip-html
// Definitions by: Chris Shaw <https://github.com/chris-shaw-2011>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function stringStripHtml(str: string, originalOpts?: Options): string;
interface Options {
ignoreTags?: string[];
onlyStripTags?: string[];
stripTogetherWithTheirContents?: string[] | false;
skipHtmlDecoding?: boolean;
returnRangeOnly?: boolean;
trimOnlySpaces?: boolean;
dumpLinkHrefsNearby?: DumpLinkHrefsNearby | false;
}
interface DumpLinkHrefsNearby {
enabled?: boolean;
putOnNewLine?: boolean;
wrapHeads?: string;
wrapTails?: string;
}
export = stringStripHtml;
@@ -0,0 +1,5 @@
import stringStripHtml = require("string-strip-html");
stringStripHtml("");
stringStripHtml("", {});
stringStripHtml("", { dumpLinkHrefsNearby: {} });
+23
View 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",
"string-strip-html-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }