mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
Merge pull request #21475 from jimivdw/gzip-size-4
Add definitions for gzip-size v4
This commit is contained in:
Vendored
+11
-5
@@ -1,13 +1,19 @@
|
||||
// Type definitions for gzip-size 3.0
|
||||
// Type definitions for gzip-size 4.0
|
||||
// Project: https://github.com/sindresorhus/gzip-size
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Jimi van der Woning <https://github.com/jimivdw>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare function gzipSize(input: string | Buffer, callback: (error: Error, size: number) => void): string;
|
||||
export = gzipSize;
|
||||
import * as stream from 'stream';
|
||||
import * as zlib from 'zlib';
|
||||
|
||||
declare function gzipSize(input: string | Buffer, options?: zlib.ZlibOptions): Promise<number>;
|
||||
|
||||
declare namespace gzipSize {
|
||||
function sync(input: string | Buffer): number;
|
||||
function stream(): NodeJS.ReadWriteStream;
|
||||
function sync(input: string | Buffer, options?: zlib.ZlibOptions): number;
|
||||
function stream(options?: zlib.ZlibOptions): stream.PassThrough;
|
||||
}
|
||||
|
||||
export = gzipSize;
|
||||
|
||||
@@ -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));
|
||||
Vendored
+13
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"types": [],
|
||||
"paths": {
|
||||
"gzip-size": [
|
||||
"gzip-size/v3"
|
||||
]
|
||||
},
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gzip-size-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user