mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Adding @types/s3-streams (#46016)
* Adding @types/s3-streams * Use LTS node on Actions Co-authored-by: Andrew Branch <andrew@wheream.io>
This commit is contained in:
parent
c1375f8e7e
commit
08496fde74
28
types/s3-streams/index.d.ts
vendored
Normal file
28
types/s3-streams/index.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// Type definitions for s3-streams 0.4
|
||||
// Project: https://github.com/izaakschroeder/s3-streams
|
||||
// Definitions by: Carl Fürstenberg <https://github.com/azatoth>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { S3 } from 'aws-sdk';
|
||||
import { Readable, Writable } from 'stream';
|
||||
|
||||
export interface StreamOptions {
|
||||
/**
|
||||
* Number of bytes to read or write before emitting a chunk to the stream.
|
||||
* Must be above 5MB for {@link WriteStream}
|
||||
*
|
||||
* @default 4MB for {@link ReadStream}
|
||||
* @default 10MB for {@link WriteStream}
|
||||
*/
|
||||
highWaterMark?: number;
|
||||
}
|
||||
|
||||
export class ReadStream extends Readable {
|
||||
constructor(client: S3, options: S3.GetObjectRequest, streamOptions?: StreamOptions);
|
||||
}
|
||||
|
||||
export class WriteStream extends Writable {
|
||||
constructor(client: S3, options: S3.CreateMultipartUploadRequest, streamOptions?: StreamOptions);
|
||||
}
|
||||
6
types/s3-streams/package.json
Normal file
6
types/s3-streams/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.713.0"
|
||||
}
|
||||
}
|
||||
23
types/s3-streams/s3-streams-tests.ts
Normal file
23
types/s3-streams/s3-streams-tests.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import * as AWS from 'aws-sdk';
|
||||
import * as S3S from 's3-streams';
|
||||
|
||||
const s3 = new AWS.S3();
|
||||
const ws = new S3S.WriteStream(
|
||||
s3,
|
||||
{
|
||||
Bucket: 'my-bucket',
|
||||
Key: 'my-key',
|
||||
},
|
||||
{ highWaterMark: 42 },
|
||||
);
|
||||
|
||||
const rs = new S3S.ReadStream(
|
||||
s3,
|
||||
{
|
||||
Bucket: 'my-bucket',
|
||||
Key: 'my-key',
|
||||
},
|
||||
{ highWaterMark: 42 },
|
||||
);
|
||||
|
||||
rs.pipe(ws);
|
||||
23
types/s3-streams/tsconfig.json
Normal file
23
types/s3-streams/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"s3-streams-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/s3-streams/tslint.json
Normal file
1
types/s3-streams/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user