feat(typedrouter): add middleware support to TypedRouter and export middleware type

This commit is contained in:
2026-03-03 20:22:01 +00:00
parent a1f5916faf
commit ee820dd126
11 changed files with 1187 additions and 453 deletions

View File

@@ -8,7 +8,7 @@ export interface ICommFunctions {
sendMethod?: (
sendPayload: plugins.typedRequestInterfaces.IStreamRequest
) => Promise<plugins.typedRequestInterfaces.IStreamRequest>;
typedrouter?: TypedRouter;
typedrouter?: TypedRouter<any>;
}
/**
@@ -140,7 +140,7 @@ export class VirtualStream<T = Uint8Array> implements plugins.typedRequestInterf
// integration with typedrequest mechanics
public sendMethod: ICommFunctions['sendMethod'];
public typedrouter: TypedRouter;
public typedrouter: TypedRouter<any>;
// wether to keep the stream alive
private keepAlive = true;