mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-05 01:30:17 +00:00
Merge pull request #31170 from BendingBender/escape-goat
Add types for escape-goat
This commit is contained in:
14
types/escape-goat/escape-goat-tests.ts
Normal file
14
types/escape-goat/escape-goat-tests.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as escapeGoat from 'escape-goat';
|
||||
|
||||
// $ExpectType string
|
||||
escapeGoat.escape('🦄 & 🐐');
|
||||
|
||||
// $ExpectType string
|
||||
escapeGoat.unescape('🦄 & 🐐');
|
||||
|
||||
// $ExpectType string
|
||||
escapeGoat.escape('Hello <em>World</em>');
|
||||
|
||||
const url = 'https://sindresorhus.com?x="🦄"';
|
||||
// $ExpectType string
|
||||
escapeGoat.escapeTag`<a href="${url}">Unicorn</a>`;
|
||||
9
types/escape-goat/index.d.ts
vendored
Normal file
9
types/escape-goat/index.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Type definitions for escape-goat 1.3
|
||||
// Project: https://github.com/sindresorhus/escape-goat#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function escape(input: string): string;
|
||||
export function unescape(input: string): string;
|
||||
export function escapeTag(template: TemplateStringsArray, ...substitutions: any[]): string;
|
||||
export function unescapeTag(template: TemplateStringsArray, ...substitutions: any[]): string;
|
||||
23
types/escape-goat/tsconfig.json
Normal file
23
types/escape-goat/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"escape-goat-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/escape-goat/tslint.json
Normal file
1
types/escape-goat/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user