add types of gzip-size

This commit is contained in:
york yao
2017-07-11 18:40:47 +08:00
parent e545c1e19a
commit 5a8b5047e3
4 changed files with 45 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
import gzipSize = require('gzip-size');
const string = 'Lorem ipsum dolor sit amet.';
console.log(string.length);
console.log(gzipSize.sync(string));
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for gzip-size 3.0
// Project: https://github.com/sindresorhus/gzip-size
// Definitions by: York Yao <https://github.com/plantain-00>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare function gzipSize(input: string | Buffer, callback: (error: Error, size: number) => void): string;
export = gzipSize;
declare namespace gzipSize {
function sync(input: string | Buffer): number;
function stream(): NodeJS.ReadWriteStream;
}
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"gzip-size-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}