mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #31096 from Yavanosta/punycode
Typings for punycode package
This commit is contained in:
Vendored
+16
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user