Compare commits

...

8 Commits

Author SHA1 Message Date
20c5b115d8 3.0.15 2024-02-24 14:45:18 +01:00
c3801ecd53 fix(core): update 2024-02-24 14:45:17 +01:00
51f03a45b6 3.0.14 2024-02-24 11:10:04 +01:00
ed8879a4c8 fix(core): update 2024-02-24 11:10:03 +01:00
806970c701 3.0.13 2024-02-23 20:18:20 +01:00
9638f74440 fix(core): update 2024-02-23 20:18:19 +01:00
b538c4fbdb 3.0.12 2024-02-23 17:02:13 +01:00
1d3dc08e39 fix(core): update 2024-02-23 17:02:12 +01:00
3 changed files with 26 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@api.global/typedrequest-interfaces",
"version": "3.0.11",
"version": "3.0.15",
"private": false,
"description": "interfaces for making typed requests",
"main": "dist_ts/index.js",

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@api.global/typedrequest-interfaces',
version: '3.0.11',
version: '3.0.15',
description: 'interfaces for making typed requests'
}

View File

@ -76,6 +76,21 @@ export interface ITag {
export type implementsTag<T, U extends T> = {};
// stream stuff
export interface IVirtualStream<T = ArrayBufferLike> {
// Properties
side: 'requesting' | 'responding';
streamId: string;
// Methods
handleStreamTr(streamTrArg: IStreamRequest): Promise<IStreamRequest>;
cleanup(): Promise<void>;
sendData(dataArg: T): Promise<void>;
fetchData(): Promise<T>;
pipeWebStream(webStream: any): void; // Consider defining a more specific type for webStream if possible
}
export interface IUnifiedStreamDataPackage {
/**
* the stream id, so Virtual Streams can talk to each other
@ -91,12 +106,12 @@ export interface IUnifiedStreamDataPackage {
/**
* the main purpose of the data package
* start: indicates the start of a stream
* binaryChunk: indicates a binary chunk of data
* object: indicates a json object
* chunk: indicates a binary chunk of data
* read: indicates the introduction to send data
* end: indicates the end of a stream
* feedback: indicates a feedback message
*/
mainPurpose: 'start' | 'binaryChunk' | 'object' | 'end' | 'feedback' | 'keepAlive';
mainPurpose: 'start' | 'chunk' | 'read' | 'end' | 'feedback' | 'keepAlive';
/**
* the data package
@ -118,7 +133,12 @@ export interface IUnifiedStreamDataPackage {
keepAlive?: boolean;
/**
* is there more data scheduled to be sent?
* is backpressure detected on the readable side?
*/
backpressure?: boolean;
/**
* does the writable side have more data scheduled to be sent?
*/
next?: boolean;
}