mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
Add types for @hapi/pez (#65690)
* Add types for `@hapi/pez` Signed-off-by: Grant Timmerman <grant@observablehq.com> * ci: run lint Signed-off-by: Grant Timmerman <grant@observablehq.com> * remove @hapi/pez Signed-off-by: Grant Timmerman <grant@observablehq.com> * remove @hapi/content Signed-off-by: Grant Timmerman <grant@observablehq.com> --------- Signed-off-by: Grant Timmerman <grant@observablehq.com>
This commit is contained in:
18
types/hapi__pez/hapi__pez-tests.ts
Normal file
18
types/hapi__pez/hapi__pez-tests.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import Content from "@hapi/content";
|
||||
import Pez from '@hapi/pez';
|
||||
|
||||
const contentType = Content.type("application/json; charset=utf-8");
|
||||
|
||||
const minDispenser = new Pez.Dispenser({ boundary: 'AaB03x' });
|
||||
const maxBytesDispenser = new Pez.Dispenser({
|
||||
boundary: 'AaB03x',
|
||||
maxBytes: 4096 - 1,
|
||||
maxParts: 1,
|
||||
});
|
||||
|
||||
// Example with Node Stream Options type
|
||||
const nodeOptionDispenser = new Pez.Dispenser({
|
||||
boundary: 'AaB03x',
|
||||
maxBytes: 50e6,
|
||||
...contentType,
|
||||
});
|
||||
17
types/hapi__pez/index.d.ts
vendored
Normal file
17
types/hapi__pez/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for @hapi/pez 6.1
|
||||
// Project: https://github.com/hapijs/pez
|
||||
// Definitions by: Grant Timmerman <https://github.com/grant>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
import * as stream from 'stream';
|
||||
|
||||
export interface PezOptions extends stream.WritableOptions {
|
||||
boundary: string;
|
||||
maxBytes?: number;
|
||||
maxParts?: number;
|
||||
}
|
||||
|
||||
export class Dispenser extends stream.Writable {
|
||||
constructor(options?: PezOptions);
|
||||
}
|
||||
3
types/hapi__pez/package.json
Normal file
3
types/hapi__pez/package.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"private": true
|
||||
}
|
||||
29
types/hapi__pez/tsconfig.json
Normal file
29
types/hapi__pez/tsconfig.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"@hapi/*": [
|
||||
"hapi__*"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"hapi__pez-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/hapi__pez/tslint.json
Normal file
1
types/hapi__pez/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "@definitelytyped/dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user