mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-08 06:42:22 +08:00
Merge pull request #24496 from urish/base64-url
add types for base64-url
This commit is contained in:
9
types/base64-url/base64-url-tests.ts
Normal file
9
types/base64-url/base64-url-tests.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import * as base64url from 'base64-url';
|
||||
|
||||
base64url.encode('Node.js is awesome.'); // $ExpectType string
|
||||
base64url.decode('Tm9kZS5qcyBpcyBhd2Vzb21lLg'); // $ExpectType string
|
||||
base64url.escape('This+is/goingto+escape=='); // $ExpectType string
|
||||
base64url.unescape('This-is_goingto-escape'); // $ExpectType string
|
||||
|
||||
base64url.encode('string to encode', 'ascii'); // $ExpectType string
|
||||
base64url.decode('string to decode', 'ascii'); // $ExpectType string
|
||||
9
types/base64-url/index.d.ts
vendored
Normal file
9
types/base64-url/index.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Type definitions for base64-url 2.2
|
||||
// Project: https://github.com/joaquimserafim/base64-url
|
||||
// Definitions by: Uri Shaked <https://github.com/urish>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function decode(value: string, encoding?: string): string;
|
||||
export function encode(value: string, encoding?: string): string;
|
||||
export function escape(value: string): string;
|
||||
export function unescape(value: string): string;
|
||||
23
types/base64-url/tsconfig.json
Normal file
23
types/base64-url/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",
|
||||
"base64-url-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/base64-url/tslint.json
Normal file
1
types/base64-url/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user