diff --git a/types/string-strip-html/index.d.ts b/types/string-strip-html/index.d.ts new file mode 100644 index 0000000000..527985ab13 --- /dev/null +++ b/types/string-strip-html/index.d.ts @@ -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 +// 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; diff --git a/types/string-strip-html/string-strip-html-tests.ts b/types/string-strip-html/string-strip-html-tests.ts new file mode 100644 index 0000000000..724e16939f --- /dev/null +++ b/types/string-strip-html/string-strip-html-tests.ts @@ -0,0 +1,5 @@ +import stringStripHtml = require("string-strip-html"); + +stringStripHtml(""); +stringStripHtml("", {}); +stringStripHtml("", { dumpLinkHrefsNearby: {} }); diff --git a/types/string-strip-html/tsconfig.json b/types/string-strip-html/tsconfig.json new file mode 100644 index 0000000000..da7f18f084 --- /dev/null +++ b/types/string-strip-html/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", + "string-strip-html-tests.ts" + ] +} diff --git a/types/string-strip-html/tslint.json b/types/string-strip-html/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/string-strip-html/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }