@api.global/typedsocket 6.2.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,187 +0,0 @@
1
- import type * as plugins from './plugins.js';
2
- import type { NATIVE_BYTE_FRAME_TYPES, NATIVE_BYTE_PROTOCOL } from './constants.nativebytes.js';
3
- export type TNativeByteCapabilityMode = 'disabled' | 'optional' | 'required';
4
- export type TNativeByteRole = 'producer' | 'consumer';
5
- export type TNativeByteAuthorityOperation = 'open' | 'data' | 'fin' | 'confirm' | 'reject';
6
- export interface INativeByteDescriptorTransport {
7
- readonly [key: string]: plugins.typedrequestInterfaces.TNativeStreamTransportDescriptorPayload;
8
- readonly protocolMajor: 6;
9
- readonly role: 'producer';
10
- readonly streamId: string;
11
- readonly capability: string;
12
- readonly byteLength: number;
13
- readonly sha256: string;
14
- readonly contentType: string;
15
- readonly expiresAt: number;
16
- readonly initialWindowBytes: number;
17
- }
18
- export interface INativeByteDescriptor extends plugins.typedrequestInterfaces.INativeByteStreamDescriptor {
19
- readonly protocol: typeof NATIVE_BYTE_PROTOCOL;
20
- readonly transport: INativeByteDescriptorTransport;
21
- }
22
- export interface INativeByteReceipt {
23
- readonly streamId: string;
24
- readonly byteLength: number;
25
- readonly sha256: string;
26
- readonly contentType: string;
27
- readonly durable: true;
28
- }
29
- export interface INativeByteAuthorizationBinding extends INativeByteAuthorityRevisions {
30
- readonly principalId: string;
31
- readonly revalidate: TNativeByteRevalidate;
32
- }
33
- export interface INativeByteAuthorizationContext {
34
- readonly target: plugins.IWebSocketPeer;
35
- readonly manifest: plugins.typedrequestInterfaces.INativeByteStreamManifest;
36
- }
37
- export interface INativeByteAuthorizationAdapter {
38
- bind(authorizationArg: unknown, contextArg: Readonly<INativeByteAuthorizationContext>): INativeByteAuthorizationBinding;
39
- }
40
- export interface INativeByteCreateVirtualStreamOptions {
41
- readonly protocol: 'native-byte-v1';
42
- readonly direction: 'receive';
43
- readonly target: {
44
- readonly peer: plugins.IWebSocketPeer;
45
- } | plugins.IWebSocketPeer;
46
- readonly byteLength: number;
47
- readonly sha256: string;
48
- readonly contentType: string;
49
- readonly authorization: unknown;
50
- readonly initialWindowBytes?: number;
51
- }
52
- export interface INativeByteAuthorityRevisions {
53
- readonly credentialRevision: string;
54
- readonly configRevision: string;
55
- readonly bindingRevision: string;
56
- }
57
- export type TNativeByteConnectionBinding = {
58
- readonly side: 'client';
59
- readonly generation: number;
60
- readonly webSocket: WebSocket;
61
- } | {
62
- readonly side: 'server';
63
- readonly peer: plugins.IWebSocketPeer;
64
- };
65
- export interface INativeByteRevalidationContext extends INativeByteAuthorityRevisions {
66
- readonly operation: TNativeByteAuthorityOperation;
67
- readonly descriptor: INativeByteDescriptor;
68
- readonly connection: TNativeByteConnectionBinding;
69
- readonly abortSignal: AbortSignal;
70
- readonly deadline: number;
71
- }
72
- export type TNativeByteRevalidate = (contextArg: INativeByteRevalidationContext) => boolean | Promise<boolean>;
73
- export interface INativeByteCreateReceiveGrantOptions extends INativeByteAuthorityRevisions {
74
- readonly principalId: string;
75
- readonly byteLength: number;
76
- readonly sha256: string;
77
- readonly contentType: string;
78
- readonly revalidate: TNativeByteRevalidate;
79
- readonly target?: {
80
- readonly peer: plugins.IWebSocketPeer;
81
- } | plugins.IWebSocketPeer;
82
- readonly initialWindowBytes?: number;
83
- }
84
- export interface INativeByteOpenSenderOptions {
85
- readonly target?: {
86
- readonly peer: plugins.IWebSocketPeer;
87
- } | plugins.IWebSocketPeer;
88
- }
89
- export interface INativeByteReceiveGrant {
90
- readonly descriptor: INativeByteDescriptor;
91
- readonly stream: INativeByteReceiverLike;
92
- readonly opened: Promise<INativeByteReceiverLike>;
93
- readonly revoke: (reasonArg?: unknown) => Promise<void>;
94
- readonly dispose: () => void;
95
- }
96
- export interface INativeByteReceiverLike extends plugins.typedrequestInterfaces.INativeStreamTransportEndpoint {
97
- readonly protocol: 'native-byte-v1';
98
- readonly direction: 'receive';
99
- readonly manifest: plugins.typedrequestInterfaces.INativeByteStreamManifest;
100
- readonly readable: ReadableStream<Uint8Array>;
101
- readonly completion: Promise<INativeByteReceipt>;
102
- confirmDurable(): Promise<INativeByteReceipt>;
103
- reject(reasonArg?: unknown): Promise<void>;
104
- }
105
- export interface INativeByteSenderLike extends plugins.typedrequestInterfaces.INativeStreamTransportEndpoint {
106
- readonly protocol: 'native-byte-v1';
107
- readonly direction: 'send';
108
- readonly manifest: plugins.typedrequestInterfaces.INativeByteStreamManifest;
109
- readonly writable: WritableStream<Uint8Array>;
110
- readonly completion: Promise<INativeByteReceipt>;
111
- }
112
- export interface INativeByteCapabilityStatus {
113
- readonly protocolMajor: 6;
114
- readonly capabilities: readonly (typeof NATIVE_BYTE_PROTOCOL)[];
115
- readonly connection: 'none' | 'client' | 'server';
116
- }
117
- export interface INativeByteStats {
118
- readonly connection: 'none' | 'client' | 'server';
119
- readonly negotiated: boolean;
120
- readonly activeStreams: number;
121
- readonly receiveGrants: number;
122
- readonly queuedPayloadBytes: number;
123
- readonly rawQueueFrames: number;
124
- readonly rawQueueBytes: number;
125
- readonly processingRawBytes: number;
126
- readonly outboundControlFrames: number;
127
- readonly outboundDataFrames: number;
128
- readonly tombstones: number;
129
- readonly retainedRevalidations: number;
130
- readonly serverConnections: number;
131
- readonly serverStreams: number;
132
- readonly serverRetainedBytes: number;
133
- readonly serverRetainedRevalidations: number;
134
- }
135
- export interface INativeByteRuntime {
136
- now(): number;
137
- randomBytes(lengthArg: number): Uint8Array;
138
- setTimer(callbackArg: () => void, delayMsArg: number): unknown;
139
- clearTimer(timerArg: unknown): void;
140
- scheduleMacrotask(callbackArg: () => void): unknown;
141
- }
142
- export type TNativeByteOpenFrame = {
143
- readonly type: typeof NATIVE_BYTE_FRAME_TYPES.OPEN;
144
- readonly streamId: string;
145
- readonly capability: string;
146
- readonly byteLength: number;
147
- readonly sha256: string;
148
- readonly contentType: string;
149
- readonly initialWindowBytes: number;
150
- };
151
- export type TNativeByteOpenAckFrame = {
152
- readonly type: typeof NATIVE_BYTE_FRAME_TYPES.OPEN_ACK;
153
- readonly streamId: string;
154
- readonly receiveLimitOffset: number;
155
- };
156
- export type TNativeByteDataFrame = {
157
- readonly type: typeof NATIVE_BYTE_FRAME_TYPES.DATA;
158
- readonly streamId: string;
159
- readonly sequence: number;
160
- readonly offset: number;
161
- readonly payload: Uint8Array;
162
- };
163
- export type TNativeByteAckFrame = {
164
- readonly type: typeof NATIVE_BYTE_FRAME_TYPES.ACK;
165
- readonly streamId: string;
166
- readonly acknowledgedOffset: number;
167
- readonly receiveLimitOffset: number;
168
- };
169
- export type TNativeByteFinFrame = {
170
- readonly type: typeof NATIVE_BYTE_FRAME_TYPES.FIN;
171
- readonly streamId: string;
172
- readonly byteLength: number;
173
- readonly sha256: string;
174
- };
175
- export type TNativeByteFinAckFrame = {
176
- readonly type: typeof NATIVE_BYTE_FRAME_TYPES.FIN_ACK;
177
- readonly streamId: string;
178
- readonly byteLength: number;
179
- readonly sha256: string;
180
- };
181
- export type TNativeByteResetFrame = {
182
- readonly type: typeof NATIVE_BYTE_FRAME_TYPES.RESET;
183
- readonly streamId: string;
184
- readonly code: number;
185
- readonly reason: string;
186
- };
187
- export type TNativeByteFrame = TNativeByteOpenFrame | TNativeByteOpenAckFrame | TNativeByteDataFrame | TNativeByteAckFrame | TNativeByteFinFrame | TNativeByteFinAckFrame | TNativeByteResetFrame;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5uYXRpdmVieXRlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2ludGVyZmFjZXMubmF0aXZlYnl0ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9