osra 0.4.4 → 0.5.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.
- package/README.md +224 -231
- package/build/connections/bidirectional.d.ts +25 -15
- package/build/connections/index.d.ts +8 -8
- package/build/connections/relay.d.ts +1 -1
- package/build/connections/utils.d.ts +6 -5
- package/build/index.d.ts +11 -11
- package/build/index.js +782 -513
- package/build/index.js.map +1 -1
- package/build/revivables/abort-signal.d.ts +6 -4
- package/build/revivables/array-buffer.d.ts +2 -2
- package/build/revivables/async-iterator.d.ts +16 -0
- package/build/revivables/bigint.d.ts +1 -1
- package/build/revivables/blob.d.ts +3 -3
- package/build/revivables/date.d.ts +1 -1
- package/build/revivables/error.d.ts +5 -2
- package/build/revivables/event-target.d.ts +5 -4
- package/build/revivables/event.d.ts +2 -2
- package/build/revivables/fallbacks.d.ts +1 -1
- package/build/revivables/function.d.ts +4 -4
- package/build/revivables/headers.d.ts +1 -1
- package/build/revivables/identity.d.ts +3 -3
- package/build/revivables/index.d.ts +48 -39
- package/build/revivables/json-primitives.d.ts +17 -0
- package/build/revivables/map.d.ts +2 -2
- package/build/revivables/message-port.d.ts +6 -6
- package/build/revivables/promise.d.ts +5 -5
- package/build/revivables/readable-stream.d.ts +8 -4
- package/build/revivables/request.d.ts +4 -2
- package/build/revivables/response.d.ts +2 -2
- package/build/revivables/set.d.ts +2 -2
- package/build/revivables/symbol.d.ts +5 -3
- package/build/revivables/transfer.d.ts +2 -2
- package/build/revivables/typed-array.d.ts +3 -3
- package/build/revivables/utils.d.ts +5 -10
- package/build/revivables/writable-stream.d.ts +4 -4
- package/build/types.d.ts +12 -4
- package/build/utils/event-channel.d.ts +1 -1
- package/build/utils/index.d.ts +11 -12
- package/build/utils/replace.d.ts +0 -3
- package/build/utils/teardown.d.ts +7 -0
- package/build/utils/transferable.d.ts +1 -1
- package/build/utils/transport.d.ts +13 -15
- package/build/utils/type-guards.d.ts +12 -4
- package/build/utils/typed-event-target.d.ts +1 -1
- package/build/utils/typed-message-channel.d.ts +3 -2
- package/package.json +21 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Message, MessageVariant, Uuid, Capable, MessageEventMap } from '../types';
|
|
2
|
-
import type { DefaultRevivableModules, RevivableModule } from '../revivables';
|
|
3
|
-
import type { Transport } from '../utils/transport';
|
|
4
|
-
import type { ConnectionContext } from '.';
|
|
5
|
-
import type { TypedEventTarget } from '../utils/typed-event-target';
|
|
1
|
+
import type { Message, MessageVariant, Uuid, Capable, MessageEventMap } from '../types.js';
|
|
2
|
+
import type { DefaultRevivableModules, RevivableModule } from '../revivables/index.js';
|
|
3
|
+
import type { Transport } from '../utils/transport.js';
|
|
4
|
+
import type { ConnectionContext } from './index.js';
|
|
5
|
+
import type { TypedEventTarget } from '../utils/typed-event-target.js';
|
|
6
6
|
export declare const normalizeTransport: (transport: Transport) => Transport;
|
|
7
7
|
/** Resolves the final revivable module list. The user supplies a function
|
|
8
8
|
* that takes the defaults and returns whatever ordering/composition they
|
|
@@ -23,6 +23,7 @@ export type ProtocolContext<TModules extends readonly RevivableModule[] = Defaul
|
|
|
23
23
|
sendMessage: (message: MessageVariant) => void;
|
|
24
24
|
protocolEventTarget: ProtocolEventTarget<TModules>;
|
|
25
25
|
resolveRemoteValue: (value: Capable<TModules>) => void;
|
|
26
|
+
rejectRemoteValue: (error: unknown) => void;
|
|
26
27
|
createConnectionEventTarget: () => TypedEventTarget<MessageEventMap<TModules>>;
|
|
27
28
|
};
|
|
28
29
|
export type StartConnectionsOptions<TModules extends readonly RevivableModule[] = DefaultRevivableModules> = {
|
package/build/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { Capable } from './types';
|
|
2
|
-
import type { DefaultRevivableModules, RevivableContext } from './revivables';
|
|
3
|
-
import type { RevivableModule } from './revivables';
|
|
4
|
-
import type { StartConnectionsOptions } from './connections/utils';
|
|
5
|
-
import type { Transport } from './utils/transport';
|
|
6
|
-
import type { BadFieldValue, BadFieldPath, BadFieldParent, ErrorMessage, BadValue, Path, ParentObject } from './utils/capable-check';
|
|
7
|
-
export * from './types';
|
|
8
|
-
export * from './revivables';
|
|
9
|
-
export * from './connections';
|
|
10
|
-
export * from './utils';
|
|
1
|
+
import type { Capable, Remote } from './types.js';
|
|
2
|
+
import type { DefaultRevivableModules, RevivableContext } from './revivables/index.js';
|
|
3
|
+
import type { RevivableModule } from './revivables/index.js';
|
|
4
|
+
import type { StartConnectionsOptions } from './connections/utils.js';
|
|
5
|
+
import type { Transport } from './utils/transport.js';
|
|
6
|
+
import type { BadFieldValue, BadFieldPath, BadFieldParent, ErrorMessage, BadValue, Path, ParentObject } from './utils/capable-check.js';
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export * from './revivables/index.js';
|
|
9
|
+
export * from './connections/index.js';
|
|
10
|
+
export * from './utils/index.js';
|
|
11
11
|
/** Synthetic context so `Capable` can narrow on the inferred transport
|
|
12
12
|
* without an actual context object at the call site. Only `transport`
|
|
13
13
|
* matters; the rest is stubbed with the broadest types. */
|
|
@@ -22,4 +22,4 @@ type CapableCheck<T, TModules extends readonly RevivableModule[] = DefaultReviva
|
|
|
22
22
|
};
|
|
23
23
|
export declare const expose: <T = unknown, const TModules extends readonly RevivableModule[] = DefaultRevivableModules, const TTransport extends Transport = Transport, const TValue = Capable<TModules, ContextOf<TTransport>>>(value: CapableCheck<TValue, TModules, ContextOf<TTransport>>, options: StartConnectionsOptions<TModules> & {
|
|
24
24
|
transport: TTransport;
|
|
25
|
-
}) => Promise<T
|
|
25
|
+
}) => Promise<Remote<T>>;
|