From f0e1cf4cd41fb2c5e2d8b9225e4812c06abb9d59 Mon Sep 17 00:00:00 2001 From: nrlquaker Date: Sat, 30 Sep 2017 11:45:47 +0300 Subject: [PATCH 1/2] Add blob-to-buffer --- types/blob-to-buffer/blob-to-buffer-tests.ts | 6 +++++ types/blob-to-buffer/index.d.ts | 11 ++++++++++ types/blob-to-buffer/tsconfig.json | 23 ++++++++++++++++++++ types/blob-to-buffer/tslint.json | 3 +++ 4 files changed, 43 insertions(+) create mode 100644 types/blob-to-buffer/blob-to-buffer-tests.ts create mode 100644 types/blob-to-buffer/index.d.ts create mode 100644 types/blob-to-buffer/tsconfig.json create mode 100644 types/blob-to-buffer/tslint.json diff --git a/types/blob-to-buffer/blob-to-buffer-tests.ts b/types/blob-to-buffer/blob-to-buffer-tests.ts new file mode 100644 index 0000000000..1be7e54e7f --- /dev/null +++ b/types/blob-to-buffer/blob-to-buffer-tests.ts @@ -0,0 +1,6 @@ +import * as blobToBuffer from "blob-to-buffer"; + +blobToBuffer(new Blob(), (error, buffer) => { + console.log(error); + console.log(buffer); +}); diff --git a/types/blob-to-buffer/index.d.ts b/types/blob-to-buffer/index.d.ts new file mode 100644 index 0000000000..8c8156963e --- /dev/null +++ b/types/blob-to-buffer/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for blob-to-buffer 1.2 +// Project: https://github.com/feross/blob-to-buffer +// Definitions by: nrlquaker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +declare function blobToBuffer(blob: Blob, callback: (error: any, buffer: Buffer) => void): void; +declare namespace blobToBuffer {} +export = blobToBuffer; diff --git a/types/blob-to-buffer/tsconfig.json b/types/blob-to-buffer/tsconfig.json new file mode 100644 index 0000000000..8861d219a1 --- /dev/null +++ b/types/blob-to-buffer/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "blob-to-buffer-tests.ts" + ] +} diff --git a/types/blob-to-buffer/tslint.json b/types/blob-to-buffer/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/blob-to-buffer/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 6c91d49f9fbed3314d4e38ccaf909e3fe9e70dc3 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 16 Oct 2017 10:23:51 -0700 Subject: [PATCH 2/2] Fix import style and add strictFunctionTypes --- types/blob-to-buffer/blob-to-buffer-tests.ts | 2 +- types/blob-to-buffer/tsconfig.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/blob-to-buffer/blob-to-buffer-tests.ts b/types/blob-to-buffer/blob-to-buffer-tests.ts index 1be7e54e7f..21d9508469 100644 --- a/types/blob-to-buffer/blob-to-buffer-tests.ts +++ b/types/blob-to-buffer/blob-to-buffer-tests.ts @@ -1,4 +1,4 @@ -import * as blobToBuffer from "blob-to-buffer"; +import blobToBuffer = require("blob-to-buffer"); blobToBuffer(new Blob(), (error, buffer) => { console.log(error); diff --git a/types/blob-to-buffer/tsconfig.json b/types/blob-to-buffer/tsconfig.json index 8861d219a1..2421ce2493 100644 --- a/types/blob-to-buffer/tsconfig.json +++ b/types/blob-to-buffer/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../"