Merge pull request #31260 from rarmatei/fast64

Add types for fast64
This commit is contained in:
Nathan Shively-Sanders
2018-12-17 15:05:34 -08:00
committed by GitHub
4 changed files with 47 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import * as fast64 from "fast64";
fast64.encode(""); // $ExpectType string
fast64.decode(""); // $ExpectType string
fast64.decode("", { uint8Array: true }); // $ExpectType Uint8Array
fast64.urlencode(""); // $ExpectType string
fast64.urldecode(""); // $ExpectType string
fast64.urldecode("", { uint8Array: true }); // $ExpectType Uint8Array
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for fast64 0.5
// Project: https://github.com/superhuman/fast64
// Definitions by: Rares Matei <https://github.com/rarmatei>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface Options {
uint8Array: boolean;
}
export function encode(value: string): string;
export function decode(base64: string): string;
export function decode(base64: string, options: Options): Uint8Array;
export function urlencode(value: string): string;
export function urldecode(base64: string): string;
export function urldecode(base64: string, options: Options): Uint8Array;
+23
View 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",
"fast64-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }