Add types for atob-lite and btoa-lite (#35983)

* Add types for atob-lite

* Add types for btoa-lite
This commit is contained in:
Gregor Martynus
2019-06-07 18:27:12 -07:00
committed by Andrew Casey
parent bd0e234663
commit 8d45842583
8 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import atob = require('atob-lite');
atob('PDM=');

9
types/atob-lite/index.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
// Type definitions for atob-lite 2.0
// Project: https://github.com/hughsk/atob-lite
// Definitions by: Gregor Martynus <https://github.com/gr2m>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
type DecodedData = string;
declare function atob(encodedData: string): DecodedData;
export = atob;

View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "atob-lite-tests.ts"]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@@ -0,0 +1,3 @@
import btoa = require('btoa-lite');
btoa('<3');

9
types/btoa-lite/index.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
// Type definitions for btoa-lite 1.0
// Project: https://github.com/hughsk/btoa-lite
// Definitions by: Gregor Martynus <https://github.com/gr2m>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
type EncodedData = string;
declare function btoa(decodedData: string): EncodedData;
export = btoa;

View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "btoa-lite-tests.ts"]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }