mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add definitions for 'fold-to-ascii' (#47612)
Co-authored-by: Morgan Zolob <morgan.zolob@ingrooves.com>
This commit is contained in:
parent
9b7f2b419e
commit
d51a678069
5
types/fold-to-ascii/fold-to-ascii-tests.ts
Normal file
5
types/fold-to-ascii/fold-to-ascii-tests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import * as ASCIIFolder from 'fold-to-ascii';
|
||||
|
||||
ASCIIFolder.foldReplacing('Lörem 🤧 ëripuît'); // $ExpectType string
|
||||
ASCIIFolder.foldReplacing('Lörem 🤧 ëripuît', 'X'); // $ExpectType string
|
||||
ASCIIFolder.foldMaintaining('Lörem 🤧 ëripuît'); // $ExpectType string
|
||||
22
types/fold-to-ascii/index.d.ts
vendored
Normal file
22
types/fold-to-ascii/index.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Type definitions for fold-to-ascii 5.0
|
||||
// Project: https://github.com/mplatt/fold-to-ascii
|
||||
// Definitions by: Morgan Zolob <https://github.com/mogzol>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Replace all known non-ASCII characters with appropriate replacements,
|
||||
* replace the unknown ones with a fallback
|
||||
*
|
||||
* @param str Input string containing ASCII and/or non-ASCII characters
|
||||
* @param replacement Fallback for unknown characters in the input string
|
||||
* (defaults to empty string)
|
||||
*/
|
||||
export function foldReplacing(str?: string, replacement?: string): string;
|
||||
|
||||
/**
|
||||
* Replace all known non-ASCII characters with appropriate replacements,
|
||||
* maintain the unknown ones
|
||||
*
|
||||
* @param str Input string containing ASCII and/or non-ASCII characters
|
||||
*/
|
||||
export function foldMaintaining(str?: string): string;
|
||||
23
types/fold-to-ascii/tsconfig.json
Normal file
23
types/fold-to-ascii/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",
|
||||
"fold-to-ascii-tests.ts"
|
||||
]
|
||||
}
|
||||
4
types/fold-to-ascii/tslint.json
Normal file
4
types/fold-to-ascii/tslint.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": { "npm-naming": [true, { "mode": "code", "errors": [["NeedsExportEquals", false]] }] }
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user