osra 0.4.4 → 0.4.5

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.
Files changed (40) hide show
  1. package/build/connections/bidirectional.d.ts +15 -15
  2. package/build/connections/index.d.ts +8 -8
  3. package/build/connections/relay.d.ts +1 -1
  4. package/build/connections/utils.d.ts +5 -5
  5. package/build/index.d.ts +10 -10
  6. package/build/index.js.map +1 -1
  7. package/build/revivables/abort-signal.d.ts +3 -3
  8. package/build/revivables/array-buffer.d.ts +2 -2
  9. package/build/revivables/bigint.d.ts +1 -1
  10. package/build/revivables/blob.d.ts +3 -3
  11. package/build/revivables/date.d.ts +1 -1
  12. package/build/revivables/error.d.ts +2 -2
  13. package/build/revivables/event-target.d.ts +3 -3
  14. package/build/revivables/event.d.ts +2 -2
  15. package/build/revivables/fallbacks.d.ts +1 -1
  16. package/build/revivables/function.d.ts +4 -4
  17. package/build/revivables/headers.d.ts +1 -1
  18. package/build/revivables/identity.d.ts +3 -3
  19. package/build/revivables/index.d.ts +36 -36
  20. package/build/revivables/map.d.ts +2 -2
  21. package/build/revivables/message-port.d.ts +6 -6
  22. package/build/revivables/promise.d.ts +5 -5
  23. package/build/revivables/readable-stream.d.ts +3 -3
  24. package/build/revivables/request.d.ts +2 -2
  25. package/build/revivables/response.d.ts +2 -2
  26. package/build/revivables/set.d.ts +2 -2
  27. package/build/revivables/symbol.d.ts +2 -2
  28. package/build/revivables/transfer.d.ts +2 -2
  29. package/build/revivables/typed-array.d.ts +3 -3
  30. package/build/revivables/utils.d.ts +5 -5
  31. package/build/revivables/writable-stream.d.ts +4 -4
  32. package/build/types.d.ts +4 -4
  33. package/build/utils/event-channel.d.ts +1 -1
  34. package/build/utils/index.d.ts +12 -12
  35. package/build/utils/transferable.d.ts +1 -1
  36. package/build/utils/transport.d.ts +2 -2
  37. package/build/utils/type-guards.d.ts +2 -2
  38. package/build/utils/typed-event-target.d.ts +1 -1
  39. package/build/utils/typed-message-channel.d.ts +2 -2
  40. package/package.json +12 -3
@@ -1,8 +1,8 @@
1
- import type { Transport } from '../utils/transport';
2
- import type { DefaultRevivableModules, RevivableModule } from '../revivables';
3
- import type { DeepReplaceWithBox } from '../utils/replace';
4
- import type { ProtocolContext } from './utils';
5
- import type { Capable, MessageEventTarget, MessageFields, Uuid } from '../types';
1
+ import type { Transport } from '../utils/transport.js';
2
+ import type { DefaultRevivableModules, RevivableModule } from '../revivables/index.js';
3
+ import type { DeepReplaceWithBox } from '../utils/replace.js';
4
+ import type { ProtocolContext } from './utils.js';
5
+ import type { Capable, MessageEventTarget, MessageFields, Uuid } from '../types.js';
6
6
  export declare const type: 'bidirectional';
7
7
  export type InitMessage<TModules extends readonly RevivableModule[] = DefaultRevivableModules, T extends Capable<TModules> = Capable<TModules>> = {
8
8
  type: 'init';
@@ -23,23 +23,23 @@ export type ConnectionRevivableContext<TModules extends readonly RevivableModule
23
23
  revivableModules: TModules;
24
24
  eventTarget: MessageEventTarget<TModules>;
25
25
  };
26
- export declare const startBidirectionalConnection: <TModules extends readonly RevivableModule[] = readonly [typeof import("../revivables/transfer"), typeof import("../revivables/identity"), typeof import("../revivables/array-buffer"), typeof import("../revivables/date"), typeof import("../revivables/headers"), typeof import("../revivables/error"), typeof import("../revivables/typed-array"), typeof import("../revivables/blob"), typeof import("../revivables/promise"), typeof import("../revivables/function"), typeof import("../revivables/message-port"), typeof import("../revivables/readable-stream"), typeof import("../revivables/writable-stream"), typeof import("../revivables/abort-signal"), typeof import("../revivables/response"), typeof import("../revivables/request"), typeof import("../revivables/map"), typeof import("../revivables/set"), typeof import("../revivables/bigint"), typeof import("../revivables/symbol"), typeof import("../revivables/event"), {
26
+ export declare const startBidirectionalConnection: <TModules extends readonly RevivableModule[] = readonly [typeof import("../revivables/transfer.js"), typeof import("../revivables/identity.js"), typeof import("../revivables/array-buffer.js"), typeof import("../revivables/date.js"), typeof import("../revivables/headers.js"), typeof import("../revivables/error.js"), typeof import("../revivables/typed-array.js"), typeof import("../revivables/blob.js"), typeof import("../revivables/promise.js"), typeof import("../revivables/function.js"), typeof import("../revivables/message-port.js"), typeof import("../revivables/readable-stream.js"), typeof import("../revivables/writable-stream.js"), typeof import("../revivables/abort-signal.js"), typeof import("../revivables/response.js"), typeof import("../revivables/request.js"), typeof import("../revivables/map.js"), typeof import("../revivables/set.js"), typeof import("../revivables/bigint.js"), typeof import("../revivables/symbol.js"), typeof import("../revivables/event.js"), {
27
27
  readonly type: 'clonable';
28
28
  readonly capableOnly: true;
29
- readonly isType: (value: unknown) => value is import("../revivables/fallbacks").Clonable;
30
- readonly box: (value: import("../revivables/fallbacks").Clonable, _context: import("..").RevivableContext<any>) => import("../revivables/fallbacks").Clonable;
31
- readonly revive: (value: import("../revivables/fallbacks").BoxedClonable, _context: import("..").RevivableContext<any>) => import("../revivables/fallbacks").Clonable;
29
+ readonly isType: (value: unknown) => value is import("../revivables/fallbacks.js").Clonable;
30
+ readonly box: (value: import("../revivables/fallbacks.js").Clonable, _context: import("../index.js").RevivableContext<any>) => import("../revivables/fallbacks.js").Clonable;
31
+ readonly revive: (value: import("../revivables/fallbacks.js").BoxedClonable, _context: import("../index.js").RevivableContext<any>) => import("../revivables/fallbacks.js").Clonable;
32
32
  }, {
33
33
  readonly type: 'transferable';
34
34
  readonly capableOnly: true;
35
- readonly isType: (value: unknown) => value is import("../revivables/fallbacks").Transferable;
36
- readonly box: (value: import("../revivables/fallbacks").Transferable, _context: import("..").RevivableContext<any>) => import("../revivables/fallbacks").Transferable;
37
- readonly revive: (value: import("../revivables/fallbacks").BoxedTransferable, _context: import("..").RevivableContext<any>) => import("../revivables/fallbacks").Transferable;
38
- }, typeof import("../revivables/event-target"), {
35
+ readonly isType: (value: unknown) => value is import("../revivables/fallbacks.js").Transferable;
36
+ readonly box: (value: import("../revivables/fallbacks.js").Transferable, _context: import("../index.js").RevivableContext<any>) => import("../revivables/fallbacks.js").Transferable;
37
+ readonly revive: (value: import("../revivables/fallbacks.js").BoxedTransferable, _context: import("../index.js").RevivableContext<any>) => import("../revivables/fallbacks.js").Transferable;
38
+ }, typeof import("../revivables/event-target.js"), {
39
39
  readonly type: 'unclonable';
40
40
  readonly isType: (value: unknown) => value is never;
41
- readonly box: (_value: never, _context: import("..").RevivableContext<any>) => import("../revivables/fallbacks").BoxedUnclonable;
42
- readonly revive: (_value: import("../revivables/fallbacks").BoxedUnclonable, _context: import("..").RevivableContext<any>) => Record<string, never>;
41
+ readonly box: (_value: never, _context: import("../index.js").RevivableContext<any>) => import("../revivables/fallbacks.js").BoxedUnclonable;
42
+ readonly revive: (_value: import("../revivables/fallbacks.js").BoxedUnclonable, _context: import("../index.js").RevivableContext<any>) => Record<string, never>;
43
43
  }]>({ transport, value, remoteUuid, eventTarget, send, revivableModules }: {
44
44
  transport: Transport;
45
45
  value: Capable<TModules>;
@@ -1,11 +1,11 @@
1
- import type { DefaultRevivableModules, RevivableModule } from '../revivables';
2
- import type { ConnectionContext as BidirectionalConnectionContext } from './bidirectional';
3
- import type { ProtocolContext, StartConnectionsOptions } from '../utils';
4
- import type { Capable } from '../types';
5
- import * as bidirectional from './bidirectional';
6
- export * from './bidirectional';
7
- export * from './relay';
8
- export * from './utils';
1
+ import type { DefaultRevivableModules, RevivableModule } from '../revivables/index.js';
2
+ import type { ConnectionContext as BidirectionalConnectionContext } from './bidirectional.js';
3
+ import type { ProtocolContext, StartConnectionsOptions } from '../utils/index.js';
4
+ import type { Capable } from '../types.js';
5
+ import * as bidirectional from './bidirectional.js';
6
+ export * from './bidirectional.js';
7
+ export * from './relay.js';
8
+ export * from './utils.js';
9
9
  export type ConnectionModule<T> = {
10
10
  readonly type: string;
11
11
  readonly init: (ctx: ProtocolContext<any>) => void;
@@ -1,4 +1,4 @@
1
- import type { Transport } from '../utils/transport';
1
+ import type { Transport } from '../utils/transport.js';
2
2
  export type RelayOptions = {
3
3
  key?: string;
4
4
  origin?: string;
@@ -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
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 } 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. */