Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
ec7fa07855 | |||
b34e88123d | |||
b680ab8c23 | |||
f0547b33d3 | |||
20c5b115d8 | |||
c3801ecd53 | |||
51f03a45b6 | |||
ed8879a4c8 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@api.global/typedrequest-interfaces",
|
||||
"version": "3.0.13",
|
||||
"version": "3.0.17",
|
||||
"private": false,
|
||||
"description": "interfaces for making typed requests",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@api.global/typedrequest-interfaces',
|
||||
version: '3.0.13',
|
||||
version: '3.0.17',
|
||||
description: 'interfaces for making typed requests'
|
||||
}
|
||||
|
23
ts/index.ts
23
ts/index.ts
@ -76,6 +76,23 @@ export interface ITag {
|
||||
|
||||
export type implementsTag<T, U extends T> = {};
|
||||
|
||||
|
||||
// stream stuff
|
||||
export interface IVirtualStream<T = ArrayBufferLike> {
|
||||
// Properties
|
||||
side: 'requesting' | 'responding';
|
||||
streamId: string;
|
||||
sendMethod: any;
|
||||
typedrouter: any;
|
||||
|
||||
// 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 +108,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' | 'chunk' | 'object' | 'end' | 'feedback' | 'keepAlive';
|
||||
mainPurpose: 'start' | 'chunk' | 'read' | 'end' | 'feedback' | 'keepAlive';
|
||||
|
||||
/**
|
||||
* the data package
|
||||
|
Reference in New Issue
Block a user