@aztec/foundation 0.74.0 → 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2
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/dest/abi/abi.js +157 -93
- package/dest/abi/buffer.js +9 -9
- package/dest/abi/decoder.js +89 -86
- package/dest/abi/encoder.js +91 -87
- package/dest/abi/event_selector.js +25 -33
- package/dest/abi/function_selector.js +28 -33
- package/dest/abi/index.js +0 -1
- package/dest/abi/note_selector.js +15 -21
- package/dest/abi/selector.js +22 -29
- package/dest/abi/u128.js +11 -5
- package/dest/abi/utils.js +9 -20
- package/dest/array/array.js +19 -26
- package/dest/array/index.js +0 -1
- package/dest/async-map/index.js +2 -4
- package/dest/async-pool/index.js +6 -9
- package/dest/aztec-address/index.js +14 -19
- package/dest/bigint-buffer/index.js +6 -13
- package/dest/buffer/buffer32.js +53 -66
- package/dest/buffer/index.js +0 -1
- package/dest/collection/array.js +47 -59
- package/dest/collection/index.js +0 -1
- package/dest/collection/object.js +9 -9
- package/dest/committable/committable.js +15 -20
- package/dest/committable/index.js +0 -1
- package/dest/config/env_var.js +1 -2
- package/dest/config/index.js +31 -36
- package/dest/crypto/index.js +0 -1
- package/dest/crypto/keccak/index.js +60 -69
- package/dest/crypto/keys/index.js +1 -2
- package/dest/crypto/pedersen/index.js +0 -1
- package/dest/crypto/pedersen/pedersen.elliptic.js +153 -146
- package/dest/crypto/pedersen/pedersen.noble.js +140 -142
- package/dest/crypto/pedersen/pedersen.wasm.js +14 -13
- package/dest/crypto/poseidon/index.js +10 -14
- package/dest/crypto/random/index.js +7 -12
- package/dest/crypto/random/randomness_singleton.js +12 -12
- package/dest/crypto/secp256k1-signer/index.js +0 -1
- package/dest/crypto/secp256k1-signer/secp256k1_signer.js +8 -9
- package/dest/crypto/secp256k1-signer/utils.js +11 -16
- package/dest/crypto/sha256/index.js +80 -30
- package/dest/crypto/sha512/index.js +2 -4
- package/dest/crypto/sync/index.js +0 -1
- package/dest/crypto/sync/pedersen/index.js +14 -13
- package/dest/crypto/sync/poseidon/index.js +10 -14
- package/dest/decorators/index.js +0 -1
- package/dest/decorators/memoize.js +1 -2
- package/dest/error/index.js +6 -19
- package/dest/eth-address/index.js +92 -113
- package/dest/eth-signature/eth_signature.js +21 -27
- package/dest/eth-signature/index.js +0 -1
- package/dest/fields/coordinate.js +47 -46
- package/dest/fields/fields.js +112 -127
- package/dest/fields/index.js +0 -1
- package/dest/fields/point.js +119 -129
- package/dest/fs/index.js +0 -1
- package/dest/fs/run_in_dir.js +6 -6
- package/dest/index.js +0 -2
- package/dest/iterable/all.js +3 -4
- package/dest/iterable/filter.js +10 -11
- package/dest/iterable/index.js +0 -1
- package/dest/iterable/isAsyncIt.js +1 -3
- package/dest/iterable/map.js +10 -11
- package/dest/iterable/peek.js +14 -14
- package/dest/iterable/sort.js +4 -5
- package/dest/iterable/take.js +6 -7
- package/dest/iterable/toArray.js +1 -2
- package/dest/jest/setup.js +7 -0
- package/dest/json-rpc/client/fetch.js +21 -19
- package/dest/json-rpc/client/index.js +0 -1
- package/dest/json-rpc/client/safe_json_rpc_client.js +16 -8
- package/dest/json-rpc/convert.js +10 -20
- package/dest/json-rpc/fixtures/class_a.js +8 -5
- package/dest/json-rpc/fixtures/class_b.js +8 -5
- package/dest/json-rpc/fixtures/test_state.js +53 -40
- package/dest/json-rpc/index.js +0 -1
- package/dest/json-rpc/js_utils.js +2 -5
- package/dest/json-rpc/server/index.js +0 -1
- package/dest/json-rpc/server/safe_json_rpc_server.js +145 -101
- package/dest/json-rpc/server/telemetry.js +0 -2
- package/dest/json-rpc/test/index.js +0 -1
- package/dest/json-rpc/test/integration.js +8 -3
- package/dest/log/console.js +14 -16
- package/dest/log/debug.js +9 -18
- package/dest/log/gcloud-logger-config.js +17 -15
- package/dest/log/index.js +0 -1
- package/dest/log/log-filters.js +13 -11
- package/dest/log/log-levels.js +10 -2
- package/dest/log/log_fn.js +1 -2
- package/dest/log/log_history.js +21 -25
- package/dest/log/pino-logger.js +82 -64
- package/dest/message/index.js +7 -3
- package/dest/mutex/index.js +34 -32
- package/dest/mutex/mutex_database.js +4 -2
- package/dest/noir/index.js +0 -1
- package/dest/noir/noir_package_config.js +13 -8
- package/dest/promise/index.js +0 -1
- package/dest/promise/running-promise.js +28 -28
- package/dest/promise/utils.js +3 -5
- package/dest/queue/base_memory_queue.js +51 -59
- package/dest/queue/bounded_serial_queue.js +41 -51
- package/dest/queue/fifo_memory_queue.js +4 -8
- package/dest/queue/index.js +0 -1
- package/dest/queue/priority_memory_queue.js +3 -4
- package/dest/queue/priority_queue.js +5 -5
- package/dest/queue/semaphore.js +15 -19
- package/dest/queue/serial_queue.js +37 -47
- package/dest/retry/index.js +21 -18
- package/dest/running-promise/index.js +0 -1
- package/dest/schemas/api.js +2 -7
- package/dest/schemas/index.js +0 -1
- package/dest/schemas/parse.js +4 -8
- package/dest/schemas/schemas.js +33 -48
- package/dest/schemas/types.js +1 -2
- package/dest/schemas/utils.js +18 -31
- package/dest/serialize/buffer_reader.js +164 -188
- package/dest/serialize/field_reader.js +70 -79
- package/dest/serialize/free_funcs.js +40 -37
- package/dest/serialize/index.js +0 -1
- package/dest/serialize/serialize.js +72 -83
- package/dest/serialize/type_registry.js +10 -14
- package/dest/serialize/types.js +4 -5
- package/dest/sleep/index.js +25 -29
- package/dest/string/index.js +0 -1
- package/dest/testing/files/index.js +5 -8
- package/dest/testing/index.js +0 -1
- package/dest/testing/port_allocator.js +7 -10
- package/dest/testing/snapshot_serializer.js +14 -9
- package/dest/testing/test_data.js +7 -8
- package/dest/timer/date.js +9 -7
- package/dest/timer/elapsed.js +10 -7
- package/dest/timer/index.js +0 -1
- package/dest/timer/timeout.js +34 -34
- package/dest/timer/timer.js +17 -21
- package/dest/transport/browser/index.js +0 -1
- package/dest/transport/browser/message_port_socket.js +26 -30
- package/dest/transport/browser/shared_worker_connector.js +8 -10
- package/dest/transport/browser/shared_worker_listener.js +13 -17
- package/dest/transport/browser/worker_connector.js +12 -12
- package/dest/transport/browser/worker_listener.js +13 -17
- package/dest/transport/dispatch/create_dispatch_fn.js +2 -4
- package/dest/transport/dispatch/create_dispatch_proxy.js +16 -13
- package/dest/transport/dispatch/messages.js +4 -3
- package/dest/transport/index.js +0 -1
- package/dest/transport/interface/connector.js +3 -2
- package/dest/transport/interface/listener.js +4 -2
- package/dest/transport/interface/socket.js +7 -2
- package/dest/transport/interface/transferable.js +7 -9
- package/dest/transport/node/index.js +0 -1
- package/dest/transport/node/node_connector.js +9 -11
- package/dest/transport/node/node_connector_socket.js +21 -25
- package/dest/transport/node/node_listener.js +11 -15
- package/dest/transport/node/node_listener_socket.js +23 -27
- package/dest/transport/transport_client.js +47 -46
- package/dest/transport/transport_server.js +68 -55
- package/dest/trees/index.js +0 -1
- package/dest/trees/unbalanced_merkle_tree.js +26 -16
- package/dest/trees/unbalanced_tree_store.js +43 -29
- package/dest/types/index.js +1 -3
- package/dest/url/index.js +4 -8
- package/dest/validation/index.js +2 -5
- package/dest/wasm/empty_wasi_sdk.js +142 -160
- package/dest/wasm/index.js +0 -1
- package/dest/wasm/wasm_module.js +80 -90
- package/dest/worker/browser/index.js +0 -1
- package/dest/worker/browser/start_web_module.js +9 -5
- package/dest/worker/browser/web_data_store.js +12 -15
- package/dest/worker/browser/web_worker.js +6 -5
- package/dest/worker/data_store.js +3 -2
- package/dest/worker/index.js +0 -1
- package/dest/worker/node/index.js +0 -1
- package/dest/worker/node/node_data_store.js +4 -5
- package/dest/worker/node/node_worker.js +6 -5
- package/dest/worker/node/start_node_module.js +9 -5
- package/dest/worker/wasm_worker.js +3 -2
- package/dest/worker/worker_pool.js +32 -43
- package/package.json +3 -4
- package/src/fields/fields.ts +2 -2
- package/src/index.ts +0 -1
- package/src/queue/serial_queue.ts +1 -1
- package/src/testing/files/index.ts +2 -1
- package/src/wasm/index.ts +1 -1
- package/src/worker/index.ts +1 -1
- package/dest/abi/abi.d.ts +0 -853
- package/dest/abi/abi.d.ts.map +0 -1
- package/dest/abi/buffer.d.ts +0 -18
- package/dest/abi/buffer.d.ts.map +0 -1
- package/dest/abi/decoder.d.ts +0 -58
- package/dest/abi/decoder.d.ts.map +0 -1
- package/dest/abi/encoder.d.ts +0 -16
- package/dest/abi/encoder.d.ts.map +0 -1
- package/dest/abi/event_selector.d.ts +0 -52
- package/dest/abi/event_selector.d.ts.map +0 -1
- package/dest/abi/function_selector.d.ts +0 -65
- package/dest/abi/function_selector.d.ts.map +0 -1
- package/dest/abi/index.d.ts +0 -10
- package/dest/abi/index.d.ts.map +0 -1
- package/dest/abi/note_selector.d.ts +0 -42
- package/dest/abi/note_selector.d.ts.map +0 -1
- package/dest/abi/selector.d.ts +0 -42
- package/dest/abi/selector.d.ts.map +0 -1
- package/dest/abi/u128.d.ts +0 -13
- package/dest/abi/u128.d.ts.map +0 -1
- package/dest/abi/utils.d.ts +0 -44
- package/dest/abi/utils.d.ts.map +0 -1
- package/dest/array/array.d.ts +0 -71
- package/dest/array/array.d.ts.map +0 -1
- package/dest/array/index.d.ts +0 -2
- package/dest/array/index.d.ts.map +0 -1
- package/dest/async-map/index.d.ts +0 -13
- package/dest/async-map/index.d.ts.map +0 -1
- package/dest/async-pool/index.d.ts +0 -3
- package/dest/async-pool/index.d.ts.map +0 -1
- package/dest/aztec-address/index.d.ts +0 -57
- package/dest/aztec-address/index.d.ts.map +0 -1
- package/dest/bigint-buffer/index.d.ts +0 -42
- package/dest/bigint-buffer/index.d.ts.map +0 -1
- package/dest/blob/blob.d.ts +0 -154
- package/dest/blob/blob.d.ts.map +0 -1
- package/dest/blob/blob.js +0 -264
- package/dest/blob/encoding.d.ts +0 -53
- package/dest/blob/encoding.d.ts.map +0 -1
- package/dest/blob/encoding.js +0 -87
- package/dest/blob/errors.d.ts +0 -4
- package/dest/blob/errors.d.ts.map +0 -1
- package/dest/blob/errors.js +0 -7
- package/dest/blob/index.d.ts +0 -6
- package/dest/blob/index.d.ts.map +0 -1
- package/dest/blob/index.js +0 -22
- package/dest/blob/interface.d.ts +0 -10
- package/dest/blob/interface.d.ts.map +0 -1
- package/dest/blob/interface.js +0 -2
- package/dest/blob/mocks.d.ts +0 -20
- package/dest/blob/mocks.d.ts.map +0 -1
- package/dest/blob/mocks.js +0 -42
- package/dest/buffer/buffer32.d.ts +0 -91
- package/dest/buffer/buffer32.d.ts.map +0 -1
- package/dest/buffer/index.d.ts +0 -2
- package/dest/buffer/index.d.ts.map +0 -1
- package/dest/collection/array.d.ts +0 -101
- package/dest/collection/array.d.ts.map +0 -1
- package/dest/collection/index.d.ts +0 -3
- package/dest/collection/index.d.ts.map +0 -1
- package/dest/collection/object.d.ts +0 -14
- package/dest/collection/object.d.ts.map +0 -1
- package/dest/committable/committable.d.ts +0 -28
- package/dest/committable/committable.d.ts.map +0 -1
- package/dest/committable/index.d.ts +0 -2
- package/dest/committable/index.d.ts.map +0 -1
- package/dest/config/env_var.d.ts +0 -2
- package/dest/config/env_var.d.ts.map +0 -1
- package/dest/config/index.d.ts +0 -66
- package/dest/config/index.d.ts.map +0 -1
- package/dest/crypto/index.d.ts +0 -9
- package/dest/crypto/index.d.ts.map +0 -1
- package/dest/crypto/keccak/index.d.ts +0 -28
- package/dest/crypto/keccak/index.d.ts.map +0 -1
- package/dest/crypto/keys/index.d.ts +0 -5
- package/dest/crypto/keys/index.d.ts.map +0 -1
- package/dest/crypto/pedersen/index.d.ts +0 -2
- package/dest/crypto/pedersen/index.d.ts.map +0 -1
- package/dest/crypto/pedersen/pedersen.elliptic.d.ts +0 -13
- package/dest/crypto/pedersen/pedersen.elliptic.d.ts.map +0 -1
- package/dest/crypto/pedersen/pedersen.noble.d.ts +0 -11
- package/dest/crypto/pedersen/pedersen.noble.d.ts.map +0 -1
- package/dest/crypto/pedersen/pedersen.wasm.d.ts +0 -21
- package/dest/crypto/pedersen/pedersen.wasm.d.ts.map +0 -1
- package/dest/crypto/poseidon/index.d.ts +0 -26
- package/dest/crypto/poseidon/index.d.ts.map +0 -1
- package/dest/crypto/random/index.d.ts +0 -25
- package/dest/crypto/random/index.d.ts.map +0 -1
- package/dest/crypto/random/randomness_singleton.d.ts +0 -25
- package/dest/crypto/random/randomness_singleton.d.ts.map +0 -1
- package/dest/crypto/secp256k1-signer/index.d.ts +0 -3
- package/dest/crypto/secp256k1-signer/index.d.ts.map +0 -1
- package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts +0 -24
- package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts.map +0 -1
- package/dest/crypto/secp256k1-signer/utils.d.ts +0 -40
- package/dest/crypto/secp256k1-signer/utils.d.ts.map +0 -1
- package/dest/crypto/sha256/index.d.ts +0 -20
- package/dest/crypto/sha256/index.d.ts.map +0 -1
- package/dest/crypto/sha512/index.d.ts +0 -11
- package/dest/crypto/sha512/index.d.ts.map +0 -1
- package/dest/crypto/sync/index.d.ts +0 -3
- package/dest/crypto/sync/index.d.ts.map +0 -1
- package/dest/crypto/sync/pedersen/index.d.ts +0 -21
- package/dest/crypto/sync/pedersen/index.d.ts.map +0 -1
- package/dest/crypto/sync/poseidon/index.d.ts +0 -26
- package/dest/crypto/sync/poseidon/index.d.ts.map +0 -1
- package/dest/decorators/index.d.ts +0 -2
- package/dest/decorators/index.d.ts.map +0 -1
- package/dest/decorators/memoize.d.ts +0 -2
- package/dest/decorators/memoize.d.ts.map +0 -1
- package/dest/error/index.d.ts +0 -21
- package/dest/error/index.d.ts.map +0 -1
- package/dest/eth-address/index.d.ts +0 -134
- package/dest/eth-address/index.d.ts.map +0 -1
- package/dest/eth-signature/eth_signature.d.ts +0 -62
- package/dest/eth-signature/eth_signature.d.ts.map +0 -1
- package/dest/eth-signature/index.d.ts +0 -2
- package/dest/eth-signature/index.d.ts.map +0 -1
- package/dest/fields/coordinate.d.ts +0 -68
- package/dest/fields/coordinate.d.ts.map +0 -1
- package/dest/fields/fields.d.ts +0 -176
- package/dest/fields/fields.d.ts.map +0 -1
- package/dest/fields/index.d.ts +0 -4
- package/dest/fields/index.d.ts.map +0 -1
- package/dest/fields/point.d.ts +0 -175
- package/dest/fields/point.d.ts.map +0 -1
- package/dest/fs/index.d.ts +0 -2
- package/dest/fs/index.d.ts.map +0 -1
- package/dest/fs/run_in_dir.d.ts +0 -2
- package/dest/fs/run_in_dir.d.ts.map +0 -1
- package/dest/index.d.ts +0 -34
- package/dest/index.d.ts.map +0 -1
- package/dest/iterable/all.d.ts +0 -9
- package/dest/iterable/all.d.ts.map +0 -1
- package/dest/iterable/filter.d.ts +0 -10
- package/dest/iterable/filter.d.ts.map +0 -1
- package/dest/iterable/index.d.ts +0 -8
- package/dest/iterable/index.d.ts.map +0 -1
- package/dest/iterable/isAsyncIt.d.ts +0 -7
- package/dest/iterable/isAsyncIt.d.ts.map +0 -1
- package/dest/iterable/map.d.ts +0 -12
- package/dest/iterable/map.d.ts.map +0 -1
- package/dest/iterable/peek.d.ts +0 -19
- package/dest/iterable/peek.d.ts.map +0 -1
- package/dest/iterable/sort.d.ts +0 -14
- package/dest/iterable/sort.d.ts.map +0 -1
- package/dest/iterable/take.d.ts +0 -10
- package/dest/iterable/take.d.ts.map +0 -1
- package/dest/iterable/toArray.d.ts +0 -2
- package/dest/iterable/toArray.d.ts.map +0 -1
- package/dest/json-rpc/client/fetch.d.ts +0 -21
- package/dest/json-rpc/client/fetch.d.ts.map +0 -1
- package/dest/json-rpc/client/index.d.ts +0 -3
- package/dest/json-rpc/client/index.d.ts.map +0 -1
- package/dest/json-rpc/client/safe_json_rpc_client.d.ts +0 -13
- package/dest/json-rpc/client/safe_json_rpc_client.d.ts.map +0 -1
- package/dest/json-rpc/convert.d.ts +0 -20
- package/dest/json-rpc/convert.d.ts.map +0 -1
- package/dest/json-rpc/fixtures/class_a.d.ts +0 -11
- package/dest/json-rpc/fixtures/class_a.d.ts.map +0 -1
- package/dest/json-rpc/fixtures/class_b.d.ts +0 -11
- package/dest/json-rpc/fixtures/class_b.d.ts.map +0 -1
- package/dest/json-rpc/fixtures/test_state.d.ts +0 -89
- package/dest/json-rpc/fixtures/test_state.d.ts.map +0 -1
- package/dest/json-rpc/index.d.ts +0 -2
- package/dest/json-rpc/index.d.ts.map +0 -1
- package/dest/json-rpc/js_utils.d.ts +0 -13
- package/dest/json-rpc/js_utils.d.ts.map +0 -1
- package/dest/json-rpc/server/index.d.ts +0 -2
- package/dest/json-rpc/server/index.d.ts.map +0 -1
- package/dest/json-rpc/server/safe_json_rpc_server.d.ts +0 -140
- package/dest/json-rpc/server/safe_json_rpc_server.d.ts.map +0 -1
- package/dest/json-rpc/server/telemetry.d.ts +0 -2
- package/dest/json-rpc/server/telemetry.d.ts.map +0 -1
- package/dest/json-rpc/test/index.d.ts +0 -2
- package/dest/json-rpc/test/index.d.ts.map +0 -1
- package/dest/json-rpc/test/integration.d.ts +0 -13
- package/dest/json-rpc/test/integration.d.ts.map +0 -1
- package/dest/log/console.d.ts +0 -11
- package/dest/log/console.d.ts.map +0 -1
- package/dest/log/debug.d.ts +0 -56
- package/dest/log/debug.d.ts.map +0 -1
- package/dest/log/gcloud-logger-config.d.ts +0 -14
- package/dest/log/gcloud-logger-config.d.ts.map +0 -1
- package/dest/log/index.d.ts +0 -6
- package/dest/log/index.d.ts.map +0 -1
- package/dest/log/log-filters.d.ts +0 -7
- package/dest/log/log-filters.d.ts.map +0 -1
- package/dest/log/log-levels.d.ts +0 -3
- package/dest/log/log-levels.d.ts.map +0 -1
- package/dest/log/log_fn.d.ts +0 -7
- package/dest/log/log_fn.d.ts.map +0 -1
- package/dest/log/log_history.d.ts +0 -31
- package/dest/log/log_history.d.ts.map +0 -1
- package/dest/log/pino-logger.d.ts +0 -53
- package/dest/log/pino-logger.d.ts.map +0 -1
- package/dest/message/index.d.ts +0 -32
- package/dest/message/index.d.ts.map +0 -1
- package/dest/mutex/index.d.ts +0 -53
- package/dest/mutex/index.d.ts.map +0 -1
- package/dest/mutex/mutex_database.d.ts +0 -10
- package/dest/mutex/mutex_database.d.ts.map +0 -1
- package/dest/noir/index.d.ts +0 -2
- package/dest/noir/index.d.ts.map +0 -1
- package/dest/noir/noir_package_config.d.ts +0 -129
- package/dest/noir/noir_package_config.d.ts.map +0 -1
- package/dest/promise/index.d.ts +0 -3
- package/dest/promise/index.d.ts.map +0 -1
- package/dest/promise/running-promise.d.ts +0 -41
- package/dest/promise/running-promise.d.ts.map +0 -1
- package/dest/promise/utils.d.ts +0 -12
- package/dest/promise/utils.d.ts.map +0 -1
- package/dest/queue/base_memory_queue.d.ts +0 -65
- package/dest/queue/base_memory_queue.d.ts.map +0 -1
- package/dest/queue/bounded_serial_queue.d.ts +0 -56
- package/dest/queue/bounded_serial_queue.d.ts.map +0 -1
- package/dest/queue/fifo_memory_queue.d.ts +0 -21
- package/dest/queue/fifo_memory_queue.d.ts.map +0 -1
- package/dest/queue/index.d.ts +0 -6
- package/dest/queue/index.d.ts.map +0 -1
- package/dest/queue/priority_memory_queue.d.ts +0 -13
- package/dest/queue/priority_memory_queue.d.ts.map +0 -1
- package/dest/queue/priority_queue.d.ts +0 -14
- package/dest/queue/priority_queue.d.ts.map +0 -1
- package/dest/queue/semaphore.d.ts +0 -23
- package/dest/queue/semaphore.d.ts.map +0 -1
- package/dest/queue/serial_queue.d.ts +0 -49
- package/dest/queue/serial_queue.d.ts.map +0 -1
- package/dest/retry/index.d.ts +0 -44
- package/dest/retry/index.d.ts.map +0 -1
- package/dest/running-promise/index.d.ts +0 -2
- package/dest/running-promise/index.d.ts.map +0 -1
- package/dest/schemas/api.d.ts +0 -21
- package/dest/schemas/api.d.ts.map +0 -1
- package/dest/schemas/index.d.ts +0 -6
- package/dest/schemas/index.d.ts.map +0 -1
- package/dest/schemas/parse.d.ts +0 -9
- package/dest/schemas/parse.d.ts.map +0 -1
- package/dest/schemas/schemas.d.ts +0 -60
- package/dest/schemas/schemas.d.ts.map +0 -1
- package/dest/schemas/types.d.ts +0 -3
- package/dest/schemas/types.d.ts.map +0 -1
- package/dest/schemas/utils.d.ts +0 -53
- package/dest/schemas/utils.d.ts.map +0 -1
- package/dest/serialize/buffer_reader.d.ts +0 -239
- package/dest/serialize/buffer_reader.d.ts.map +0 -1
- package/dest/serialize/field_reader.d.ts +0 -112
- package/dest/serialize/field_reader.d.ts.map +0 -1
- package/dest/serialize/free_funcs.d.ts +0 -105
- package/dest/serialize/free_funcs.d.ts.map +0 -1
- package/dest/serialize/index.d.ts +0 -7
- package/dest/serialize/index.d.ts.map +0 -1
- package/dest/serialize/serialize.d.ts +0 -182
- package/dest/serialize/serialize.d.ts.map +0 -1
- package/dest/serialize/type_registry.d.ts +0 -23
- package/dest/serialize/type_registry.d.ts.map +0 -1
- package/dest/serialize/types.d.ts +0 -33
- package/dest/serialize/types.d.ts.map +0 -1
- package/dest/sleep/index.d.ts +0 -51
- package/dest/sleep/index.d.ts.map +0 -1
- package/dest/string/index.d.ts +0 -11
- package/dest/string/index.d.ts.map +0 -1
- package/dest/testing/files/index.d.ts +0 -19
- package/dest/testing/files/index.d.ts.map +0 -1
- package/dest/testing/index.d.ts +0 -4
- package/dest/testing/index.d.ts.map +0 -1
- package/dest/testing/port_allocator.d.ts +0 -10
- package/dest/testing/port_allocator.d.ts.map +0 -1
- package/dest/testing/snapshot_serializer.d.ts +0 -5
- package/dest/testing/snapshot_serializer.d.ts.map +0 -1
- package/dest/testing/test_data.d.ts +0 -7
- package/dest/testing/test_data.d.ts.map +0 -1
- package/dest/timer/date.d.ts +0 -13
- package/dest/timer/date.d.ts.map +0 -1
- package/dest/timer/elapsed.d.ts +0 -13
- package/dest/timer/elapsed.d.ts.map +0 -1
- package/dest/timer/index.d.ts +0 -5
- package/dest/timer/index.d.ts.map +0 -1
- package/dest/timer/timeout.d.ts +0 -41
- package/dest/timer/timeout.d.ts.map +0 -1
- package/dest/timer/timer.d.ts +0 -37
- package/dest/timer/timer.d.ts.map +0 -1
- package/dest/transport/browser/index.d.ts +0 -5
- package/dest/transport/browser/index.d.ts.map +0 -1
- package/dest/transport/browser/message_port_socket.d.ts +0 -37
- package/dest/transport/browser/message_port_socket.d.ts.map +0 -1
- package/dest/transport/browser/shared_worker_connector.d.ts +0 -19
- package/dest/transport/browser/shared_worker_connector.d.ts.map +0 -1
- package/dest/transport/browser/shared_worker_listener.d.ts +0 -38
- package/dest/transport/browser/shared_worker_listener.d.ts.map +0 -1
- package/dest/transport/browser/worker_connector.d.ts +0 -26
- package/dest/transport/browser/worker_connector.d.ts.map +0 -1
- package/dest/transport/browser/worker_listener.d.ts +0 -39
- package/dest/transport/browser/worker_listener.d.ts.map +0 -1
- package/dest/transport/dispatch/create_dispatch_fn.d.ts +0 -25
- package/dest/transport/dispatch/create_dispatch_fn.d.ts.map +0 -1
- package/dest/transport/dispatch/create_dispatch_proxy.d.ts +0 -102
- package/dest/transport/dispatch/create_dispatch_proxy.d.ts.map +0 -1
- package/dest/transport/dispatch/messages.d.ts +0 -52
- package/dest/transport/dispatch/messages.d.ts.map +0 -1
- package/dest/transport/index.d.ts +0 -12
- package/dest/transport/index.d.ts.map +0 -1
- package/dest/transport/interface/connector.d.ts +0 -8
- package/dest/transport/interface/connector.d.ts.map +0 -1
- package/dest/transport/interface/listener.d.ts +0 -13
- package/dest/transport/interface/listener.d.ts.map +0 -1
- package/dest/transport/interface/socket.d.ts +0 -13
- package/dest/transport/interface/socket.d.ts.map +0 -1
- package/dest/transport/interface/transferable.d.ts +0 -68
- package/dest/transport/interface/transferable.d.ts.map +0 -1
- package/dest/transport/node/index.d.ts +0 -3
- package/dest/transport/node/index.d.ts.map +0 -1
- package/dest/transport/node/node_connector.d.ts +0 -28
- package/dest/transport/node/node_connector.d.ts.map +0 -1
- package/dest/transport/node/node_connector_socket.d.ts +0 -42
- package/dest/transport/node/node_connector_socket.d.ts.map +0 -1
- package/dest/transport/node/node_listener.d.ts +0 -26
- package/dest/transport/node/node_listener.d.ts.map +0 -1
- package/dest/transport/node/node_listener_socket.d.ts +0 -37
- package/dest/transport/node/node_listener_socket.d.ts.map +0 -1
- package/dest/transport/transport_client.d.ts +0 -61
- package/dest/transport/transport_client.d.ts.map +0 -1
- package/dest/transport/transport_server.d.ts +0 -56
- package/dest/transport/transport_server.d.ts.map +0 -1
- package/dest/trees/index.d.ts +0 -59
- package/dest/trees/index.d.ts.map +0 -1
- package/dest/trees/unbalanced_merkle_tree.d.ts +0 -17
- package/dest/trees/unbalanced_merkle_tree.d.ts.map +0 -1
- package/dest/trees/unbalanced_tree_store.d.ts +0 -19
- package/dest/trees/unbalanced_tree_store.d.ts.map +0 -1
- package/dest/types/index.d.ts +0 -19
- package/dest/types/index.d.ts.map +0 -1
- package/dest/url/index.d.ts +0 -9
- package/dest/url/index.d.ts.map +0 -1
- package/dest/validation/index.d.ts +0 -9
- package/dest/validation/index.d.ts.map +0 -1
- package/dest/wasm/empty_wasi_sdk.d.ts +0 -130
- package/dest/wasm/empty_wasi_sdk.d.ts.map +0 -1
- package/dest/wasm/index.d.ts +0 -2
- package/dest/wasm/index.d.ts.map +0 -1
- package/dest/wasm/wasm_module.d.ts +0 -136
- package/dest/wasm/wasm_module.d.ts.map +0 -1
- package/dest/worker/browser/index.d.ts +0 -3
- package/dest/worker/browser/index.d.ts.map +0 -1
- package/dest/worker/browser/start_web_module.d.ts +0 -7
- package/dest/worker/browser/start_web_module.d.ts.map +0 -1
- package/dest/worker/browser/web_data_store.d.ts +0 -24
- package/dest/worker/browser/web_data_store.d.ts.map +0 -1
- package/dest/worker/browser/web_worker.d.ts +0 -10
- package/dest/worker/browser/web_worker.d.ts.map +0 -1
- package/dest/worker/data_store.d.ts +0 -21
- package/dest/worker/data_store.d.ts.map +0 -1
- package/dest/worker/index.d.ts +0 -3
- package/dest/worker/index.d.ts.map +0 -1
- package/dest/worker/node/index.d.ts +0 -3
- package/dest/worker/node/index.d.ts.map +0 -1
- package/dest/worker/node/node_data_store.d.ts +0 -13
- package/dest/worker/node/node_data_store.d.ts.map +0 -1
- package/dest/worker/node/node_worker.d.ts +0 -6
- package/dest/worker/node/node_worker.d.ts.map +0 -1
- package/dest/worker/node/start_node_module.d.ts +0 -7
- package/dest/worker/node/start_node_module.d.ts.map +0 -1
- package/dest/worker/wasm_worker.d.ts +0 -9
- package/dest/worker/wasm_worker.d.ts.map +0 -1
- package/dest/worker/worker_pool.d.ts +0 -40
- package/dest/worker/worker_pool.d.ts.map +0 -1
- package/src/blob/blob.ts +0 -311
- package/src/blob/encoding.ts +0 -98
- package/src/blob/errors.ts +0 -6
- package/src/blob/index.ts +0 -22
- package/src/blob/interface.ts +0 -11
- package/src/blob/mocks.ts +0 -48
package/dest/timer/timer.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timer class to measure time intervals in milliseconds and seconds.
|
|
3
|
-
* Upon instantiation, it stores the current timestamp as the starting point.
|
|
4
|
-
* The 'ms()' method returns the elapsed time in milliseconds,
|
|
5
|
-
* while the 's()' method returns the elapsed time in seconds.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* const timer = new Timer();
|
|
9
|
-
* setTimeout(() =\> \{
|
|
10
|
-
* console.log(`Elapsed time: ${timer.ms()} ms`);
|
|
11
|
-
* \}, 1000);
|
|
12
|
-
*/
|
|
13
|
-
export declare class Timer {
|
|
14
|
-
private start;
|
|
15
|
-
constructor();
|
|
16
|
-
/**
|
|
17
|
-
* Return microseconds.
|
|
18
|
-
*/
|
|
19
|
-
us(): number;
|
|
20
|
-
/**
|
|
21
|
-
* Returns the elapsed time in milliseconds since the Timer instance was created.
|
|
22
|
-
* Provides a simple and convenient way to measure the time duration between two events
|
|
23
|
-
* or monitor performance of specific code sections.
|
|
24
|
-
*
|
|
25
|
-
* @returns The elapsed time in milliseconds.
|
|
26
|
-
*/
|
|
27
|
-
ms(): number;
|
|
28
|
-
/**
|
|
29
|
-
* Returns the time elapsed since the Timer instance was created, in seconds.
|
|
30
|
-
* The value is calculated by subtracting the initial start time from the current time
|
|
31
|
-
* and dividing the result by 1000 to convert milliseconds to seconds.
|
|
32
|
-
*
|
|
33
|
-
* @returns The elapsed time in seconds.
|
|
34
|
-
*/
|
|
35
|
-
s(): number;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=timer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timer.d.ts","sourceRoot":"","sources":["../../src/timer/timer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,KAAK,CAAS;;IAMtB;;OAEG;IACI,EAAE;IAIT;;;;;;OAMG;IACI,EAAE;IAIT;;;;;;OAMG;IACI,CAAC;CAGT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/browser/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { type Socket } from '../interface/socket.js';
|
|
2
|
-
/**
|
|
3
|
-
* An implementation of a TransportSocket using MessagePorts.
|
|
4
|
-
*/
|
|
5
|
-
export declare class MessagePortSocket implements Socket {
|
|
6
|
-
private port;
|
|
7
|
-
constructor(port: MessagePort);
|
|
8
|
-
/**
|
|
9
|
-
* Send a message to the connected MessagePort, optionally transferring ownership of certain objects.
|
|
10
|
-
* The 'msg' parameter can be any structured data type and will be sent to the other end of the MessagePort.
|
|
11
|
-
* The optional 'transfer' parameter is an array of Transferable objects whose ownership will be transferred,
|
|
12
|
-
* making them inaccessible on the sending side. This can improve performance for large data transfers.
|
|
13
|
-
*
|
|
14
|
-
* @param msg - The message to be sent through the MessagePort.
|
|
15
|
-
* @param transfer - An optional array of Transferable objects to transfer ownership.
|
|
16
|
-
* @returns A Promise that resolves when the message has been sent.
|
|
17
|
-
*/
|
|
18
|
-
send(msg: any, transfer?: Transferable[]): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Register a callback function to handle incoming messages from the MessagePort.
|
|
21
|
-
* The provided callback will be invoked with the message data whenever a new message arrives.
|
|
22
|
-
* Note that only one callback can be registered at a time. Subsequent calls to this method
|
|
23
|
-
* will overwrite the previously registered callback.
|
|
24
|
-
*
|
|
25
|
-
* @param cb - The callback function to handle incoming messages.
|
|
26
|
-
*/
|
|
27
|
-
registerHandler(cb: (msg: any) => any): void;
|
|
28
|
-
/**
|
|
29
|
-
* Close the MessagePort, unregister the message handler, and send an undefined message.
|
|
30
|
-
* The 'close' function is useful for gracefully shutting down a connection between two
|
|
31
|
-
* endpoints by sending an undefined message as an indication of disconnection before
|
|
32
|
-
* closing the port. After calling this method, the MessagePortSocket instance should not
|
|
33
|
-
* be used again.
|
|
34
|
-
*/
|
|
35
|
-
close(): void;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=message_port_socket.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message_port_socket.d.ts","sourceRoot":"","sources":["../../../src/transport/browser/message_port_socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD;;GAEG;AACH,qBAAa,iBAAkB,YAAW,MAAM;IAClC,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,WAAW;IAErC;;;;;;;;;OASG;IACH,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,GAAE,YAAY,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5D;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI;IAI5C;;;;;;OAMG;IACH,KAAK;CAKN"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type Connector } from '../interface/connector.js';
|
|
2
|
-
import { MessagePortSocket } from './message_port_socket.js';
|
|
3
|
-
/**
|
|
4
|
-
* SharedWorkerConnector is an implementation of the Connector interface, specifically for SharedWorkers.
|
|
5
|
-
* It enables the creation of MessagePortSockets that communicate with a shared worker and allow
|
|
6
|
-
* multiple scripts to communicate with the worker using the same connection.
|
|
7
|
-
*/
|
|
8
|
-
export declare class SharedWorkerConnector implements Connector {
|
|
9
|
-
private worker;
|
|
10
|
-
constructor(worker: SharedWorker);
|
|
11
|
-
/**
|
|
12
|
-
* Creates a new MessagePortSocket instance using the SharedWorker's port.
|
|
13
|
-
* This method allows for easy creation of sockets to communicate with the SharedWorker.
|
|
14
|
-
*
|
|
15
|
-
* @returns A Promise that resolves to a new MessagePortSocket instance.
|
|
16
|
-
*/
|
|
17
|
-
createSocket(): Promise<MessagePortSocket>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=shared_worker_connector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared_worker_connector.d.ts","sourceRoot":"","sources":["../../../src/transport/browser/shared_worker_connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,SAAS;IACzC,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAExC;;;;;OAKG;IACH,YAAY;CAGb"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import EventEmitter from 'events';
|
|
3
|
-
import { type Listener } from '../interface/listener.js';
|
|
4
|
-
/**
|
|
5
|
-
* Represents the global scope of a Shared Worker.
|
|
6
|
-
* Provides functionality to handle incoming connections and manage communication with other scripts
|
|
7
|
-
* running in a shared context, enabling concurrent access and efficient resource sharing among those scripts.
|
|
8
|
-
*/
|
|
9
|
-
declare interface SharedWorkerGlobalScope {
|
|
10
|
-
/**
|
|
11
|
-
* Event handler for new connections to the Shared Worker.
|
|
12
|
-
*/
|
|
13
|
-
onconnect: (...args: any) => any;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* SharedWorkerListener is an extension of the EventEmitter class that implements the Listener interface.
|
|
17
|
-
* It provides functionality to handle incoming messages from a shared worker and emit events for new sockets
|
|
18
|
-
* created in response to these incoming connections. This class is meant to be used in the context of managing
|
|
19
|
-
* MessagePort connections within the SharedWorkerGlobalScope.
|
|
20
|
-
*/
|
|
21
|
-
export declare class SharedWorkerListener extends EventEmitter implements Listener {
|
|
22
|
-
private worker;
|
|
23
|
-
constructor(worker: SharedWorkerGlobalScope);
|
|
24
|
-
/**
|
|
25
|
-
* Initializes the shared worker listener by assigning the 'handleMessageEvent' method as the event handler
|
|
26
|
-
* for the 'onconnect' event of the SharedWorkerGlobalScope. The 'handleMessageEvent' function will be called
|
|
27
|
-
* whenever a new connection is established with the shared worker.
|
|
28
|
-
*/
|
|
29
|
-
open(): void;
|
|
30
|
-
/**
|
|
31
|
-
* Closes the SharedWorkerListener by detaching the 'onconnect' event handler.
|
|
32
|
-
* This stops the listener from emitting new sockets on incoming connections.
|
|
33
|
-
*/
|
|
34
|
-
close(): void;
|
|
35
|
-
private handleMessageEvent;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=shared_worker_listener.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared_worker_listener.d.ts","sourceRoot":"","sources":["../../../src/transport/browser/shared_worker_listener.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD;;;;GAIG;AACH,OAAO,WAAW,uBAAuB;IACvC;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CAClC;AAED;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,YAAa,YAAW,QAAQ;IAC5D,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,uBAAuB;IAInD;;;;OAIG;IACH,IAAI;IAIJ;;;OAGG;IACH,KAAK;IAIL,OAAO,CAAC,kBAAkB,CAMxB;CACH"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type Connector } from '../interface/connector.js';
|
|
2
|
-
import { MessagePortSocket } from './message_port_socket.js';
|
|
3
|
-
/**
|
|
4
|
-
* WorkerConnector is a class implementing the Connector interface for creating communication sockets
|
|
5
|
-
* with Web Workers. It allows to establish a connection with the worker and create MessagePortSockets
|
|
6
|
-
* using MessageChannels, enabling seamless communication between the main thread and worker threads.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const worker = new Worker('./myWorker.js');
|
|
10
|
-
* const connector = new WorkerConnector(worker);
|
|
11
|
-
* const socket = await connector.createSocket();
|
|
12
|
-
* socket.send('Hello, worker!');
|
|
13
|
-
*/
|
|
14
|
-
export declare class WorkerConnector implements Connector {
|
|
15
|
-
private worker;
|
|
16
|
-
constructor(worker: Worker);
|
|
17
|
-
/**
|
|
18
|
-
* Creates a new MessagePortSocket instance by establishing a connection between the Worker and the main thread.
|
|
19
|
-
* A MessageChannel is created, and one of its ports is sent to the Worker using postMessage.
|
|
20
|
-
* The other port is used to create a new MessagePortSocket which is then returned as a Promise.
|
|
21
|
-
*
|
|
22
|
-
* @returns A Promise that resolves to a new MessagePortSocket instance.
|
|
23
|
-
*/
|
|
24
|
-
createSocket(): Promise<MessagePortSocket>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=worker_connector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker_connector.d.ts","sourceRoot":"","sources":["../../../src/transport/browser/worker_connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,qBAAa,eAAgB,YAAW,SAAS;IACnC,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAElC;;;;;;OAMG;IACH,YAAY;CAKb"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import EventEmitter from 'events';
|
|
3
|
-
import { type Listener } from '../interface/listener.js';
|
|
4
|
-
/**
|
|
5
|
-
* Represents a DedicatedWorkerGlobalScope, which is the global execution context for a dedicated worker.
|
|
6
|
-
* Provides properties and methods to manage the worker's lifecycle and communication with other threads or workers.
|
|
7
|
-
*/
|
|
8
|
-
declare interface DedicatedWorkerGlobalScope {
|
|
9
|
-
/**
|
|
10
|
-
* Handler for incoming messages from other threads or workers.
|
|
11
|
-
*/
|
|
12
|
-
onmessage: any;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* WorkerListener is a class that extends EventEmitter and implements the Listener interface.
|
|
16
|
-
* It listens for incoming connections on a dedicated worker global scope, and emits a 'new_socket' event
|
|
17
|
-
* with a MessagePortSocket instance for each new connection. This allows applications to communicate
|
|
18
|
-
* with other workers or main thread through the MessagePortSocket abstraction.
|
|
19
|
-
*
|
|
20
|
-
* The open() method starts listening for incoming connections, while the close() method stops it.
|
|
21
|
-
*/
|
|
22
|
-
export declare class WorkerListener extends EventEmitter implements Listener {
|
|
23
|
-
private worker;
|
|
24
|
-
constructor(worker: DedicatedWorkerGlobalScope);
|
|
25
|
-
/**
|
|
26
|
-
* Initializes the WorkerListener by setting the 'onmessage' event handler of the worker.
|
|
27
|
-
* The 'onmessage' event will be triggered when the worker receives a message, and it will then
|
|
28
|
-
* call the handleMessageEvent method to handle incoming connections.
|
|
29
|
-
*/
|
|
30
|
-
open(): void;
|
|
31
|
-
/**
|
|
32
|
-
* Close the worker listener by removing the 'onmessage' event handler.
|
|
33
|
-
* This method effectively stops the WorkerListener from reacting to new incoming messages.
|
|
34
|
-
*/
|
|
35
|
-
close(): void;
|
|
36
|
-
private handleMessageEvent;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=worker_listener.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker_listener.d.ts","sourceRoot":"","sources":["../../../src/transport/browser/worker_listener.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD;;;GAGG;AACH,OAAO,WAAW,0BAA0B;IAC1C;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,YAAa,YAAW,QAAQ;IACtD,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,0BAA0B;IAItD;;;;OAIG;IACH,IAAI;IAIJ;;;OAGG;IACH,KAAK;IAIL,OAAO,CAAC,kBAAkB,CAMxB;CACH"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a message object for dispatching function calls.
|
|
3
|
-
* Contains the function name ('fn') and an array of arguments ('args') required to call the target method.
|
|
4
|
-
*/
|
|
5
|
-
export interface DispatchMsg {
|
|
6
|
-
/**
|
|
7
|
-
* Name of the target method to be called.
|
|
8
|
-
*/
|
|
9
|
-
fn: string;
|
|
10
|
-
/**
|
|
11
|
-
* An array of arguments to be passed to the target method.
|
|
12
|
-
*/
|
|
13
|
-
args: any[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Creates a dispatch function that calls the target's specified method with provided arguments.
|
|
17
|
-
* The created dispatch function takes a DispatchMsg object as input, which contains the name of
|
|
18
|
-
* the method to be called ('fn') and an array of arguments to be passed to the method ('args').
|
|
19
|
-
*
|
|
20
|
-
* @param targetFn - A function that returns the target object containing the methods to be dispatched.
|
|
21
|
-
* @param log - Optional logging function for debugging purposes.
|
|
22
|
-
* @returns A dispatch function that accepts a DispatchMsg object and calls the target's method with provided arguments.
|
|
23
|
-
*/
|
|
24
|
-
export declare function createDispatchFn(targetFn: () => any, log?: import("../../log/pino-logger.js").Logger): ({ fn, args }: DispatchMsg) => Promise<any>;
|
|
25
|
-
//# sourceMappingURL=create_dispatch_fn.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create_dispatch_fn.d.ts","sourceRoot":"","sources":["../../../src/transport/dispatch/create_dispatch_fn.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,GAAG,EAAE,CAAC;CACb;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,EAAE,GAAG,4CAAsC,kBACjE,WAAW,kBAKxC"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { type TransferDescriptor } from '../interface/transferable.js';
|
|
2
|
-
import { type TransportClient } from '../transport_client.js';
|
|
3
|
-
import { type DispatchMsg } from './create_dispatch_fn.js';
|
|
4
|
-
/**
|
|
5
|
-
* FilterOutAttributes type filters out all non-method properties of an object, leaving only the attributes
|
|
6
|
-
* that are functions. This is useful for creating proxies or wrappers around objects while focusing only
|
|
7
|
-
* on their methods and ignoring other properties.
|
|
8
|
-
*/
|
|
9
|
-
type FilterOutAttributes<Base> = {
|
|
10
|
-
[Key in keyof Base]: Base[Key] extends (...any: any) => any ? Base[Key] : never;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Takes a function type `F` and returns a new function type with the same input parameters as `F`,
|
|
14
|
-
* but returning a Promise of the original return type of `F`. This is useful for converting sync
|
|
15
|
-
* functions or functions that take callbacks into a version that returns a Promise.
|
|
16
|
-
*/
|
|
17
|
-
type PromisifyFunction<F extends (...any: any) => any> = (...args: Parameters<F>) => Promise<ReturnType<F>>;
|
|
18
|
-
/**
|
|
19
|
-
* Transforms the provided object type by converting each of its function properties into their
|
|
20
|
-
* promise-returning counterparts. If a function property already returns a promise, it remains unchanged.
|
|
21
|
-
* This is useful when wrapping synchronous methods to return promises in order to standardize the API for
|
|
22
|
-
* asynchronous operations.
|
|
23
|
-
*
|
|
24
|
-
* @typeParam Base - The type of the object whose function properties need to be converted into their
|
|
25
|
-
* promise-returning versions.
|
|
26
|
-
*/
|
|
27
|
-
type Promisify<Base extends {
|
|
28
|
-
[key: string]: (...any: any) => any;
|
|
29
|
-
}> = {
|
|
30
|
-
[Key in keyof Base]: ReturnType<Base[Key]> extends Promise<any> ? Base[Key] : PromisifyFunction<Base[Key]>;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Type that transforms a tuple of types, replacing each type 'T' with either 'T' or a `TransferDescriptor<T>` if 'T' is `Transferable`.
|
|
34
|
-
* This is useful for handling arguments of functions that may accept both original and transferable representations of objects.
|
|
35
|
-
*/
|
|
36
|
-
type TransferTypes<Tuple extends [...args: any]> = {
|
|
37
|
-
[Index in keyof Tuple]: Tuple[Index] | (Tuple[Index] extends Transferable ? TransferDescriptor<Tuple[Index]> : never);
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Annoying.
|
|
41
|
-
* @see https://github.com/microsoft/TypeScript/issues/29919
|
|
42
|
-
* There's a bug that means we can't map over the tuple or function parameter types to make them transferrable, if
|
|
43
|
-
* we use the Parameters builtin, and then try to map.
|
|
44
|
-
* So instead we inline the Parameters builtin and apply the TransferTypes to the parameters within the inline.
|
|
45
|
-
* Once the above is fixed we could in theory just do:
|
|
46
|
-
*
|
|
47
|
-
* type MakeFunctionTransferrable\<TFunction extends (...args: any) =\> any\> = (
|
|
48
|
-
* ...args: TransferTypes\<Parameters\<TFunction\>\>
|
|
49
|
-
* ) =\> ReturnType<TFunction>;
|
|
50
|
-
*/
|
|
51
|
-
type MakeFunctionTransferrable<TFunction extends (...args: any) => any> = (...args: TFunction extends (...args: infer P) => any ? TransferTypes<P> : never) => ReturnType<TFunction>;
|
|
52
|
-
/**
|
|
53
|
-
* Transferrable type represents a utility type that maps over the provided Base object's methods,
|
|
54
|
-
* transforming their argument types to support transferable objects. This is useful when dealing
|
|
55
|
-
* with operations across different environments or threads, such as Web Workers or Node.js processes,
|
|
56
|
-
* where certain objects need to be transferred instead of being serialized and deserialized.
|
|
57
|
-
*/
|
|
58
|
-
type Transferrable<Base extends {
|
|
59
|
-
[key: string]: (...any: any) => any;
|
|
60
|
-
}> = {
|
|
61
|
-
[Key in keyof Base]: MakeFunctionTransferrable<Base[Key]>;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Proxify is a mapped type that takes an object with functions as its properties and returns
|
|
65
|
-
* a new object with the same properties, but with each function transformed to return a Promise
|
|
66
|
-
* and accept Transferable types in place of their original parameters. This type is useful for
|
|
67
|
-
* creating proxies that communicate over different environments or threads while maintaining
|
|
68
|
-
* the original class's method signatures, allowing for type-safe interaction with remote instances.
|
|
69
|
-
*/
|
|
70
|
-
export type Proxify<T> = Promisify<Transferrable<FilterOutAttributes<T>>>;
|
|
71
|
-
/**
|
|
72
|
-
* Creates a proxy object for the provided class, wrapping each method in a request function.
|
|
73
|
-
* The resulting proxy object allows invoking methods of the original class, but their execution
|
|
74
|
-
* is delegated to the request function. This is useful when executing methods across different
|
|
75
|
-
* environments or threads, such as Web Workers or Node.js processes.
|
|
76
|
-
*
|
|
77
|
-
* @typeParam T - The type of the class to create a proxy for.
|
|
78
|
-
* @param class_ - The class constructor to create a proxy for.
|
|
79
|
-
* @param requestFn - A higher-order function that takes a method name and returns a function
|
|
80
|
-
* with the same signature as the original method, which wraps the actual
|
|
81
|
-
* invocation in a custom logic (e.g., sending a message to another thread).
|
|
82
|
-
* @returns An object whose methods match those of the original class, but whose execution is
|
|
83
|
-
* delegated to the provided request function.
|
|
84
|
-
*/
|
|
85
|
-
export declare function createDispatchProxyFromFn<T>(class_: {
|
|
86
|
-
new (...args: any[]): T;
|
|
87
|
-
}, requestFn: (fn: string) => (...args: any[]) => Promise<any>): Proxify<T>;
|
|
88
|
-
/**
|
|
89
|
-
* Creates a proxy for the given class that transparently dispatches method calls over a transport client.
|
|
90
|
-
* The proxy allows calling methods on remote instances of the class through the provided transport client
|
|
91
|
-
* while maintaining the correct return types and handling promises. If the class inherits from EventEmitter,
|
|
92
|
-
* it also handles event emissions through the transport client.
|
|
93
|
-
*
|
|
94
|
-
* @param class_ - The constructor function of the class to create the proxy for.
|
|
95
|
-
* @param transportClient - The TransportClient instance used to handle communication between proxies.
|
|
96
|
-
* @returns A proxified version of the given class with methods dispatched over the transport client.
|
|
97
|
-
*/
|
|
98
|
-
export declare function createDispatchProxy<T>(class_: {
|
|
99
|
-
new (...args: any[]): T;
|
|
100
|
-
}, transportClient: TransportClient<DispatchMsg>): Proxify<T>;
|
|
101
|
-
export {};
|
|
102
|
-
//# sourceMappingURL=create_dispatch_proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create_dispatch_proxy.d.ts","sourceRoot":"","sources":["../../../src/transport/dispatch/create_dispatch_proxy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,kBAAkB,EAAwB,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;GAIG;AACH,KAAK,mBAAmB,CAAC,IAAI,IAAI;KAC9B,GAAG,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK;CAChF,CAAC;AAEF;;;;GAIG;AACH,KAAK,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,GAAG,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5G;;;;;;;;GAQG;AACH,KAAK,SAAS,CAAC,IAAI,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,KAAK,GAAG,CAAA;CAAE,IAAI;KACpE,GAAG,IAAI,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;CAC3G,CAAC;AAEF;;;GAGG;AACH,KAAK,aAAa,CAAC,KAAK,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,IAAI;KAChD,KAAK,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC;CACtH,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,KAAK,yBAAyB,CAAC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,CACxE,GAAG,IAAI,EAAE,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,KAC5E,UAAU,CAAC,SAAS,CAAC,CAAC;AAE3B;;;;;GAKG;AACH,KAAK,aAAa,CAAC,IAAI,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,KAAK,GAAG,CAAA;CAAE,IAAI;KACxE,GAAG,IAAI,MAAM,IAAI,GAAG,yBAAyB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;CAC1D,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,SAAS,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE1E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,MAAM,EAAE;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,EACnC,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,GAC1D,OAAO,CAAC,CAAC,CAAC,CASZ;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,MAAM,EAAE;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,EACnC,eAAe,EAAE,eAAe,CAAC,WAAW,CAAC,GAC5C,OAAO,CAAC,CAAC,CAAC,CAqBZ"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a request message.
|
|
3
|
-
* Contains a unique identifier (msgId) and a payload object.
|
|
4
|
-
*/
|
|
5
|
-
export interface RequestMessage<Payload> {
|
|
6
|
-
/**
|
|
7
|
-
* A unique identifier for a message.
|
|
8
|
-
*/
|
|
9
|
-
msgId: number;
|
|
10
|
-
/**
|
|
11
|
-
* The data content carried within a message.
|
|
12
|
-
*/
|
|
13
|
-
payload: Payload;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Represents a structured response message.
|
|
17
|
-
* Contains an identifier to match with the corresponding request.
|
|
18
|
-
*/
|
|
19
|
-
export interface ResponseMessage<Payload> {
|
|
20
|
-
/**
|
|
21
|
-
* A unique identifier for the message.
|
|
22
|
-
*/
|
|
23
|
-
msgId: number;
|
|
24
|
-
/**
|
|
25
|
-
* The data content carried within the message.
|
|
26
|
-
*/
|
|
27
|
-
payload?: Payload;
|
|
28
|
-
/**
|
|
29
|
-
* An optional error description in case the response contains an error instead of a payload.
|
|
30
|
-
*/
|
|
31
|
-
error?: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Represents an event-based message in a communication system.
|
|
35
|
-
* Contains a payload with the relevant data associated with a specific event occurrence.
|
|
36
|
-
*/
|
|
37
|
-
export interface EventMessage<Payload> {
|
|
38
|
-
/**
|
|
39
|
-
* The data content associated with a message.
|
|
40
|
-
*/
|
|
41
|
-
payload: Payload;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Determines if the given 'msg' is an EventMessage by checking if its 'msgId' property is undefined.
|
|
45
|
-
* Returns true if the input message is of type EventMessage, otherwise false. This utility function can be used
|
|
46
|
-
* to differentiate between instances of ResponseMessage and EventMessage that share a common Payload type.
|
|
47
|
-
*
|
|
48
|
-
* @param msg - The message object that can be either a ResponseMessage or EventMessage with a specific payload.
|
|
49
|
-
* @returns A boolean value indicating whether the input message is an EventMessage (true) or not (false).
|
|
50
|
-
*/
|
|
51
|
-
export declare function isEventMessage<Payload>(msg: ResponseMessage<Payload> | EventMessage<Payload>): msg is EventMessage<Payload>;
|
|
52
|
-
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/transport/dispatch/messages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,OAAO;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe,CAAC,OAAO;IACtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,OAAO;IACnC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,EACpC,GAAG,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,GACpD,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC,CAE9B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './dispatch/create_dispatch_fn.js';
|
|
2
|
-
export * from './dispatch/create_dispatch_proxy.js';
|
|
3
|
-
export * from './dispatch/messages.js';
|
|
4
|
-
export * from './interface/connector.js';
|
|
5
|
-
export * from './interface/listener.js';
|
|
6
|
-
export * from './interface/socket.js';
|
|
7
|
-
export * from './interface/transferable.js';
|
|
8
|
-
export * from './transport_client.js';
|
|
9
|
-
export * from './transport_server.js';
|
|
10
|
-
export * from './browser/index.js';
|
|
11
|
-
export * from './node/index.js';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/transport/interface/connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,SAAS;IAExB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import type EventEmitter from 'events';
|
|
3
|
-
import { type Socket } from './socket.js';
|
|
4
|
-
/**
|
|
5
|
-
* Once opened, an implementation of a TransportListener will emit `new_socket` events as new clients connect.
|
|
6
|
-
* Possible implementations could include MessageChannels or WebSockets.
|
|
7
|
-
*/
|
|
8
|
-
export interface Listener extends EventEmitter {
|
|
9
|
-
open(): void;
|
|
10
|
-
close(): void;
|
|
11
|
-
on(name: 'new_socket', cb: (client: Socket) => void): this;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=listener.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../../src/transport/interface/listener.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;GAGG;AACH,MAAM,WAAW,QAAS,SAAQ,YAAY;IAE5C,IAAI,IAAI,IAAI,CAAC;IAEb,KAAK,IAAI,IAAI,CAAC;IAEd,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;CAC5D"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents one end of a socket connection.
|
|
3
|
-
* A message sent via `send` will be handled by the corresponding Socket's handler function at the other end.
|
|
4
|
-
* Implementations could use e.g. MessagePorts for communication between browser workers,
|
|
5
|
-
* or WebSockets for communication between processes.
|
|
6
|
-
* If `registerHandler` callback receives `undefined` that signals the other end closed.
|
|
7
|
-
*/
|
|
8
|
-
export interface Socket {
|
|
9
|
-
send(msg: any, transfer?: Transferable[]): Promise<void>;
|
|
10
|
-
registerHandler(cb: (msg: any) => any): void;
|
|
11
|
-
close(): void;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=socket.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../../src/transport/interface/socket.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,MAAM;IAErB,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD,eAAe,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI,CAAC;IAE7C,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
declare const $transferable: unique symbol;
|
|
2
|
-
/**
|
|
3
|
-
* Represents a descriptor for transferable objects in multi-threaded environments.
|
|
4
|
-
* Provides a structure for marking certain objects as transferable and managing the ownership transfer
|
|
5
|
-
* between threads, particularly useful when working with Web Workers.
|
|
6
|
-
*/
|
|
7
|
-
export interface TransferDescriptor<T = any> {
|
|
8
|
-
/**
|
|
9
|
-
* A unique symbol indicating that an object is a TransferDescriptor.
|
|
10
|
-
*/
|
|
11
|
-
[$transferable]: true;
|
|
12
|
-
/**
|
|
13
|
-
* The transferable data to be sent between threads.
|
|
14
|
-
*/
|
|
15
|
-
send: T;
|
|
16
|
-
/**
|
|
17
|
-
* An array of objects that can be transferred between threads without serialization and deserialization.
|
|
18
|
-
*/
|
|
19
|
-
transferables: Transferable[];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Determines whether a given object is a TransferDescriptor.
|
|
23
|
-
* A TransferDescriptor is an object with a [$transferable] property set to true and used for
|
|
24
|
-
* transferring ownership of transferable objects between threads.
|
|
25
|
-
* This function checks if the input object has the required properties to be considered
|
|
26
|
-
* a valid TransferDescriptor.
|
|
27
|
-
*
|
|
28
|
-
* @param thing - The object to be checked for being a TransferDescriptor.
|
|
29
|
-
* @returns True if the object is a TransferDescriptor, false otherwise.
|
|
30
|
-
*/
|
|
31
|
-
export declare function isTransferDescriptor(thing: any): thing is TransferDescriptor;
|
|
32
|
-
/**
|
|
33
|
-
* Mark a transferable object as such, so it will no be serialized and
|
|
34
|
-
* deserialized on messaging with the main thread, but to transfer
|
|
35
|
-
* ownership of it to the receiving thread.
|
|
36
|
-
*
|
|
37
|
-
* Only works with array buffers, message ports and few more special
|
|
38
|
-
* types of objects, but it's much faster than serializing and
|
|
39
|
-
* deserializing them.
|
|
40
|
-
*
|
|
41
|
-
* Note:
|
|
42
|
-
* The transferable object cannot be accessed by this thread again
|
|
43
|
-
* unless the receiving thread transfers it back again!
|
|
44
|
-
*
|
|
45
|
-
* @param transferable - Array buffer, message port or similar.
|
|
46
|
-
* @see https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast
|
|
47
|
-
*/
|
|
48
|
-
export declare function Transfer<T>(transferable: Transferable): TransferDescriptor<T>;
|
|
49
|
-
/**
|
|
50
|
-
* Mark transferable objects within an arbitrary object or array as
|
|
51
|
-
* being a transferable object. They will then not be serialized
|
|
52
|
-
* and deserialized on messaging with the main thread, but ownership
|
|
53
|
-
* of them will be transferred to the receiving thread.
|
|
54
|
-
*
|
|
55
|
-
* Only array buffers, message ports and few more special types of
|
|
56
|
-
* objects can be transferred, but it's much faster than serializing and
|
|
57
|
-
* deserializing them.
|
|
58
|
-
*
|
|
59
|
-
* Note:
|
|
60
|
-
* The transferable object cannot be accessed by this thread again
|
|
61
|
-
* unless the receiving thread transfers it back again!
|
|
62
|
-
*
|
|
63
|
-
* @param transferable - Array buffer, message port or similar.
|
|
64
|
-
* @see https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast
|
|
65
|
-
*/
|
|
66
|
-
export declare function Transfer<T>(payload: T, transferables: Transferable[]): TransferDescriptor<T>;
|
|
67
|
-
export {};
|
|
68
|
-
//# sourceMappingURL=transferable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transferable.d.ts","sourceRoot":"","sources":["../../../src/transport/interface/transferable.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,eAAgC,CAAC;AAEpD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,GAAG;IACzC;;OAEG;IACH,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC;IACtB;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;IACR;;OAEG;IACH,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B;AAyBD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,kBAAkB,CAE5E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE/E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import { type Worker } from 'worker_threads';
|
|
3
|
-
import { type Connector } from '../interface/connector.js';
|
|
4
|
-
import { NodeConnectorSocket } from './node_connector_socket.js';
|
|
5
|
-
/**
|
|
6
|
-
* The NodeConnector class is a concrete implementation of the Connector interface, utilizing worker_threads for
|
|
7
|
-
* efficient parallel execution. This class provides an easy way to establish a connection with a Worker instance,
|
|
8
|
-
* allowing seamless communication via sockets.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* const worker = new Worker('./path/to/worker.js');
|
|
12
|
-
* const nodeConnector = new NodeConnector(worker);
|
|
13
|
-
* const socket = await nodeConnector.createSocket();
|
|
14
|
-
* socket.send('Hello from main thread!');
|
|
15
|
-
*/
|
|
16
|
-
export declare class NodeConnector implements Connector {
|
|
17
|
-
private worker;
|
|
18
|
-
constructor(worker: Worker);
|
|
19
|
-
/**
|
|
20
|
-
* Creates a new instance of NodeConnectorSocket using the worker provided in the constructor.
|
|
21
|
-
* The createSocket method is used to establish connections using the worker_threads module,
|
|
22
|
-
* allowing for efficient and fast communication between different parts of the application.
|
|
23
|
-
*
|
|
24
|
-
* @returns A Promise that resolves to a newly created NodeConnectorSocket instance.
|
|
25
|
-
*/
|
|
26
|
-
createSocket(): Promise<NodeConnectorSocket>;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=node_connector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node_connector.d.ts","sourceRoot":"","sources":["../../../src/transport/node/node_connector.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,YAAW,SAAS;IACjC,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAElC;;;;;;OAMG;IACH,YAAY;CAGb"}
|