mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Typings for punycode package
This commit is contained in:
parent
ead110d5f4
commit
0e0d9592b3
16
types/punycode/index.d.ts
vendored
Normal file
16
types/punycode/index.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// Type definitions for punycode 2.1
|
||||
// Project: https://mths.be/punycode
|
||||
// Definitions by: Dmitry Guketlev <https://github.com/yavanosta>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function decode(input: string): string;
|
||||
export function encode(input: string): string;
|
||||
export function toUnicode(input: string): string;
|
||||
export function toASCII(input: string): string;
|
||||
|
||||
export namespace ucs2 {
|
||||
function decode(string: string): number[];
|
||||
function encode(array: ReadonlyArray<number>): string;
|
||||
}
|
||||
|
||||
export const version: string;
|
||||
11
types/punycode/punycode-tests.ts
Normal file
11
types/punycode/punycode-tests.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import punycode = require('punycode');
|
||||
|
||||
const result1: string = punycode.decode('x');
|
||||
const result2: string = punycode.encode('x');
|
||||
const result3: string = punycode.toASCII('x');
|
||||
const result4: string = punycode.toUnicode('x');
|
||||
|
||||
const ucs2result1: number[] = punycode.ucs2.decode('x');
|
||||
const ucs2result2: string = punycode.ucs2.encode([1, 2, 3]);
|
||||
|
||||
const version: string = punycode.version;
|
||||
23
types/punycode/tsconfig.json
Normal file
23
types/punycode/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",
|
||||
"punycode-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/punycode/tslint.json
Normal file
1
types/punycode/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user