mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Add type definitions for base64-arraybuffer (#25239)
* Added declarations for 'base64-arraybuffer' * fix linting and header
This commit is contained in:
4
types/base64-arraybuffer/base64-arraybuffer-tests.ts
Normal file
4
types/base64-arraybuffer/base64-arraybuffer-tests.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { encode, decode } from 'base64-arraybuffer';
|
||||
|
||||
encode(new Float32Array([1, 2, 3]).buffer); // $ExpectType string
|
||||
decode('AACAPwAAAEAAAEBA'); // $ExpectType ArrayBuffer
|
||||
7
types/base64-arraybuffer/index.d.ts
vendored
Normal file
7
types/base64-arraybuffer/index.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
// Type definitions for base64-arraybuffer 0.1
|
||||
// Project: https://github.com/niklasvh/base64-arraybuffer
|
||||
// Definitions by: Ben Cook <https://github.com/jbencook>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function encode(arraybuffer: ArrayBuffer): string;
|
||||
export function decode(base64: string): ArrayBuffer;
|
||||
23
types/base64-arraybuffer/tsconfig.json
Normal file
23
types/base64-arraybuffer/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-arraybuffer-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/base64-arraybuffer/tslint.json
Normal file
1
types/base64-arraybuffer/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user