fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartstream',
|
||||
version: '3.0.11',
|
||||
version: '3.0.12',
|
||||
description: 'simplifies access to node streams'
|
||||
}
|
||||
|
@ -6,18 +6,18 @@ export interface IStreamTools {
|
||||
push: (pipeObject: any) => void;
|
||||
}
|
||||
|
||||
export interface IWriteAndTransformFunction<T, rT> {
|
||||
export interface IStreamWriteFunction<T, rT> {
|
||||
(chunkArg: T, toolsArg: IStreamTools): Promise<rT>;
|
||||
}
|
||||
|
||||
export interface IStreamEndFunction<rT> {
|
||||
export interface IStreamFinalFunction<rT> {
|
||||
(toolsArg: IStreamTools): Promise<rT>;
|
||||
}
|
||||
|
||||
export interface SmartStreamOptions<TInput, TOutput> extends DuplexOptions {
|
||||
readFunction?: () => Promise<void>;
|
||||
writeAndTransformFunction?: IWriteAndTransformFunction<TInput, TOutput>;
|
||||
finalFunction?: IStreamEndFunction<TOutput>;
|
||||
writeFunction?: IStreamWriteFunction<TInput, TOutput>;
|
||||
finalFunction?: IStreamFinalFunction<TOutput>;
|
||||
// Add other custom options if necessary
|
||||
}
|
||||
|
||||
@ -109,14 +109,14 @@ export class SmartDuplex<TInput = any, TOutput = any> extends Duplex {
|
||||
|
||||
// INSTANCE
|
||||
private readFunction?: () => Promise<void>;
|
||||
private writeFunction?: IWriteAndTransformFunction<TInput, TOutput>;
|
||||
private finalFunction?: IStreamEndFunction<TOutput>;
|
||||
private writeFunction?: IStreamWriteFunction<TInput, TOutput>;
|
||||
private finalFunction?: IStreamFinalFunction<TOutput>;
|
||||
private observableSubscription?: plugins.smartrx.rxjs.Subscription;
|
||||
|
||||
constructor(optionsArg?: SmartStreamOptions<TInput, TOutput>) {
|
||||
super(optionsArg);
|
||||
this.readFunction = optionsArg?.readFunction;
|
||||
this.writeFunction = optionsArg?.writeAndTransformFunction;
|
||||
this.writeFunction = optionsArg?.writeFunction;
|
||||
this.finalFunction = optionsArg?.finalFunction;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user