mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-07 10:40:13 +00:00
feat: add definitions for gzip-size v4
This commit is contained in:
16
types/gzip-size/index.d.ts
vendored
16
types/gzip-size/index.d.ts
vendored
@@ -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;
|
||||
|
||||
7
types/gzip-size/v3/gzip-size-tests.ts
Normal file
7
types/gzip-size/v3/gzip-size-tests.ts
Normal 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
types/gzip-size/v3/index.d.ts
vendored
Normal file
13
types/gzip-size/v3/index.d.ts
vendored
Normal 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;
|
||||
}
|
||||
28
types/gzip-size/v3/tsconfig.json
Normal file
28
types/gzip-size/v3/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
3
types/gzip-size/v3/tslint.json
Normal file
3
types/gzip-size/v3/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user