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,6 +1,6 @@
1
- import type { Capable } from '../types';
2
- import type { RevivableContext, BoxBase as BoxBaseType } from './utils';
3
- import type { BoxedMessagePort } from './message-port';
1
+ import type { Capable } from '../types.js';
2
+ import type { RevivableContext, BoxBase as BoxBaseType } from './utils.js';
3
+ import type { BoxedMessagePort } from './message-port.js';
4
4
  export declare const type: 'abortSignal';
5
5
  type AbortMessage = {
6
6
  type: 'abort';
@@ -1,8 +1,8 @@
1
- import type { RevivableContext } from './utils';
1
+ import type { RevivableContext } from './utils.js';
2
2
  export declare const type: 'arrayBuffer';
3
3
  export declare const isType: (value: unknown) => value is ArrayBuffer;
4
4
  export declare const box: <T extends ArrayBuffer, T2 extends RevivableContext>(value: T, context: T2) => {
5
5
  __OSRA_BOX__: 'revivable';
6
6
  type: "arrayBuffer";
7
- } & import("./utils").BoxedBuffer<T2>;
7
+ } & import("./utils.js").BoxedBuffer<T2>;
8
8
  export declare const revive: <T extends ReturnType<typeof box>>(value: T, _context: RevivableContext) => ArrayBuffer;
@@ -1,4 +1,4 @@
1
- import type { RevivableContext } from './utils';
1
+ import type { RevivableContext } from './utils.js';
2
2
  export declare const type: 'bigint';
3
3
  export declare const isType: (value: unknown) => value is bigint;
4
4
  export declare const box: <T extends bigint, T2 extends RevivableContext>(value: T, _context: T2) => {
@@ -1,6 +1,6 @@
1
- import type { RevivableContext, BoxBase as BoxBaseType } from './utils';
2
- import type { UnderlyingType } from '../utils/type';
3
- import type { BoxedPromise } from './promise';
1
+ import type { RevivableContext, BoxBase as BoxBaseType } from './utils.js';
2
+ import type { UnderlyingType } from '../utils/type.js';
3
+ import type { BoxedPromise } from './promise.js';
4
4
  export declare const type: 'blob';
5
5
  export type BoxedBlob<T extends Blob = Blob> = BoxBaseType<typeof type> & {
6
6
  mimeType: string;
@@ -1,4 +1,4 @@
1
- import type { RevivableContext } from './utils';
1
+ import type { RevivableContext } from './utils.js';
2
2
  export declare const type: 'date';
3
3
  export declare const isType: (value: unknown) => value is Date;
4
4
  export declare const box: <T extends Date, T2 extends RevivableContext>(value: T, _context: T2) => {
@@ -1,5 +1,5 @@
1
- import type { Capable } from '../types';
2
- import type { RevivableContext, BoxBase as BoxBaseType } from './utils';
1
+ import type { Capable } from '../types.js';
2
+ import type { RevivableContext, BoxBase as BoxBaseType } from './utils.js';
3
3
  export declare const type: 'error';
4
4
  export type BoxedError = BoxBaseType<typeof type> & {
5
5
  name: string;
@@ -1,4 +1,4 @@
1
- import { type RevivableContext } from './utils';
1
+ import { type RevivableContext } from './utils.js';
2
2
  export declare const type: 'eventTarget';
3
3
  type ListenerOpts = boolean | {
4
4
  capture?: boolean;
@@ -10,8 +10,8 @@ export declare const isType: (value: unknown) => value is EventTarget;
10
10
  export declare const box: <T extends EventTarget, T2 extends RevivableContext>(value: T, context: T2) => {
11
11
  __OSRA_BOX__: 'revivable';
12
12
  type: "eventTarget";
13
- addListener: import("./function").BoxedFunction<(type: string, listener: EventListener, options?: ListenerOpts) => void>;
14
- removeListener: import("./function").BoxedFunction<(type: string, listener: EventListener, options?: ListenerOpts) => void>;
13
+ addListener: import("./function.js").BoxedFunction<(type: string, listener: EventListener, options?: ListenerOpts) => void>;
14
+ removeListener: import("./function.js").BoxedFunction<(type: string, listener: EventListener, options?: ListenerOpts) => void>;
15
15
  };
16
16
  export type BoxedEventTarget = ReturnType<typeof box>;
17
17
  export declare const revive: <T extends ReturnType<typeof box>, T2 extends RevivableContext>(value: T, context: T2) => EventTarget;
@@ -1,5 +1,5 @@
1
- import type { Capable } from '../types';
2
- import type { RevivableContext, BoxBase as BoxBaseType } from './utils';
1
+ import type { Capable } from '../types.js';
2
+ import type { RevivableContext, BoxBase as BoxBaseType } from './utils.js';
3
3
  export declare const type: 'event';
4
4
  /** Boxes Event/CustomEvent only. Subclass-specific fields (MessageEvent.data,
5
5
  * ErrorEvent.error, ProgressEvent.loaded, etc.) are dropped on the wire. */
@@ -1,4 +1,4 @@
1
- import type { BoxBase as BoxBaseType, RevivableContext } from './utils';
1
+ import type { BoxBase as BoxBaseType, RevivableContext } from './utils.js';
2
2
  declare const TYPED_CLONABLE_CTORS: readonly [{
3
3
  new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
4
4
  prototype: File;
@@ -1,7 +1,7 @@
1
- import type { Capable } from '../types';
2
- import type { UnderlyingType, RevivableContext, BoxBase as BoxBaseType } from './utils';
3
- import { type EventPort } from '../utils/event-channel';
4
- import { BoxedMessagePort } from './message-port';
1
+ import type { Capable } from '../types.js';
2
+ import type { UnderlyingType, RevivableContext, BoxBase as BoxBaseType } from './utils.js';
3
+ import { type EventPort } from '../utils/event-channel.js';
4
+ import { BoxedMessagePort } from './message-port.js';
5
5
  export declare const type: 'function';
6
6
  type CallContext = [EventPort<Capable>, Capable[]];
7
7
  export type BoxedFunction<T extends (...args: any[]) => any = (...args: any[]) => any> = BoxBaseType<typeof type> & {
@@ -1,4 +1,4 @@
1
- import type { RevivableContext } from './utils';
1
+ import type { RevivableContext } from './utils.js';
2
2
  export declare const type: 'headers';
3
3
  export declare const isType: (value: unknown) => value is Headers;
4
4
  export declare const box: <T extends Headers, T2 extends RevivableContext>(value: T, _context: T2) => {
@@ -1,6 +1,6 @@
1
- import type { Capable, Uuid } from '../types';
2
- import type { RevivableContext, BoxBase as BoxBaseType } from './utils';
3
- import type { UnderlyingType } from '../utils/type';
1
+ import type { Capable, Uuid } from '../types.js';
2
+ import type { RevivableContext, BoxBase as BoxBaseType } from './utils.js';
3
+ import type { UnderlyingType } from '../utils/type.js';
4
4
  export declare const type: 'identity';
5
5
  export type Messages = {
6
6
  type: 'identity-dispose';
@@ -1,31 +1,31 @@
1
- import type { BoxBase, RevivableContext } from './utils';
2
- import type { DeepReplaceWithBox, DeepReplaceWithRevive, ReplaceWithBox, ReplaceWithRevive } from '../utils/replace';
3
- import type { MessageFields, Capable } from '../types';
4
- import * as arrayBuffer from './array-buffer';
5
- import * as date from './date';
6
- import * as headers from './headers';
7
- import * as error from './error';
8
- import * as typedArray from './typed-array';
9
- import * as promise from './promise';
10
- import * as func from './function';
11
- import * as messagePort from './message-port';
12
- import * as readableStream from './readable-stream';
13
- import * as writableStream from './writable-stream';
14
- import * as abortSignal from './abort-signal';
15
- import * as response from './response';
16
- import * as request from './request';
17
- import * as identity from './identity';
18
- import * as transfer from './transfer';
19
- import * as map from './map';
20
- import * as set from './set';
21
- import * as bigInt from './bigint';
22
- import * as event from './event';
23
- import * as eventTarget from './event-target';
24
- import * as blob from './blob';
25
- import * as symbol from './symbol';
26
- export { identity } from './identity';
27
- export { transfer } from './transfer';
28
- export * from './utils';
1
+ import type { BoxBase, RevivableContext } from './utils.js';
2
+ import type { DeepReplaceWithBox, DeepReplaceWithRevive, ReplaceWithBox, ReplaceWithRevive } from '../utils/replace.js';
3
+ import type { MessageFields, Capable } from '../types.js';
4
+ import * as arrayBuffer from './array-buffer.js';
5
+ import * as date from './date.js';
6
+ import * as headers from './headers.js';
7
+ import * as error from './error.js';
8
+ import * as typedArray from './typed-array.js';
9
+ import * as promise from './promise.js';
10
+ import * as func from './function.js';
11
+ import * as messagePort from './message-port.js';
12
+ import * as readableStream from './readable-stream.js';
13
+ import * as writableStream from './writable-stream.js';
14
+ import * as abortSignal from './abort-signal.js';
15
+ import * as response from './response.js';
16
+ import * as request from './request.js';
17
+ import * as identity from './identity.js';
18
+ import * as transfer from './transfer.js';
19
+ import * as map from './map.js';
20
+ import * as set from './set.js';
21
+ import * as bigInt from './bigint.js';
22
+ import * as event from './event.js';
23
+ import * as eventTarget from './event-target.js';
24
+ import * as blob from './blob.js';
25
+ import * as symbol from './symbol.js';
26
+ export { identity } from './identity.js';
27
+ export { transfer } from './transfer.js';
28
+ export * from './utils.js';
29
29
  export type RevivableModule<T extends string = string, T2 = any, T3 extends BoxBase<T> = any, T4 extends MessageFields = MessageFields> = {
30
30
  readonly type: T;
31
31
  readonly isType: (value: unknown) => value is T2;
@@ -37,20 +37,20 @@ export type RevivableModule<T extends string = string, T2 = any, T3 extends BoxB
37
37
  export declare const defaultRevivableModules: readonly [typeof transfer, typeof identity, typeof arrayBuffer, typeof date, typeof headers, typeof error, typeof typedArray, typeof blob, typeof promise, typeof func, typeof messagePort, typeof readableStream, typeof writableStream, typeof abortSignal, typeof response, typeof request, typeof map, typeof set, typeof bigInt, typeof symbol, typeof event, {
38
38
  readonly type: 'clonable';
39
39
  readonly capableOnly: true;
40
- readonly isType: (value: unknown) => value is import("./fallbacks").Clonable;
41
- readonly box: (value: import("./fallbacks").Clonable, _context: RevivableContext<any>) => import("./fallbacks").Clonable;
42
- readonly revive: (value: import("./fallbacks").BoxedClonable, _context: RevivableContext<any>) => import("./fallbacks").Clonable;
40
+ readonly isType: (value: unknown) => value is import("./fallbacks.js").Clonable;
41
+ readonly box: (value: import("./fallbacks.js").Clonable, _context: RevivableContext<any>) => import("./fallbacks.js").Clonable;
42
+ readonly revive: (value: import("./fallbacks.js").BoxedClonable, _context: RevivableContext<any>) => import("./fallbacks.js").Clonable;
43
43
  }, {
44
44
  readonly type: 'transferable';
45
45
  readonly capableOnly: true;
46
- readonly isType: (value: unknown) => value is import("./fallbacks").Transferable;
47
- readonly box: (value: import("./fallbacks").Transferable, _context: RevivableContext<any>) => import("./fallbacks").Transferable;
48
- readonly revive: (value: import("./fallbacks").BoxedTransferable, _context: RevivableContext<any>) => import("./fallbacks").Transferable;
46
+ readonly isType: (value: unknown) => value is import("./fallbacks.js").Transferable;
47
+ readonly box: (value: import("./fallbacks.js").Transferable, _context: RevivableContext<any>) => import("./fallbacks.js").Transferable;
48
+ readonly revive: (value: import("./fallbacks.js").BoxedTransferable, _context: RevivableContext<any>) => import("./fallbacks.js").Transferable;
49
49
  }, typeof eventTarget, {
50
50
  readonly type: 'unclonable';
51
51
  readonly isType: (value: unknown) => value is never;
52
- readonly box: (_value: never, _context: RevivableContext<any>) => import("./fallbacks").BoxedUnclonable;
53
- readonly revive: (_value: import("./fallbacks").BoxedUnclonable, _context: RevivableContext<any>) => Record<string, never>;
52
+ readonly box: (_value: never, _context: RevivableContext<any>) => import("./fallbacks.js").BoxedUnclonable;
53
+ readonly revive: (_value: import("./fallbacks.js").BoxedUnclonable, _context: RevivableContext<any>) => Record<string, never>;
54
54
  }];
55
55
  export type DefaultRevivableModules = typeof defaultRevivableModules;
56
56
  export type DefaultRevivableModule = DefaultRevivableModules[number];
@@ -1,5 +1,5 @@
1
- import type { Capable } from '../types';
2
- import type { RevivableContext, UnderlyingType, BoxBase as BoxBaseType } from './utils';
1
+ import type { Capable } from '../types.js';
2
+ import type { RevivableContext, UnderlyingType, BoxBase as BoxBaseType } from './utils.js';
3
3
  export declare const type: 'map';
4
4
  export type BoxedMap<T extends Map<Capable, Capable> = Map<Capable, Capable>> = BoxBaseType<typeof type> & {
5
5
  entries: Array<[Capable, Capable]>;
@@ -1,9 +1,9 @@
1
- import type { Capable, StructurableTransferable, Uuid } from '../types';
2
- import type { TypedMessagePort } from '../utils/typed-message-channel';
3
- import type { RevivableContext, BoxBase as BoxBaseType } from './utils';
4
- import type { UnderlyingType } from '../utils/type';
5
- import type { BadFieldValue, BadFieldPath, BadFieldParent, ErrorMessage, BadValue, Path, ParentObject } from '../utils/capable-check';
6
- import { EventPort } from '../utils/event-channel';
1
+ import type { Capable, StructurableTransferable, Uuid } from '../types.js';
2
+ import type { TypedMessagePort } from '../utils/typed-message-channel.js';
3
+ import type { RevivableContext, BoxBase as BoxBaseType } from './utils.js';
4
+ import type { UnderlyingType } from '../utils/type.js';
5
+ import type { BadFieldValue, BadFieldPath, BadFieldParent, ErrorMessage, BadValue, Path, ParentObject } from '../utils/capable-check.js';
6
+ import { EventPort } from '../utils/event-channel.js';
7
7
  export declare const type: 'messagePort';
8
8
  export type Messages = {
9
9
  type: 'message';
@@ -1,8 +1,8 @@
1
- import type { Capable } from '../types';
2
- import type { RevivableContext, BoxBase as BoxBaseType } from './utils';
3
- import type { UnderlyingType } from '.';
4
- import type { BadFieldValue, BadFieldPath, BadFieldParent, ErrorMessage, BadValue, Path, ParentObject } from '../utils/capable-check';
5
- import { BoxedMessagePort } from './message-port';
1
+ import type { Capable } from '../types.js';
2
+ import type { RevivableContext, BoxBase as BoxBaseType } from './utils.js';
3
+ import type { UnderlyingType } from './index.js';
4
+ import type { BadFieldValue, BadFieldPath, BadFieldParent, ErrorMessage, BadValue, Path, ParentObject } from '../utils/capable-check.js';
5
+ import { BoxedMessagePort } from './message-port.js';
6
6
  export declare const type: 'promise';
7
7
  export type Context = {
8
8
  type: 'resolve';
@@ -1,6 +1,6 @@
1
- import type { RevivableContext, BoxBase as BoxBaseType } from './utils';
2
- import type { UnderlyingType } from '.';
3
- import { BoxedMessagePort } from './message-port';
1
+ import type { RevivableContext, BoxBase as BoxBaseType } from './utils.js';
2
+ import type { UnderlyingType } from './index.js';
3
+ import { BoxedMessagePort } from './message-port.js';
4
4
  export declare const type: 'readableStream';
5
5
  export type PullContext = {
6
6
  type: 'pull' | 'cancel';
@@ -1,4 +1,4 @@
1
- import type { RevivableContext } from './utils';
1
+ import type { RevivableContext } from './utils.js';
2
2
  export declare const type: 'request';
3
3
  export declare const isType: (value: unknown) => value is Request;
4
4
  export declare const box: <T extends Request, T2 extends RevivableContext>(value: T, context: T2) => {
@@ -11,7 +11,7 @@ export declare const box: <T extends Request, T2 extends RevivableContext>(value
11
11
  type: "headers";
12
12
  entries: [string, string][];
13
13
  };
14
- body: import("./readable-stream").BoxedReadableStream<ReadableStream<Uint8Array<ArrayBuffer>>> | null;
14
+ body: import("./readable-stream.js").BoxedReadableStream<ReadableStream<Uint8Array<ArrayBuffer>>> | null;
15
15
  credentials: RequestCredentials;
16
16
  cache: RequestCache;
17
17
  redirect: RequestRedirect;
@@ -1,4 +1,4 @@
1
- import type { RevivableContext } from './utils';
1
+ import type { RevivableContext } from './utils.js';
2
2
  export declare const type: 'response';
3
3
  export declare const isType: (value: unknown) => value is Response;
4
4
  export declare const box: <T extends Response, T2 extends RevivableContext>(value: T, context: T2) => {
@@ -11,7 +11,7 @@ export declare const box: <T extends Response, T2 extends RevivableContext>(valu
11
11
  type: "headers";
12
12
  entries: [string, string][];
13
13
  };
14
- body: import("./readable-stream").BoxedReadableStream<ReadableStream<Uint8Array<ArrayBuffer>>> | null;
14
+ body: import("./readable-stream.js").BoxedReadableStream<ReadableStream<Uint8Array<ArrayBuffer>>> | null;
15
15
  url: string;
16
16
  redirected: boolean;
17
17
  };
@@ -1,5 +1,5 @@
1
- import type { Capable } from '../types';
2
- import type { RevivableContext, UnderlyingType, BoxBase as BoxBaseType } from './utils';
1
+ import type { Capable } from '../types.js';
2
+ import type { RevivableContext, UnderlyingType, BoxBase as BoxBaseType } from './utils.js';
3
3
  export declare const type: 'set';
4
4
  export type BoxedSet<T extends Set<Capable> = Set<Capable>> = BoxBaseType<typeof type> & {
5
5
  values: Array<Capable>;
@@ -1,11 +1,11 @@
1
- import type { RevivableContext } from './utils';
1
+ import type { RevivableContext } from './utils.js';
2
2
  export declare const type: 'symbol';
3
3
  export declare const isType: (value: unknown) => value is symbol;
4
4
  export declare const box: <T extends symbol, T2 extends RevivableContext>(value: T, context: T2) => {
5
5
  __OSRA_BOX__: 'revivable';
6
6
  type: "symbol";
7
7
  description: string | undefined;
8
- } | import("./identity").BoxedIdentity<import("..").Capable>;
8
+ } | import("./identity.js").BoxedIdentity<import("../types.js").Capable>;
9
9
  export declare const revive: <T extends {
10
10
  description: string | undefined;
11
11
  }, T2 extends RevivableContext>(value: T, _context: T2) => symbol;
@@ -1,5 +1,5 @@
1
- import type { Capable } from '../types';
2
- import type { BoxBase as BoxBaseType, RevivableContext, UnderlyingType } from './utils';
1
+ import type { Capable } from '../types.js';
2
+ import type { BoxBase as BoxBaseType, RevivableContext, UnderlyingType } from './utils.js';
3
3
  export declare const type: 'transfer';
4
4
  declare const TRANSFER_MARKER: unique symbol;
5
5
  type TransferWrapper<T = unknown> = {
@@ -1,6 +1,6 @@
1
- import type { RevivableContext, UnderlyingType, BoxedBuffer } from './utils';
2
- import type { TypedArray, TypedArrayType } from '../utils/type-guards';
3
- import { BoxBase } from './utils';
1
+ import type { RevivableContext, UnderlyingType, BoxedBuffer } from './utils.js';
2
+ import type { TypedArray, TypedArrayType } from '../utils/type-guards.js';
3
+ import { BoxBase } from './utils.js';
4
4
  export declare const type: 'typedArray';
5
5
  type BoxedTypedArray<T extends TypedArray, T2 extends RevivableContext> = typeof BoxBase & {
6
6
  type: typeof type;
@@ -1,8 +1,8 @@
1
- import type { DefaultRevivableModules, RevivableModule } from '.';
2
- import type { MessageEventTarget, MessageFields, Uuid } from '../types';
3
- import type { Transport } from '../utils/transport';
4
- import type { IsJsonOnlyTransport } from '../utils/type-guards';
5
- export type { UnderlyingType } from '../utils/type';
1
+ import type { DefaultRevivableModules, RevivableModule } from './index.js';
2
+ import type { MessageEventTarget, MessageFields, Uuid } from '../types.js';
3
+ import type { Transport } from '../utils/transport.js';
4
+ import type { IsJsonOnlyTransport } from '../utils/type-guards.js';
5
+ export type { UnderlyingType } from '../utils/type.js';
6
6
  export declare const BoxBase: {
7
7
  readonly __OSRA_BOX__: 'revivable';
8
8
  };
@@ -1,7 +1,7 @@
1
- import type { RevivableContext, BoxBase as BoxBaseType } from './utils';
2
- import type { UnderlyingType } from '.';
3
- import type { Capable } from '../types';
4
- import { BoxedMessagePort } from './message-port';
1
+ import type { RevivableContext, BoxBase as BoxBaseType } from './utils.js';
2
+ import type { UnderlyingType } from './index.js';
3
+ import type { Capable } from '../types.js';
4
+ import { BoxedMessagePort } from './message-port.js';
5
5
  export declare const type: 'writableStream';
6
6
  export type WriteContext = {
7
7
  type: 'write';
package/build/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import type { ConnectionMessage } from './connections';
2
- import type { TypedEventTarget } from './utils';
3
- import type { IsJsonOnlyTransport } from './utils/type-guards';
4
- import type { DefaultRevivableModules, RevivableModule, InferMessages, InferRevivables, RevivableContext } from './revivables';
1
+ import type { ConnectionMessage } from './connections/index.js';
2
+ import type { TypedEventTarget } from './utils/index.js';
3
+ import type { IsJsonOnlyTransport } from './utils/type-guards.js';
4
+ import type { DefaultRevivableModules, RevivableModule, InferMessages, InferRevivables, RevivableContext } from './revivables/index.js';
5
5
  export declare const OSRA_KEY: '__OSRA_KEY__';
6
6
  export declare const OSRA_DEFAULT_KEY: '__OSRA_DEFAULT_KEY__';
7
7
  export declare const OSRA_BOX: '__OSRA_BOX__';
@@ -1,4 +1,4 @@
1
- import type { TypedMessagePort, TypedMessagePortEventMap } from './typed-message-channel';
1
+ import type { TypedMessagePort, TypedMessagePortEventMap } from './typed-message-channel.js';
2
2
  export declare class EventPort<T> extends EventTarget {
3
3
  addEventListener<K extends keyof TypedMessagePortEventMap<T> & string>(type: K, listener: ((event: TypedMessagePortEventMap<T>[K]) => void) | null, options?: boolean | AddEventListenerOptions): void;
4
4
  addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
@@ -1,12 +1,12 @@
1
- export * from './transport';
2
- export * from '../revivables';
3
- export * from './replace';
4
- export * from '../connections';
5
- export * from './transferable';
6
- export * from './type-guards';
7
- export * from './typed-event-target';
8
- export * from './typed-message-channel';
9
- export * from './event-channel';
10
- export * from './type';
11
- export * from './capable-check';
12
- export * from './gc-tracker';
1
+ export * from './transport.js';
2
+ export * from '../revivables/index.js';
3
+ export * from './replace.js';
4
+ export * from '../connections/index.js';
5
+ export * from './transferable.js';
6
+ export * from './type-guards.js';
7
+ export * from './typed-event-target.js';
8
+ export * from './typed-message-channel.js';
9
+ export * from './event-channel.js';
10
+ export * from './type.js';
11
+ export * from './capable-check.js';
12
+ export * from './gc-tracker.js';
@@ -1,4 +1,4 @@
1
- import { transfer } from '../revivables/transfer';
1
+ import { transfer } from '../revivables/transfer.js';
2
2
  export { transfer };
3
3
  /** Walk a boxed message and collect Transferables to move (rather than copy)
4
4
  * on postMessage:
@@ -1,5 +1,5 @@
1
- import type { Message } from '../types';
2
- import type { WebExtOnConnect, WebExtOnMessage, WebExtPort, WebExtRuntime, WebExtSender } from './type-guards';
1
+ import type { Message } from '../types.js';
2
+ import type { WebExtOnConnect, WebExtOnMessage, WebExtPort, WebExtRuntime, WebExtSender } from './type-guards.js';
3
3
  export type MessageContext = {
4
4
  port?: MessagePort | WebExtPort;
5
5
  sender?: WebExtSender;
@@ -1,6 +1,6 @@
1
1
  import type { Runtime } from 'webextension-polyfill';
2
- import type { Message } from '../types';
3
- import type { CustomEmitTransport, CustomReceiveTransport, CustomTransport, EmitJsonPlatformTransport, EmitTransport, JsonPlatformTransport, ReceiveJsonPlatformTransport, ReceiveTransport, Transport } from './transport';
2
+ import type { Message } from '../types.js';
3
+ import type { CustomEmitTransport, CustomReceiveTransport, CustomTransport, EmitJsonPlatformTransport, EmitTransport, JsonPlatformTransport, ReceiveJsonPlatformTransport, ReceiveTransport, Transport } from './transport.js';
4
4
  declare const typedArrayConstructorsByName: {
5
5
  readonly Int8Array: Int8ArrayConstructor;
6
6
  readonly Uint8Array: Uint8ArrayConstructor;
@@ -1,4 +1,4 @@
1
- import type { UnderlyingType } from './type';
1
+ import type { UnderlyingType } from './type.js';
2
2
  export type EventMap = Record<string, Event>;
3
3
  export interface TypedEventTarget<T extends EventMap> extends EventTarget {
4
4
  [UnderlyingType]?: T;
@@ -1,5 +1,5 @@
1
- import type { UnderlyingType } from './type';
2
- import type { TypedEventTarget } from './typed-event-target';
1
+ import type { UnderlyingType } from './type.js';
2
+ import type { TypedEventTarget } from './typed-event-target.js';
3
3
  export type TypedMessagePortEventMap<T = unknown> = {
4
4
  'message': MessageEvent<T>;
5
5
  'messageerror': MessageEvent;
package/package.json CHANGED
@@ -1,11 +1,18 @@
1
1
  {
2
2
  "name": "osra",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "Easy communication between workers",
5
5
  "files": [
6
6
  "build"
7
7
  ],
8
8
  "main": "build/index.js",
9
+ "types": "./build/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./build/index.d.ts",
13
+ "import": "./build/index.js"
14
+ }
15
+ },
9
16
  "type": "module",
10
17
  "scripts": {
11
18
  "build": "vite build && tsgo --declaration --emitDeclarationOnly",
@@ -38,6 +45,9 @@
38
45
  "url": "https://github.com/Banou26/osra/issues"
39
46
  },
40
47
  "homepage": "https://github.com/Banou26/osra#readme",
48
+ "dependencies": {
49
+ "@types/webextension-polyfill": "^0.12.4"
50
+ },
41
51
  "devDependencies": {
42
52
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
43
53
  "@playwright/test": "^1.58.2",
@@ -46,8 +56,7 @@
46
56
  "@types/chrome": "^0.1.27",
47
57
  "@types/firefox-webext-browser": "^143.0.0",
48
58
  "@types/node": "^25.0.2",
49
- "@types/webextension-polyfill": "^0.12.4",
50
- "@typescript/native-preview": "^7.0.0-dev.20260404.1",
59
+ "@typescript/native-preview": "7.0.0-dev.20260404.1",
51
60
  "chai": "^5.3.3",
52
61
  "chai-as-promised": "^8.0.1",
53
62
  "concurrently": "^9.1.0",