cf-workers-native 0.0.0-stage → 0.1.2-beta.local.sha2f5e4e6956f4
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/LICENSE +21 -0
- package/Package.swift +25 -0
- package/README.md +92 -2
- package/dist/android.d.ts +2 -0
- package/dist/android.js +1 -0
- package/dist/browser/abort/index.d.ts +13 -0
- package/dist/browser/abort/index.js +66 -0
- package/dist/browser/body/index.d.ts +24 -0
- package/dist/browser/body/index.js +116 -0
- package/dist/browser/body/stream-body.d.ts +13 -0
- package/dist/browser/body/stream-body.js +84 -0
- package/dist/browser/documents/body.d.ts +3 -0
- package/dist/browser/documents/body.js +48 -0
- package/dist/browser/documents/form-body.d.ts +1 -0
- package/dist/browser/documents/form-body.js +54 -0
- package/dist/browser/documents/host.d.ts +11 -0
- package/dist/browser/documents/host.js +256 -0
- package/dist/browser/documents/links-source.d.ts +1 -0
- package/dist/browser/documents/links-source.js +1 -0
- package/dist/browser/documents/links.d.ts +1 -0
- package/dist/browser/documents/links.js +33 -0
- package/dist/browser/documents/page-config.d.ts +5 -0
- package/dist/browser/documents/page-config.js +5 -0
- package/dist/browser/documents/page-source.d.ts +1 -0
- package/dist/browser/documents/page-source.js +1 -0
- package/dist/browser/documents/page.d.ts +2 -0
- package/dist/browser/documents/page.js +153 -0
- package/dist/browser/documents/registration.d.ts +5 -0
- package/dist/browser/documents/registration.js +75 -0
- package/dist/browser/documents/runtime.d.ts +7 -0
- package/dist/browser/documents/runtime.js +161 -0
- package/dist/browser/documents/service-worker.js +285 -0
- package/dist/browser/encoding/index.d.ts +7 -0
- package/dist/browser/encoding/index.js +3 -0
- package/dist/browser/fetch/LICENSE-3RD-PARTY.md +9 -0
- package/dist/browser/fetch/LICENSE-APACHE +177 -0
- package/dist/browser/fetch/host-call.d.ts +3 -0
- package/dist/browser/fetch/host-call.js +67 -0
- package/dist/browser/fetch/index.d.ts +5 -0
- package/dist/browser/fetch/index.js +96 -0
- package/dist/browser/fetch/interop.d.ts +6 -0
- package/dist/browser/fetch/interop.js +48 -0
- package/dist/browser/fetch/native-network.d.ts +20 -0
- package/dist/browser/fetch/native-network.js +233 -0
- package/dist/browser/fetch/outbound.d.ts +2 -0
- package/dist/browser/fetch/outbound.js +11 -0
- package/dist/browser/fetch/relay.d.ts +7 -0
- package/dist/browser/fetch/relay.js +100 -0
- package/dist/browser/fetch/scope.d.ts +8 -0
- package/dist/browser/fetch/scope.js +108 -0
- package/dist/browser/fetch/transport.d.ts +39 -0
- package/dist/browser/fetch/transport.js +136 -0
- package/dist/browser/headers/LICENSE-3RD-PARTY.md +9 -0
- package/dist/browser/headers/LICENSE-APACHE +177 -0
- package/dist/browser/headers/index.d.ts +20 -0
- package/dist/browser/headers/index.js +194 -0
- package/dist/browser/isolated/bridge.d.ts +8 -0
- package/dist/browser/isolated/bridge.js +267 -0
- package/dist/browser/isolated/protocol.d.ts +40 -0
- package/dist/browser/isolated/protocol.js +1 -0
- package/dist/browser/isolated/transport.d.ts +2 -0
- package/dist/browser/isolated/transport.js +157 -0
- package/dist/browser/request/LICENSE-3RD-PARTY.md +10 -0
- package/dist/browser/request/LICENSE-APACHE +177 -0
- package/dist/browser/request/index.d.ts +48 -0
- package/dist/browser/request/index.js +182 -0
- package/dist/browser/response/LICENSE-3RD-PARTY.md +10 -0
- package/dist/browser/response/LICENSE-APACHE +177 -0
- package/dist/browser/response/index.d.ts +43 -0
- package/dist/browser/response/index.js +192 -0
- package/dist/browser/response/status.d.ts +1 -0
- package/dist/browser/response/status.js +75 -0
- package/dist/browser/structured-clone/index.d.ts +1 -0
- package/dist/browser/structured-clone/index.js +479 -0
- package/dist/cloudflare/apis/cloudflare-node/index.d.ts +18 -0
- package/dist/cloudflare/apis/cloudflare-node/index.js +150 -0
- package/dist/cloudflare/apis/cloudflare-workers/index.d.ts +8 -0
- package/dist/cloudflare/apis/cloudflare-workers/index.js +37 -0
- package/dist/cloudflare/apis/types.d.ts +7 -0
- package/dist/cloudflare/apis/types.js +1 -0
- package/dist/cloudflare/bindings/config.d.ts +42 -0
- package/dist/cloudflare/bindings/config.js +280 -0
- package/dist/cloudflare/bindings/kv/contract.d.ts +6 -0
- package/dist/cloudflare/bindings/kv/contract.js +181 -0
- package/dist/cloudflare/bindings/kv/index.d.ts +18 -0
- package/dist/cloudflare/bindings/kv/index.js +61 -0
- package/dist/cloudflare/bindings/kv/storage.d.ts +25 -0
- package/dist/cloudflare/bindings/kv/storage.js +320 -0
- package/dist/cloudflare/bindings/kv/types.d.ts +50 -0
- package/dist/cloudflare/bindings/kv/types.js +1 -0
- package/dist/cloudflare/bindings/remote.d.ts +8 -0
- package/dist/cloudflare/bindings/remote.js +261 -0
- package/dist/cloudflare/workers/contract.d.ts +8 -0
- package/dist/cloudflare/workers/contract.js +65 -0
- package/dist/cloudflare/workers/feature.d.ts +10 -0
- package/dist/cloudflare/workers/feature.js +28 -0
- package/dist/cloudflare/workers/runtime.d.ts +23 -0
- package/dist/cloudflare/workers/runtime.js +121 -0
- package/dist/cloudflare/workers/types.d.ts +49 -0
- package/dist/cloudflare/workers/types.js +1 -0
- package/dist/cloudflare/workers/worker-runtime.d.ts +44 -0
- package/dist/cloudflare/workers/worker-runtime.js +267 -0
- package/dist/compat/assert/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/assert/LICENSE-APACHE +177 -0
- package/dist/compat/assert/assertion-error.d.ts +26 -0
- package/dist/compat/assert/assertion-error.js +468 -0
- package/dist/compat/assert/diff.d.ts +26 -0
- package/dist/compat/assert/diff.js +329 -0
- package/dist/compat/assert/errors.d.ts +11 -0
- package/dist/compat/assert/errors.js +55 -0
- package/dist/compat/assert/index.cjs +24 -0
- package/dist/compat/assert/index.d.cts +43 -0
- package/dist/compat/assert/index.d.ts +50 -0
- package/dist/compat/assert/index.js +858 -0
- package/dist/compat/async-hooks/LICENSE-APACHE +177 -0
- package/dist/compat/async-hooks/NOTICE.md +8 -0
- package/dist/compat/async-hooks/callbacks.d.ts +7 -0
- package/dist/compat/async-hooks/callbacks.js +18 -0
- package/dist/compat/async-hooks/hooks.d.ts +10 -0
- package/dist/compat/async-hooks/hooks.js +111 -0
- package/dist/compat/async-hooks/index.d.ts +41 -0
- package/dist/compat/async-hooks/index.js +298 -0
- package/dist/compat/buffer/LICENSE-3RD-PARTY.md +15 -0
- package/dist/compat/buffer/LICENSE-APACHE +177 -0
- package/dist/compat/buffer/blob.d.ts +22 -0
- package/dist/compat/buffer/blob.js +210 -0
- package/dist/compat/buffer/bytes.d.ts +34 -0
- package/dist/compat/buffer/bytes.js +228 -0
- package/dist/compat/buffer/errors.d.ts +41 -0
- package/dist/compat/buffer/errors.js +265 -0
- package/dist/compat/buffer/index.d.ts +25 -0
- package/dist/compat/buffer/index.js +24 -0
- package/dist/compat/buffer/internal-buffer.d.ts +148 -0
- package/dist/compat/buffer/internal-buffer.js +1809 -0
- package/dist/compat/buffer/support.d.ts +13 -0
- package/dist/compat/buffer/support.js +65 -0
- package/dist/compat/child-process/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/child-process/LICENSE-APACHE +177 -0
- package/dist/compat/child-process/errors.d.ts +4 -0
- package/dist/compat/child-process/errors.js +6 -0
- package/dist/compat/child-process/index.d.ts +49 -0
- package/dist/compat/child-process/index.js +96 -0
- package/dist/compat/cluster/LICENSE-3RD-PARTY.md +40 -0
- package/dist/compat/cluster/LICENSE-APACHE +177 -0
- package/dist/compat/cluster/errors.d.ts +4 -0
- package/dist/compat/cluster/errors.js +6 -0
- package/dist/compat/cluster/index.d.ts +47 -0
- package/dist/compat/cluster/index.js +88 -0
- package/dist/compat/constants/LICENSE-3RD-PARTY.md +6 -0
- package/dist/compat/constants/LICENSE-APACHE +177 -0
- package/dist/compat/constants/index.d.ts +481 -0
- package/dist/compat/constants/index.js +488 -0
- package/dist/compat/dgram/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/dgram/LICENSE-APACHE +177 -0
- package/dist/compat/dgram/index.d.ts +10 -0
- package/dist/compat/dgram/index.js +132 -0
- package/dist/compat/diagnostics-channel/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/diagnostics-channel/LICENSE-APACHE +177 -0
- package/dist/compat/diagnostics-channel/index.d.ts +73 -0
- package/dist/compat/diagnostics-channel/index.js +261 -0
- package/dist/compat/diagnostics-channel/native.d.ts +26 -0
- package/dist/compat/diagnostics-channel/native.js +154 -0
- package/dist/compat/dns/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/dns/LICENSE-APACHE +177 -0
- package/dist/compat/dns/client.d.ts +72 -0
- package/dist/compat/dns/client.js +161 -0
- package/dist/compat/dns/constants.d.ts +27 -0
- package/dist/compat/dns/constants.js +31 -0
- package/dist/compat/dns/errors.d.ts +8 -0
- package/dist/compat/dns/errors.js +12 -0
- package/dist/compat/dns/index.d.ts +97 -0
- package/dist/compat/dns/index.js +127 -0
- package/dist/compat/dns/parser.d.ts +18 -0
- package/dist/compat/dns/parser.js +144 -0
- package/dist/compat/dns/promise-resolver.d.ts +82 -0
- package/dist/compat/dns/promise-resolver.js +113 -0
- package/dist/compat/dns/promises.d.ts +50 -0
- package/dist/compat/dns/promises.js +53 -0
- package/dist/compat/dns/resolver.d.ts +34 -0
- package/dist/compat/dns/resolver.js +415 -0
- package/dist/compat/domain/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/domain/LICENSE-APACHE +177 -0
- package/dist/compat/domain/index.d.ts +22 -0
- package/dist/compat/domain/index.js +79 -0
- package/dist/compat/fs/index.d.ts +85 -0
- package/dist/compat/fs/index.js +255 -0
- package/dist/compat/fs/promises/index.d.ts +3 -0
- package/dist/compat/fs/promises/index.js +3 -0
- package/dist/compat/http/index.d.ts +322 -0
- package/dist/compat/http/index.js +1356 -0
- package/dist/compat/http/registry.d.ts +19 -0
- package/dist/compat/http/registry.js +13 -0
- package/dist/compat/http-agent/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/http-agent/LICENSE-APACHE +177 -0
- package/dist/compat/http-agent/index.d.ts +7 -0
- package/dist/compat/http-agent/index.js +10 -0
- package/dist/compat/http-client/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/http-client/LICENSE-APACHE +177 -0
- package/dist/compat/http-client/index.d.ts +6 -0
- package/dist/compat/http-client/index.js +7 -0
- package/dist/compat/http-incoming/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/http-incoming/LICENSE-APACHE +177 -0
- package/dist/compat/http-incoming/index.d.ts +6 -0
- package/dist/compat/http-incoming/index.js +9 -0
- package/dist/compat/http2/LICENSE-3RD-PARTY.md +29 -0
- package/dist/compat/http2/LICENSE-APACHE +177 -0
- package/dist/compat/http2/constants.d.ts +255 -0
- package/dist/compat/http2/constants.js +515 -0
- package/dist/compat/http2/errors.d.ts +4 -0
- package/dist/compat/http2/errors.js +6 -0
- package/dist/compat/http2/index.d.ts +283 -0
- package/dist/compat/http2/index.js +68 -0
- package/dist/compat/https/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/https/LICENSE-APACHE +177 -0
- package/dist/compat/https/agent.d.ts +10 -0
- package/dist/compat/https/agent.js +99 -0
- package/dist/compat/https/errors.d.ts +4 -0
- package/dist/compat/https/errors.js +6 -0
- package/dist/compat/https/index.d.ts +20 -0
- package/dist/compat/https/index.js +50 -0
- package/dist/compat/https/server.d.ts +8 -0
- package/dist/compat/https/server.js +27 -0
- package/dist/compat/immediate/index.d.ts +11 -0
- package/dist/compat/immediate/index.js +58 -0
- package/dist/compat/inspector/LICENSE-3RD-PARTY.md +34 -0
- package/dist/compat/inspector/LICENSE-APACHE +177 -0
- package/dist/compat/inspector/errors.d.ts +4 -0
- package/dist/compat/inspector/errors.js +6 -0
- package/dist/compat/inspector/index.d.ts +18 -0
- package/dist/compat/inspector/index.js +117 -0
- package/dist/compat/inspector/promises.d.ts +18 -0
- package/dist/compat/inspector/promises.js +114 -0
- package/dist/compat/module/index.cjs +2 -0
- package/dist/compat/module/index.d.cts +2 -0
- package/dist/compat/module/index.d.ts +11 -0
- package/dist/compat/module/index.js +44 -0
- package/dist/compat/module/resolve-unavailable.d.ts +1 -0
- package/dist/compat/module/resolve-unavailable.js +3 -0
- package/dist/compat/net/LICENSE-3RD-PARTY.md +15 -0
- package/dist/compat/net/LICENSE-APACHE +177 -0
- package/dist/compat/net/error-base.d.ts +14 -0
- package/dist/compat/net/error-base.js +62 -0
- package/dist/compat/net/errors.d.ts +76 -0
- package/dist/compat/net/errors.js +333 -0
- package/dist/compat/net/index.d.ts +23 -0
- package/dist/compat/net/index.js +46 -0
- package/dist/compat/net/internal-net.d.ts +236 -0
- package/dist/compat/net/internal-net.js +2292 -0
- package/dist/compat/net/ports.d.ts +32 -0
- package/dist/compat/net/ports.js +149 -0
- package/dist/compat/net/reader.d.ts +8 -0
- package/dist/compat/net/reader.js +36 -0
- package/dist/compat/net/sockets.d.ts +20 -0
- package/dist/compat/net/sockets.js +195 -0
- package/dist/compat/net/validators.d.ts +18 -0
- package/dist/compat/net/validators.js +154 -0
- package/dist/compat/os/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/os/LICENSE-APACHE +177 -0
- package/dist/compat/os/index.d.ts +329 -0
- package/dist/compat/os/index.js +278 -0
- package/dist/compat/path/LICENSE-3RD-PARTY.md +35 -0
- package/dist/compat/path/LICENSE-APACHE +177 -0
- package/dist/compat/path/index.d.ts +4 -0
- package/dist/compat/path/index.js +11 -0
- package/dist/compat/path/internal-path.d.ts +95 -0
- package/dist/compat/path/internal-path.js +1542 -0
- package/dist/compat/path/posix/index.d.ts +4 -0
- package/dist/compat/path/posix/index.js +5 -0
- package/dist/compat/path/win32/index.d.ts +4 -0
- package/dist/compat/path/win32/index.js +5 -0
- package/dist/compat/perf-hooks/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/perf-hooks/LICENSE-APACHE +177 -0
- package/dist/compat/perf-hooks/index.d.ts +85 -0
- package/dist/compat/perf-hooks/index.js +79 -0
- package/dist/compat/perf-hooks/performance.d.ts +96 -0
- package/dist/compat/perf-hooks/performance.js +445 -0
- package/dist/compat/punycode/LICENSE-3RD-PARTY.md +7 -0
- package/dist/compat/punycode/LICENSE-APACHE +177 -0
- package/dist/compat/punycode/index.d.ts +93 -0
- package/dist/compat/punycode/index.js +410 -0
- package/dist/compat/querystring/LICENSE-3RD-PARTY.md +35 -0
- package/dist/compat/querystring/LICENSE-APACHE +177 -0
- package/dist/compat/querystring/index.d.ts +14 -0
- package/dist/compat/querystring/index.js +18 -0
- package/dist/compat/querystring/internal-querystring.d.ts +22 -0
- package/dist/compat/querystring/internal-querystring.js +498 -0
- package/dist/compat/readline/LICENSE-3RD-PARTY.md +37 -0
- package/dist/compat/readline/LICENSE-APACHE +177 -0
- package/dist/compat/readline/index.d.ts +21 -0
- package/dist/compat/readline/index.js +56 -0
- package/dist/compat/readline/interface.d.ts +22 -0
- package/dist/compat/readline/interface.js +85 -0
- package/dist/compat/readline/internal-promises.d.ts +32 -0
- package/dist/compat/readline/internal-promises.js +104 -0
- package/dist/compat/readline/promises.d.ts +8 -0
- package/dist/compat/readline/promises.js +32 -0
- package/dist/compat/repl/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/repl/LICENSE-APACHE +177 -0
- package/dist/compat/repl/builtin-modules.d.ts +1 -0
- package/dist/compat/repl/builtin-modules.js +101 -0
- package/dist/compat/repl/errors.d.ts +4 -0
- package/dist/compat/repl/errors.js +6 -0
- package/dist/compat/repl/index.d.ts +53 -0
- package/dist/compat/repl/index.js +106 -0
- package/dist/compat/sqlite/LICENSE-3RD-PARTY.md +6 -0
- package/dist/compat/sqlite/LICENSE-APACHE +177 -0
- package/dist/compat/sqlite/index.d.ts +12 -0
- package/dist/compat/sqlite/index.js +101 -0
- package/dist/compat/sqlite/native.d.ts +16 -0
- package/dist/compat/sqlite/native.js +33 -0
- package/dist/compat/stream/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream/LICENSE-APACHE +177 -0
- package/dist/compat/stream/add-abort-signal.d.ts +4 -0
- package/dist/compat/stream/add-abort-signal.js +73 -0
- package/dist/compat/stream/compose.d.ts +1 -0
- package/dist/compat/stream/compose.js +313 -0
- package/dist/compat/stream/destroy.d.ts +5 -0
- package/dist/compat/stream/destroy.js +315 -0
- package/dist/compat/stream/duplex.d.ts +48 -0
- package/dist/compat/stream/duplex.js +789 -0
- package/dist/compat/stream/end-of-stream.d.ts +16 -0
- package/dist/compat/stream/end-of-stream.js +269 -0
- package/dist/compat/stream/errors.d.ts +40 -0
- package/dist/compat/stream/errors.js +86 -0
- package/dist/compat/stream/events.d.ts +6 -0
- package/dist/compat/stream/events.js +28 -0
- package/dist/compat/stream/index.cjs +27 -0
- package/dist/compat/stream/index.d.cts +25 -0
- package/dist/compat/stream/index.d.ts +20 -0
- package/dist/compat/stream/index.js +55 -0
- package/dist/compat/stream/legacy.d.ts +8 -0
- package/dist/compat/stream/legacy.js +105 -0
- package/dist/compat/stream/once.d.ts +7 -0
- package/dist/compat/stream/once.js +13 -0
- package/dist/compat/stream/pipeline.d.ts +5 -0
- package/dist/compat/stream/pipeline.js +567 -0
- package/dist/compat/stream/process.d.ts +1 -0
- package/dist/compat/stream/process.js +4 -0
- package/dist/compat/stream/promises.d.ts +7 -0
- package/dist/compat/stream/promises.js +60 -0
- package/dist/compat/stream/readable.d.ts +29 -0
- package/dist/compat/stream/readable.js +2267 -0
- package/dist/compat/stream/state.d.ts +8 -0
- package/dist/compat/stream/state.js +63 -0
- package/dist/compat/stream/transform.d.ts +2 -0
- package/dist/compat/stream/transform.js +202 -0
- package/dist/compat/stream/util.d.ts +55 -0
- package/dist/compat/stream/util.js +345 -0
- package/dist/compat/stream/validators.d.ts +2 -0
- package/dist/compat/stream/validators.js +14 -0
- package/dist/compat/stream/writable.d.ts +21 -0
- package/dist/compat/stream/writable.js +1325 -0
- package/dist/compat/stream-consumers/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/stream-consumers/LICENSE-APACHE +177 -0
- package/dist/compat/stream-consumers/index.d.ts +14 -0
- package/dist/compat/stream-consumers/index.js +62 -0
- package/dist/compat/stream-consumers/iterable.d.ts +1 -0
- package/dist/compat/stream-consumers/iterable.js +34 -0
- package/dist/compat/stream-duplex/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-duplex/LICENSE-APACHE +177 -0
- package/dist/compat/stream-duplex/index.cjs +3 -0
- package/dist/compat/stream-duplex/index.d.cts +2 -0
- package/dist/compat/stream-duplex/index.d.ts +3 -0
- package/dist/compat/stream-duplex/index.js +8 -0
- package/dist/compat/stream-passthrough/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-passthrough/LICENSE-APACHE +177 -0
- package/dist/compat/stream-passthrough/index.cjs +3 -0
- package/dist/compat/stream-passthrough/index.d.cts +2 -0
- package/dist/compat/stream-passthrough/index.d.ts +3 -0
- package/dist/compat/stream-passthrough/index.js +8 -0
- package/dist/compat/stream-promises/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-promises/LICENSE-APACHE +177 -0
- package/dist/compat/stream-promises/index.d.ts +1 -0
- package/dist/compat/stream-promises/index.js +1 -0
- package/dist/compat/stream-readable/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-readable/LICENSE-APACHE +177 -0
- package/dist/compat/stream-readable/index.cjs +3 -0
- package/dist/compat/stream-readable/index.d.cts +2 -0
- package/dist/compat/stream-readable/index.d.ts +3 -0
- package/dist/compat/stream-readable/index.js +8 -0
- package/dist/compat/stream-transform/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-transform/LICENSE-APACHE +177 -0
- package/dist/compat/stream-transform/index.cjs +3 -0
- package/dist/compat/stream-transform/index.d.cts +2 -0
- package/dist/compat/stream-transform/index.d.ts +3 -0
- package/dist/compat/stream-transform/index.js +8 -0
- package/dist/compat/stream-web/LICENSE-MIT +22 -0
- package/dist/compat/stream-web/NOTICE.md +3 -0
- package/dist/compat/stream-web/context.d.ts +2 -0
- package/dist/compat/stream-web/context.js +35 -0
- package/dist/compat/stream-web/index.d.ts +80 -0
- package/dist/compat/stream-web/index.js +129 -0
- package/dist/compat/stream-web/interop.d.ts +6 -0
- package/dist/compat/stream-web/interop.js +72 -0
- package/dist/compat/stream-web/ponyfill.d.ts +1 -0
- package/dist/compat/stream-web/ponyfill.js +2093 -0
- package/dist/compat/stream-web/runtime.d.ts +16 -0
- package/dist/compat/stream-web/runtime.js +51 -0
- package/dist/compat/stream-writable/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-writable/LICENSE-APACHE +177 -0
- package/dist/compat/stream-writable/index.cjs +3 -0
- package/dist/compat/stream-writable/index.d.cts +2 -0
- package/dist/compat/stream-writable/index.d.ts +3 -0
- package/dist/compat/stream-writable/index.js +8 -0
- package/dist/compat/string-decoder/LICENSE-3RD-PARTY.md +38 -0
- package/dist/compat/string-decoder/LICENSE-APACHE +177 -0
- package/dist/compat/string-decoder/index.d.ts +33 -0
- package/dist/compat/string-decoder/index.js +518 -0
- package/dist/compat/test/LICENSE-3RD-PARTY.md +37 -0
- package/dist/compat/test/LICENSE-APACHE +177 -0
- package/dist/compat/test/index.d.ts +9 -0
- package/dist/compat/test/index.js +11 -0
- package/dist/compat/test/mock.d.ts +103 -0
- package/dist/compat/test/mock.js +397 -0
- package/dist/compat/test/validators.d.ts +2 -0
- package/dist/compat/test/validators.js +14 -0
- package/dist/compat/timers/LICENSE-3RD-PARTY.md +7 -0
- package/dist/compat/timers/LICENSE-APACHE +177 -0
- package/dist/compat/timers/errors.d.ts +28 -0
- package/dist/compat/timers/errors.js +206 -0
- package/dist/compat/timers/host.d.ts +11 -0
- package/dist/compat/timers/host.js +60 -0
- package/dist/compat/timers/index.cjs +3 -0
- package/dist/compat/timers/index.d.cts +23 -0
- package/dist/compat/timers/index.d.ts +36 -0
- package/dist/compat/timers/index.js +20 -0
- package/dist/compat/timers/installation.d.ts +4 -0
- package/dist/compat/timers/installation.js +61 -0
- package/dist/compat/timers/internal-promises.d.ts +19 -0
- package/dist/compat/timers/internal-promises.js +173 -0
- package/dist/compat/timers/promises.cjs +2 -0
- package/dist/compat/timers/promises.d.cts +12 -0
- package/dist/compat/timers/promises.d.ts +14 -0
- package/dist/compat/timers/promises.js +3 -0
- package/dist/compat/timers/timers.d.ts +32 -0
- package/dist/compat/timers/timers.js +147 -0
- package/dist/compat/timers/validation.d.ts +5 -0
- package/dist/compat/timers/validation.js +22 -0
- package/dist/compat/timers/wait.d.ts +4 -0
- package/dist/compat/timers/wait.js +91 -0
- package/dist/compat/tls-common/LICENSE-3RD-PARTY.md +11 -0
- package/dist/compat/tls-common/LICENSE-APACHE +177 -0
- package/dist/compat/tls-common/index.d.ts +14 -0
- package/dist/compat/tls-common/index.js +88 -0
- package/dist/compat/trace-events/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/trace-events/LICENSE-APACHE +177 -0
- package/dist/compat/trace-events/index.d.ts +18 -0
- package/dist/compat/trace-events/index.js +88 -0
- package/dist/compat/tty/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/tty/LICENSE-APACHE +177 -0
- package/dist/compat/tty/index.d.ts +17 -0
- package/dist/compat/tty/index.js +101 -0
- package/dist/compat/url/LICENSE-3RD-PARTY.md +63 -0
- package/dist/compat/url/LICENSE-ADA +18 -0
- package/dist/compat/url/LICENSE-APACHE +177 -0
- package/dist/compat/url/LICENSE-UNICODE +39 -0
- package/dist/compat/url/LICENSE-WHATWG-URL +21 -0
- package/dist/compat/url/brand.d.ts +4 -0
- package/dist/compat/url/brand.js +10 -0
- package/dist/compat/url/constants.d.ts +27 -0
- package/dist/compat/url/constants.js +28 -0
- package/dist/compat/url/errors.d.ts +44 -0
- package/dist/compat/url/errors.js +248 -0
- package/dist/compat/url/idna-data.d.ts +3958 -0
- package/dist/compat/url/idna-data.js +22 -0
- package/dist/compat/url/idna.d.ts +9 -0
- package/dist/compat/url/idna.js +47 -0
- package/dist/compat/url/index.d.ts +48 -0
- package/dist/compat/url/index.js +39 -0
- package/dist/compat/url/installation.d.ts +4 -0
- package/dist/compat/url/installation.js +61 -0
- package/dist/compat/url/internal-url.d.ts +34 -0
- package/dist/compat/url/internal-url.js +264 -0
- package/dist/compat/url/legacy-url.d.ts +28 -0
- package/dist/compat/url/legacy-url.js +870 -0
- package/dist/compat/url/parser-platform.d.ts +3 -0
- package/dist/compat/url/parser-platform.js +26 -0
- package/dist/compat/url/standard-url.d.ts +2 -0
- package/dist/compat/url/standard-url.js +3189 -0
- package/dist/compat/url/unicode.d.ts +2 -0
- package/dist/compat/url/unicode.js +119 -0
- package/dist/compat/url/validation.d.ts +2 -0
- package/dist/compat/url/validation.js +9 -0
- package/dist/compat/url/web-url.d.ts +27 -0
- package/dist/compat/url/web-url.js +119 -0
- package/dist/compat/util/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/util/LICENSE-APACHE +177 -0
- package/dist/compat/util/additional.d.ts +11 -0
- package/dist/compat/util/additional.js +121 -0
- package/dist/compat/util/comparison-types.d.ts +16 -0
- package/dist/compat/util/comparison-types.js +50 -0
- package/dist/compat/util/comparisons.d.ts +1 -0
- package/dist/compat/util/comparisons.js +527 -0
- package/dist/compat/util/core.d.ts +18 -0
- package/dist/compat/util/core.js +265 -0
- package/dist/compat/util/debuglog.d.ts +1 -0
- package/dist/compat/util/debuglog.js +78 -0
- package/dist/compat/util/index.d.ts +35 -0
- package/dist/compat/util/index.js +77 -0
- package/dist/compat/util/inspect-binding.d.ts +13 -0
- package/dist/compat/util/inspect-binding.js +39 -0
- package/dist/compat/util/inspect-types.d.ts +13 -0
- package/dist/compat/util/inspect-types.js +30 -0
- package/dist/compat/util/inspect.d.ts +152 -0
- package/dist/compat/util/inspect.js +2503 -0
- package/dist/compat/util/mime.d.ts +24 -0
- package/dist/compat/util/mime.js +284 -0
- package/dist/compat/util/properties.d.ts +9 -0
- package/dist/compat/util/properties.js +76 -0
- package/dist/compat/v8/LICENSE-3RD-PARTY.md +6 -0
- package/dist/compat/v8/LICENSE-APACHE +177 -0
- package/dist/compat/v8/errors.d.ts +5 -0
- package/dist/compat/v8/errors.js +7 -0
- package/dist/compat/v8/index.d.ts +106 -0
- package/dist/compat/v8/index.js +280 -0
- package/dist/compat/vm/LICENSE-3RD-PARTY.md +39 -0
- package/dist/compat/vm/LICENSE-APACHE +177 -0
- package/dist/compat/vm/errors.d.ts +5 -0
- package/dist/compat/vm/errors.js +7 -0
- package/dist/compat/vm/index.d.ts +47 -0
- package/dist/compat/vm/index.js +231 -0
- package/dist/compat/vm/validation.d.ts +3 -0
- package/dist/compat/vm/validation.js +14 -0
- package/dist/compat/wasi/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/wasi/LICENSE-APACHE +177 -0
- package/dist/compat/wasi/errors.d.ts +4 -0
- package/dist/compat/wasi/errors.js +6 -0
- package/dist/compat/wasi/index.d.ts +15 -0
- package/dist/compat/wasi/index.js +44 -0
- package/dist/compat/worker-threads/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/worker-threads/LICENSE-APACHE +177 -0
- package/dist/compat/worker-threads/errors.d.ts +4 -0
- package/dist/compat/worker-threads/errors.js +6 -0
- package/dist/compat/worker-threads/index.d.ts +71 -0
- package/dist/compat/worker-threads/index.js +138 -0
- package/dist/compat/worker-threads/message-channel.d.ts +18 -0
- package/dist/compat/worker-threads/message-channel.js +157 -0
- package/dist/configured.d.ts +3 -0
- package/dist/configured.js +4 -0
- package/dist/environment.d.ts +4 -0
- package/dist/environment.js +18 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +107 -0
- package/dist/ios.d.ts +2 -0
- package/dist/ios.js +1 -0
- package/dist/native-entry.d.ts +8 -0
- package/dist/native-entry.js +67 -0
- package/dist/shared/brotli/LICENSE-APACHE +201 -0
- package/dist/shared/brotli/LICENSE-MIT +9 -0
- package/dist/shared/brotli/NOTICE +3 -0
- package/dist/shared/brotli/index.d.ts +2 -0
- package/dist/shared/brotli/index.js +288 -0
- package/dist/shared/contracts/index.d.ts +42 -0
- package/dist/shared/contracts/index.js +88 -0
- package/dist/shared/contracts/testing.d.ts +22 -0
- package/dist/shared/contracts/testing.js +57 -0
- package/dist/shared/globals/index.d.ts +3 -0
- package/dist/shared/globals/index.js +87 -0
- package/dist/shared/globals/inject.d.ts +2 -0
- package/dist/shared/globals/inject.js +3 -0
- package/dist/shared/globals/install.d.ts +1 -0
- package/dist/shared/globals/install.js +15 -0
- package/dist/shared/globals/node-install.d.ts +1 -0
- package/dist/shared/globals/node-install.js +4 -0
- package/dist/shared/globals/platform.d.ts +104 -0
- package/dist/shared/globals/platform.js +37 -0
- package/dist/shared/globals/runtime.d.ts +6 -0
- package/dist/shared/globals/runtime.js +8 -0
- package/dist/shared/globals/symbols.d.ts +4 -0
- package/dist/shared/globals/symbols.js +35 -0
- package/dist/shared/globals/web.d.ts +4 -0
- package/dist/shared/globals/web.js +108 -0
- package/dist/shared/http-wire/LICENSE.llhttp +22 -0
- package/dist/shared/http-wire/LICENSE.undici +21 -0
- package/dist/shared/http-wire/NOTICE.md +14 -0
- package/dist/shared/http-wire/index.d.ts +27 -0
- package/dist/shared/http-wire/index.js +132 -0
- package/dist/shared/http-wire/wasm.d.ts +2 -0
- package/dist/shared/http-wire/wasm.js +2 -0
- package/dist/tooling/async.d.ts +7 -0
- package/dist/tooling/async.js +99 -0
- package/dist/tooling/build-isolation.d.ts +4 -0
- package/dist/tooling/build-isolation.js +34 -0
- package/dist/tooling/documents.d.ts +7 -0
- package/dist/tooling/documents.js +26 -0
- package/dist/tooling/esbuild.d.ts +15 -0
- package/dist/tooling/esbuild.js +193 -0
- package/dist/tooling/files.d.ts +2 -0
- package/dist/tooling/files.js +18 -0
- package/dist/tooling/opennext/build.d.ts +1 -0
- package/dist/tooling/opennext/build.js +121 -0
- package/dist/tooling/opennext/index.d.ts +3 -0
- package/dist/tooling/opennext/index.js +213 -0
- package/dist/tooling/opennext/plan.d.ts +9 -0
- package/dist/tooling/opennext/plan.js +36 -0
- package/dist/tooling/opennext/safety.d.ts +4 -0
- package/dist/tooling/opennext/safety.js +36 -0
- package/dist/tooling/route-permissions.d.ts +3 -0
- package/dist/tooling/route-permissions.js +15 -0
- package/dist/tooling/server-modules.d.ts +30 -0
- package/dist/tooling/server-modules.js +98 -0
- package/dist/tooling/server-only-html.d.ts +1 -0
- package/dist/tooling/server-only-html.js +66 -0
- package/dist/tooling/server-only.d.ts +6 -0
- package/dist/tooling/server-only.js +53 -0
- package/dist/tooling/server.d.ts +25 -0
- package/dist/tooling/server.js +981 -0
- package/dist/tooling/shared.d.ts +13 -0
- package/dist/tooling/shared.js +130 -0
- package/dist/tooling/vite.d.ts +18 -0
- package/dist/tooling/vite.js +448 -0
- package/dist/tooling/void/index.d.ts +3 -0
- package/dist/tooling/void/index.js +205 -0
- package/dist/tooling/void/plan.d.ts +17 -0
- package/dist/tooling/void/plan.js +288 -0
- package/native/android/build.gradle +68 -0
- package/native/android/consumer-rules.pro +2 -0
- package/native/android/src/main/AndroidManifest.xml +6 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkerSockets.java +202 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersCapacitorPlugin.java +256 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNative.java +22 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNativeActivity.java +178 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNativeBridge.java +45 -0
- package/native/ios/DocumentBridge.swift +330 -0
- package/native/ios/NetworkBridge.swift +51 -0
- package/native/ios/SocketBridge.swift +180 -0
- package/native/ios/WorkersCapacitorPlugin.swift +152 -0
- package/native/ios-host/WorkersView.swift +194 -0
- package/package.json +154 -4
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// Copyright (c) 2017-2022 Cloudflare, Inc.
|
|
2
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
3
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
// Adapted from Deno and Node.js:
|
|
6
|
+
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
|
7
|
+
//
|
|
8
|
+
// Adapted from Node.js. Copyright Joyent, Inc. and other Node contributors.
|
|
9
|
+
//
|
|
10
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
11
|
+
// copy of this software and associated documentation files (the
|
|
12
|
+
// "Software"), to deal in the Software without restriction, including
|
|
13
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
14
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
15
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
16
|
+
// following conditions:
|
|
17
|
+
//
|
|
18
|
+
// The above copyright notice and this permission notice shall be included
|
|
19
|
+
// in all copies or substantial portions of the Software.
|
|
20
|
+
//
|
|
21
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
22
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
23
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
24
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
25
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
26
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
27
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
import { inspect } from "node:util";
|
|
29
|
+
const classRegExp = /^([A-Z][a-z0-9]*)+$/;
|
|
30
|
+
const kTypes = [
|
|
31
|
+
"string",
|
|
32
|
+
"function",
|
|
33
|
+
"number",
|
|
34
|
+
"object",
|
|
35
|
+
"Function",
|
|
36
|
+
"Object",
|
|
37
|
+
"boolean",
|
|
38
|
+
"bigint",
|
|
39
|
+
"symbol",
|
|
40
|
+
];
|
|
41
|
+
export class NodeErrorAbstraction extends Error {
|
|
42
|
+
code;
|
|
43
|
+
constructor(name, code, message) {
|
|
44
|
+
super(message);
|
|
45
|
+
this.code = code;
|
|
46
|
+
this.name = name;
|
|
47
|
+
}
|
|
48
|
+
toString() {
|
|
49
|
+
return `${this.name} [${this.code}]: ${this.message}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export class NodeError extends NodeErrorAbstraction {
|
|
53
|
+
constructor(code, message) {
|
|
54
|
+
super(Error.prototype.name, code, message);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export class NodeRangeError extends NodeErrorAbstraction {
|
|
58
|
+
constructor(code, message) {
|
|
59
|
+
super(RangeError.prototype.name, code, message);
|
|
60
|
+
Object.setPrototypeOf(this, RangeError.prototype);
|
|
61
|
+
this.toString = function () {
|
|
62
|
+
return `${this.name} [${this.code}]: ${this.message}`;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export class NodeTypeError extends NodeErrorAbstraction {
|
|
67
|
+
constructor(code, message) {
|
|
68
|
+
super(TypeError.prototype.name, code, message);
|
|
69
|
+
Object.setPrototypeOf(this, TypeError.prototype);
|
|
70
|
+
this.toString = function () {
|
|
71
|
+
return `${this.name} [${this.code}]: ${this.message}`;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function createInvalidArgType(name, expected) {
|
|
76
|
+
// https://github.com/nodejs/node/blob/f3eb224/lib/internal/errors.js#L1037-L1087
|
|
77
|
+
expected = Array.isArray(expected) ? expected : [expected];
|
|
78
|
+
let msg = "The ";
|
|
79
|
+
if (name.endsWith(" argument")) {
|
|
80
|
+
// For cases like 'first argument'
|
|
81
|
+
msg += `${name} `;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const type = name.includes(".") ? "property" : "argument";
|
|
85
|
+
msg += `"${name}" ${type} `;
|
|
86
|
+
}
|
|
87
|
+
msg += "must be ";
|
|
88
|
+
const types = [];
|
|
89
|
+
const instances = [];
|
|
90
|
+
const other = [];
|
|
91
|
+
for (const value of expected) {
|
|
92
|
+
if (kTypes.includes(value)) {
|
|
93
|
+
types.push(value.toLocaleLowerCase());
|
|
94
|
+
}
|
|
95
|
+
else if (classRegExp.test(value)) {
|
|
96
|
+
instances.push(value);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
other.push(value);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Special handle `object` in case other instances are allowed to outline
|
|
103
|
+
// the differences between each other.
|
|
104
|
+
if (instances.length > 0) {
|
|
105
|
+
const pos = types.indexOf("object");
|
|
106
|
+
if (pos !== -1) {
|
|
107
|
+
types.splice(pos, 1);
|
|
108
|
+
instances.push("Object");
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (types.length > 0) {
|
|
112
|
+
if (types.length > 2) {
|
|
113
|
+
const last = types.pop();
|
|
114
|
+
msg += `one of type ${types.join(", ")}, or ${last}`;
|
|
115
|
+
}
|
|
116
|
+
else if (types.length === 2) {
|
|
117
|
+
msg += `one of type ${types[0]} or ${types[1]}`;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
msg += `of type ${types[0]}`;
|
|
121
|
+
}
|
|
122
|
+
if (instances.length > 0 || other.length > 0) {
|
|
123
|
+
msg += " or ";
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (instances.length > 0) {
|
|
127
|
+
if (instances.length > 2) {
|
|
128
|
+
const last = instances.pop();
|
|
129
|
+
msg += `an instance of ${instances.join(", ")}, or ${last}`;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
msg += `an instance of ${instances[0]}`;
|
|
133
|
+
if (instances.length === 2) {
|
|
134
|
+
msg += ` or ${instances[1]}`;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (other.length > 0) {
|
|
138
|
+
msg += " or ";
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (other.length > 0) {
|
|
142
|
+
if (other.length > 2) {
|
|
143
|
+
const last = other.pop();
|
|
144
|
+
msg += `one of ${other.join(", ")}, or ${last}`;
|
|
145
|
+
}
|
|
146
|
+
else if (other.length === 2) {
|
|
147
|
+
msg += `one of ${other[0]} or ${other[1]}`;
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
if (other[0]?.toLowerCase() !== other[0]) {
|
|
151
|
+
msg += "an ";
|
|
152
|
+
}
|
|
153
|
+
msg += `${other[0]}`;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return msg;
|
|
157
|
+
}
|
|
158
|
+
function invalidArgTypeHelper(input) {
|
|
159
|
+
if (input == null) {
|
|
160
|
+
return ` Received ${input}`;
|
|
161
|
+
}
|
|
162
|
+
if (typeof input === "function" && input.name) {
|
|
163
|
+
return ` Received function ${input.name}`;
|
|
164
|
+
}
|
|
165
|
+
if (typeof input === "object") {
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
167
|
+
if (input.constructor?.name) {
|
|
168
|
+
return ` Received an instance of ${input.constructor.name}`;
|
|
169
|
+
}
|
|
170
|
+
return ` Received ${inspect(input, { depth: -1 })}`;
|
|
171
|
+
}
|
|
172
|
+
let inspected = inspect(input, { colors: false });
|
|
173
|
+
if (inspected.length > 25) {
|
|
174
|
+
inspected = `${inspected.slice(0, 25)}...`;
|
|
175
|
+
}
|
|
176
|
+
return ` Received type ${typeof input} (${inspected})`;
|
|
177
|
+
}
|
|
178
|
+
export class ERR_INVALID_ARG_TYPE_RANGE extends NodeRangeError {
|
|
179
|
+
constructor(name, expected, actual) {
|
|
180
|
+
const msg = createInvalidArgType(name, expected);
|
|
181
|
+
super("ERR_INVALID_ARG_TYPE", `${msg}.${invalidArgTypeHelper(actual)}`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
export class ERR_INVALID_ARG_TYPE extends NodeTypeError {
|
|
185
|
+
constructor(name, expected, actual) {
|
|
186
|
+
const msg = createInvalidArgType(name, expected);
|
|
187
|
+
super("ERR_INVALID_ARG_TYPE", `${msg}.${invalidArgTypeHelper(actual)}`);
|
|
188
|
+
}
|
|
189
|
+
static RangeError = ERR_INVALID_ARG_TYPE_RANGE;
|
|
190
|
+
}
|
|
191
|
+
export class ERR_INVALID_THIS extends NodeTypeError {
|
|
192
|
+
constructor(x) {
|
|
193
|
+
super("ERR_INVALID_THIS", `Value of "this" must be of type ${x}`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
export class AbortError extends Error {
|
|
197
|
+
code;
|
|
198
|
+
constructor(message = "The operation was aborted", options) {
|
|
199
|
+
if (options !== undefined && typeof options !== "object") {
|
|
200
|
+
throw new ERR_INVALID_ARG_TYPE("options", "Object", options);
|
|
201
|
+
}
|
|
202
|
+
super(message, options);
|
|
203
|
+
this.code = "ABORT_ERR";
|
|
204
|
+
this.name = "AbortError";
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type Native = {
|
|
2
|
+
setTimeout: typeof globalThis.setTimeout;
|
|
3
|
+
setInterval: typeof globalThis.setInterval;
|
|
4
|
+
clearTimeout: typeof globalThis.clearTimeout;
|
|
5
|
+
clearInterval: typeof globalThis.clearInterval;
|
|
6
|
+
};
|
|
7
|
+
export declare const native: Native;
|
|
8
|
+
export declare function rememberHost(fn: Function): void;
|
|
9
|
+
export declare function schedule(callback: (...args: unknown[]) => unknown, milliseconds: number, args: unknown[], repeat: boolean): number;
|
|
10
|
+
export declare function clear(id: number, repeat: boolean): void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { bindCallback } from "../async-hooks/callbacks.js";
|
|
2
|
+
// Browser timers wrap large delays at 2^31; Workers clamps at 100 years.
|
|
3
|
+
const nativeKey = Symbol.for("workers-capacitor/native-timers");
|
|
4
|
+
export const native = globalThis.setTimeout[nativeKey] ?? {
|
|
5
|
+
setTimeout: globalThis.setTimeout.bind(globalThis),
|
|
6
|
+
setInterval: globalThis.setInterval.bind(globalThis),
|
|
7
|
+
clearTimeout: globalThis.clearTimeout.bind(globalThis),
|
|
8
|
+
clearInterval: globalThis.clearInterval.bind(globalThis),
|
|
9
|
+
};
|
|
10
|
+
export function rememberHost(fn) {
|
|
11
|
+
Object.defineProperty(fn, nativeKey, { value: native });
|
|
12
|
+
}
|
|
13
|
+
const maxChunk = 2147483647;
|
|
14
|
+
const long = new Map();
|
|
15
|
+
export function schedule(callback, milliseconds, args, repeat) {
|
|
16
|
+
if (typeof callback !== "function")
|
|
17
|
+
throw new TypeError("Callback must be a function");
|
|
18
|
+
callback = bindCallback(callback);
|
|
19
|
+
args = [...args];
|
|
20
|
+
const delay = Number.isNaN(milliseconds) || milliseconds <= 0
|
|
21
|
+
? 0
|
|
22
|
+
: Math.min(Math.trunc(milliseconds), 3153600000000);
|
|
23
|
+
if (delay <= maxChunk)
|
|
24
|
+
return (repeat ? native.setInterval : native.setTimeout)(() => Reflect.apply(callback, globalThis, args), delay);
|
|
25
|
+
let remaining = delay;
|
|
26
|
+
let id;
|
|
27
|
+
const state = {
|
|
28
|
+
handle: undefined,
|
|
29
|
+
};
|
|
30
|
+
const arm = () => {
|
|
31
|
+
const chunk = Math.min(remaining, maxChunk);
|
|
32
|
+
remaining -= chunk;
|
|
33
|
+
state.handle = native.setTimeout(() => {
|
|
34
|
+
if (remaining > 0) {
|
|
35
|
+
arm();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (repeat) {
|
|
39
|
+
remaining = delay;
|
|
40
|
+
arm();
|
|
41
|
+
}
|
|
42
|
+
else
|
|
43
|
+
long.delete(id);
|
|
44
|
+
Reflect.apply(callback, globalThis, args);
|
|
45
|
+
}, chunk);
|
|
46
|
+
};
|
|
47
|
+
arm();
|
|
48
|
+
id = state.handle;
|
|
49
|
+
long.set(id, state);
|
|
50
|
+
return id;
|
|
51
|
+
}
|
|
52
|
+
export function clear(id, repeat) {
|
|
53
|
+
const state = long.get(id);
|
|
54
|
+
if (state) {
|
|
55
|
+
native.clearTimeout(state.handle);
|
|
56
|
+
long.delete(id);
|
|
57
|
+
}
|
|
58
|
+
else
|
|
59
|
+
(repeat ? native.clearInterval : native.clearTimeout)(id);
|
|
60
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _exports: {
|
|
2
|
+
promises: {
|
|
3
|
+
setTimeout: typeof import("./internal-promises.js").setTimeout;
|
|
4
|
+
setImmediate: typeof import("./internal-promises.js").setImmediate;
|
|
5
|
+
setInterval: typeof import("./internal-promises.js").setInterval;
|
|
6
|
+
scheduler: {
|
|
7
|
+
yield(): Promise<void>;
|
|
8
|
+
wait(delay: number, options?: {
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
setTimeout: typeof import("./timers.js").setTimeout;
|
|
14
|
+
clearTimeout: typeof import("./timers.js").clearTimeout;
|
|
15
|
+
setImmediate: typeof import("../immediate/index.js").setImmediate;
|
|
16
|
+
clearImmediate: typeof import("../immediate/index.js").clearImmediate;
|
|
17
|
+
setInterval: typeof import("./timers.js").setInterval;
|
|
18
|
+
clearInterval: typeof import("./timers.js").clearInterval;
|
|
19
|
+
active: typeof import("./timers.js").active;
|
|
20
|
+
unenroll: typeof import("./timers.js").unenroll;
|
|
21
|
+
enroll: typeof import("./timers.js").enroll;
|
|
22
|
+
};
|
|
23
|
+
export = _exports;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { setTimeout, clearTimeout, setInterval, clearInterval, active, unenroll, enroll } from "./timers.js";
|
|
2
|
+
export * from "./timers.js";
|
|
3
|
+
export declare const promises: {
|
|
4
|
+
setTimeout: typeof import("./internal-promises.js").setTimeout;
|
|
5
|
+
setImmediate: typeof import("./internal-promises.js").setImmediate;
|
|
6
|
+
setInterval: typeof import("./internal-promises.js").setInterval;
|
|
7
|
+
scheduler: {
|
|
8
|
+
yield(): Promise<void>;
|
|
9
|
+
wait(delay: number, options?: {
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
declare const _default: {
|
|
15
|
+
promises: {
|
|
16
|
+
setTimeout: typeof import("./internal-promises.js").setTimeout;
|
|
17
|
+
setImmediate: typeof import("./internal-promises.js").setImmediate;
|
|
18
|
+
setInterval: typeof import("./internal-promises.js").setInterval;
|
|
19
|
+
scheduler: {
|
|
20
|
+
yield(): Promise<void>;
|
|
21
|
+
wait(delay: number, options?: {
|
|
22
|
+
signal?: AbortSignal;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
setTimeout: typeof setTimeout;
|
|
27
|
+
clearTimeout: typeof clearTimeout;
|
|
28
|
+
setImmediate: typeof import("../immediate/index.js").setImmediate;
|
|
29
|
+
clearImmediate: typeof import("../immediate/index.js").clearImmediate;
|
|
30
|
+
setInterval: typeof setInterval;
|
|
31
|
+
clearInterval: typeof clearInterval;
|
|
32
|
+
active: typeof active;
|
|
33
|
+
unenroll: typeof unenroll;
|
|
34
|
+
enroll: typeof enroll;
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) 2017-2022 Cloudflare, Inc.
|
|
2
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
3
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
4
|
+
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
|
5
|
+
import _promises from "./promises.js";
|
|
6
|
+
import { setTimeout, clearTimeout, setImmediate, clearImmediate, setInterval, clearInterval, active, unenroll, enroll, } from "./timers.js";
|
|
7
|
+
export * from "./timers.js";
|
|
8
|
+
export const promises = _promises;
|
|
9
|
+
export default {
|
|
10
|
+
promises,
|
|
11
|
+
setTimeout,
|
|
12
|
+
clearTimeout,
|
|
13
|
+
setImmediate,
|
|
14
|
+
clearImmediate,
|
|
15
|
+
setInterval,
|
|
16
|
+
clearInterval,
|
|
17
|
+
active,
|
|
18
|
+
unenroll,
|
|
19
|
+
enroll,
|
|
20
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { setTimeout, clearTimeout, setInterval, clearInterval, } from "node:timers";
|
|
2
|
+
const values = { setTimeout, clearTimeout, setInterval, clearInterval };
|
|
3
|
+
const owners = new WeakMap();
|
|
4
|
+
function owns(target, name, expected) {
|
|
5
|
+
const actual = Object.getOwnPropertyDescriptor(target, name);
|
|
6
|
+
return (actual?.value === expected.value &&
|
|
7
|
+
actual?.configurable === expected.configurable &&
|
|
8
|
+
actual?.enumerable === expected.enumerable &&
|
|
9
|
+
actual?.writable === expected.writable);
|
|
10
|
+
}
|
|
11
|
+
function restore(target, patches) {
|
|
12
|
+
for (const [name, patch] of patches)
|
|
13
|
+
if (owns(target, name, patch.installed)) {
|
|
14
|
+
if (patch.previous)
|
|
15
|
+
Object.defineProperty(target, name, patch.previous);
|
|
16
|
+
else
|
|
17
|
+
Reflect.deleteProperty(target, name);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** The pinned Workers profile exposes these Node timer functions globally. */
|
|
21
|
+
export function installTimerGlobals(target = globalThis) {
|
|
22
|
+
let owner = owners.get(target);
|
|
23
|
+
if (owner) {
|
|
24
|
+
for (const [name, patch] of owner.patches)
|
|
25
|
+
if (!owns(target, name, patch.installed))
|
|
26
|
+
throw new Error(`Workers timer ${name} changed during installation`);
|
|
27
|
+
owner.count++;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const patches = new Map();
|
|
31
|
+
try {
|
|
32
|
+
for (const name of Object.keys(values)) {
|
|
33
|
+
const previous = Object.getOwnPropertyDescriptor(target, name);
|
|
34
|
+
const installed = {
|
|
35
|
+
value: values[name],
|
|
36
|
+
configurable: true,
|
|
37
|
+
enumerable: previous?.enumerable ?? false,
|
|
38
|
+
writable: true,
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(target, name, installed);
|
|
41
|
+
patches.set(name, { previous, installed });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
restore(target, patches);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
owner = { count: 1, patches };
|
|
49
|
+
owners.set(target, owner);
|
|
50
|
+
}
|
|
51
|
+
let released = false;
|
|
52
|
+
return () => {
|
|
53
|
+
if (released)
|
|
54
|
+
return;
|
|
55
|
+
released = true;
|
|
56
|
+
if (--owner.count)
|
|
57
|
+
return;
|
|
58
|
+
owners.delete(target);
|
|
59
|
+
restore(target, owner.patches);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function setTimeout<T = void>(delay?: number, value?: T, options?: {
|
|
2
|
+
signal?: AbortSignal | undefined;
|
|
3
|
+
ref?: boolean | undefined;
|
|
4
|
+
}): Promise<T>;
|
|
5
|
+
declare function promiseSetImmediate<T = void>(value?: T, options?: {
|
|
6
|
+
signal?: AbortSignal | undefined;
|
|
7
|
+
ref?: boolean | undefined;
|
|
8
|
+
}): Promise<T>;
|
|
9
|
+
export declare function setInterval<T = void>(delay?: number, value?: T, options?: {
|
|
10
|
+
signal?: AbortSignal | undefined;
|
|
11
|
+
ref?: boolean | undefined;
|
|
12
|
+
}): AsyncGenerator<T, undefined>;
|
|
13
|
+
export declare const scheduler: {
|
|
14
|
+
yield(): Promise<void>;
|
|
15
|
+
wait(delay: number, options?: {
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
export { promiseSetImmediate as setImmediate };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// Copyright (c) 2017-2025 Cloudflare, Inc.
|
|
2
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
3
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
// Adapted from Node.js. Copyright Joyent, Inc. and other Node contributors.
|
|
6
|
+
//
|
|
7
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
8
|
+
// copy of this software and associated documentation files (the
|
|
9
|
+
// "Software"), to deal in the Software without restriction, including
|
|
10
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
11
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
12
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
13
|
+
// following conditions:
|
|
14
|
+
//
|
|
15
|
+
// The above copyright notice and this permission notice shall be included
|
|
16
|
+
// in all copies or substantial portions of the Software.
|
|
17
|
+
//
|
|
18
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
19
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
20
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
21
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
22
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
23
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
24
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
25
|
+
import * as timers from "./timers.js";
|
|
26
|
+
import { ERR_INVALID_THIS, AbortError } from "./errors.js";
|
|
27
|
+
import { validateNumber, validateAbortSignal, validateBoolean, validateObject, } from "./validation.js";
|
|
28
|
+
import { wait } from "./wait.js";
|
|
29
|
+
function deferred() {
|
|
30
|
+
let resolve;
|
|
31
|
+
let reject;
|
|
32
|
+
const promise = new Promise((res, rej) => {
|
|
33
|
+
resolve = res;
|
|
34
|
+
reject = rej;
|
|
35
|
+
});
|
|
36
|
+
return { promise, resolve, reject };
|
|
37
|
+
}
|
|
38
|
+
const kScheduler = Symbol.for("kScheduler");
|
|
39
|
+
export async function setTimeout(delay, value, options = {}) {
|
|
40
|
+
if (delay !== undefined) {
|
|
41
|
+
validateNumber(delay, "delay");
|
|
42
|
+
}
|
|
43
|
+
validateObject(options, "options");
|
|
44
|
+
// Ref options is a no-op.
|
|
45
|
+
const { signal, ref } = options;
|
|
46
|
+
if (signal !== undefined) {
|
|
47
|
+
validateAbortSignal(signal, "options.signal");
|
|
48
|
+
}
|
|
49
|
+
// This is required due to consistency/compat reasons, even if it's a no-op.
|
|
50
|
+
if (ref !== undefined) {
|
|
51
|
+
validateBoolean(ref, "options.ref");
|
|
52
|
+
}
|
|
53
|
+
if (signal?.aborted) {
|
|
54
|
+
throw new AbortError(undefined, { cause: signal.reason });
|
|
55
|
+
}
|
|
56
|
+
const { promise, resolve, reject } = deferred();
|
|
57
|
+
let onCancel;
|
|
58
|
+
const timer = timers.setTimeout(() => {
|
|
59
|
+
resolve(value);
|
|
60
|
+
if (onCancel) {
|
|
61
|
+
signal?.removeEventListener("abort", onCancel);
|
|
62
|
+
}
|
|
63
|
+
}, delay ?? 1);
|
|
64
|
+
if (signal) {
|
|
65
|
+
onCancel = () => {
|
|
66
|
+
timers.clearTimeout(timer);
|
|
67
|
+
reject(new AbortError(undefined, { cause: signal.reason }));
|
|
68
|
+
};
|
|
69
|
+
signal.addEventListener("abort", onCancel, { once: true });
|
|
70
|
+
}
|
|
71
|
+
return promise;
|
|
72
|
+
}
|
|
73
|
+
async function promiseSetImmediate(value, options = {}) {
|
|
74
|
+
validateObject(options, "options");
|
|
75
|
+
// Ref options is a no-op.
|
|
76
|
+
const { signal, ref } = options;
|
|
77
|
+
if (signal !== undefined) {
|
|
78
|
+
validateAbortSignal(signal, "options.signal");
|
|
79
|
+
}
|
|
80
|
+
// This is required due to consistency/compat reasons, even if it's a no-op.
|
|
81
|
+
if (ref !== undefined) {
|
|
82
|
+
validateBoolean(ref, "options.ref");
|
|
83
|
+
}
|
|
84
|
+
if (signal?.aborted) {
|
|
85
|
+
throw new AbortError(undefined, { cause: signal.reason });
|
|
86
|
+
}
|
|
87
|
+
const { promise, resolve, reject } = deferred();
|
|
88
|
+
let onCancel;
|
|
89
|
+
const timer = timers.setImmediate(() => {
|
|
90
|
+
resolve(value);
|
|
91
|
+
if (onCancel) {
|
|
92
|
+
signal?.removeEventListener("abort", onCancel);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
if (signal) {
|
|
96
|
+
onCancel = () => {
|
|
97
|
+
timers.clearImmediate(timer);
|
|
98
|
+
reject(new AbortError(undefined, { cause: signal.reason }));
|
|
99
|
+
};
|
|
100
|
+
signal.addEventListener("abort", onCancel, { once: true });
|
|
101
|
+
}
|
|
102
|
+
return promise;
|
|
103
|
+
}
|
|
104
|
+
export async function* setInterval(delay, value, options = {}) {
|
|
105
|
+
if (delay !== undefined) {
|
|
106
|
+
validateNumber(delay, "delay");
|
|
107
|
+
}
|
|
108
|
+
validateObject(options, "options");
|
|
109
|
+
// Ref options is a no-op.
|
|
110
|
+
const { signal, ref } = options;
|
|
111
|
+
if (signal !== undefined) {
|
|
112
|
+
validateAbortSignal(signal, "options.signal");
|
|
113
|
+
}
|
|
114
|
+
if (ref !== undefined) {
|
|
115
|
+
validateBoolean(ref, "options.ref");
|
|
116
|
+
}
|
|
117
|
+
if (signal?.aborted) {
|
|
118
|
+
throw new AbortError(undefined, { cause: signal.reason });
|
|
119
|
+
}
|
|
120
|
+
let onCancel;
|
|
121
|
+
let interval;
|
|
122
|
+
try {
|
|
123
|
+
let notYielded = 0;
|
|
124
|
+
let callback;
|
|
125
|
+
interval = new timers.Timeout(() => {
|
|
126
|
+
notYielded++;
|
|
127
|
+
callback?.();
|
|
128
|
+
callback = undefined;
|
|
129
|
+
}, delay, undefined, true, ref);
|
|
130
|
+
if (signal) {
|
|
131
|
+
onCancel = () => {
|
|
132
|
+
timers.clearInterval(interval);
|
|
133
|
+
callback?.(Promise.reject(new AbortError(undefined, { cause: signal.reason })));
|
|
134
|
+
callback = undefined;
|
|
135
|
+
};
|
|
136
|
+
signal.addEventListener("abort", onCancel, { once: true });
|
|
137
|
+
}
|
|
138
|
+
while (!signal?.aborted) {
|
|
139
|
+
if (notYielded === 0) {
|
|
140
|
+
await new Promise((resolve) => (callback = resolve));
|
|
141
|
+
}
|
|
142
|
+
for (; notYielded > 0; notYielded--) {
|
|
143
|
+
yield value;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
throw new AbortError(undefined, { cause: signal.reason });
|
|
147
|
+
}
|
|
148
|
+
finally {
|
|
149
|
+
// @ts-expect-error TS2454 TS detects invalid use before assignment.
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
151
|
+
if (interval) {
|
|
152
|
+
timers.clearInterval(interval);
|
|
153
|
+
}
|
|
154
|
+
if (onCancel) {
|
|
155
|
+
signal?.removeEventListener("abort", onCancel);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
class Scheduler {
|
|
160
|
+
[kScheduler] = true;
|
|
161
|
+
yield() {
|
|
162
|
+
if (!this[kScheduler])
|
|
163
|
+
throw new ERR_INVALID_THIS("Scheduler");
|
|
164
|
+
return promiseSetImmediate();
|
|
165
|
+
}
|
|
166
|
+
wait(delay, options) {
|
|
167
|
+
if (!this[kScheduler])
|
|
168
|
+
throw new ERR_INVALID_THIS("Scheduler");
|
|
169
|
+
return wait(delay, options);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
export const scheduler = new Scheduler();
|
|
173
|
+
export { promiseSetImmediate as setImmediate };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _exports: {
|
|
2
|
+
setTimeout: typeof import("./internal-promises.js").setTimeout;
|
|
3
|
+
setImmediate: typeof import("./internal-promises.js").setImmediate;
|
|
4
|
+
setInterval: typeof import("./internal-promises.js").setInterval;
|
|
5
|
+
scheduler: {
|
|
6
|
+
yield(): Promise<void>;
|
|
7
|
+
wait(delay: number, options?: {
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export = _exports;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./internal-promises.js";
|
|
2
|
+
import { setTimeout, setImmediate, setInterval } from "./internal-promises.js";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
setTimeout: typeof setTimeout;
|
|
5
|
+
setImmediate: typeof setImmediate;
|
|
6
|
+
setInterval: typeof setInterval;
|
|
7
|
+
scheduler: {
|
|
8
|
+
yield(): Promise<void>;
|
|
9
|
+
wait(delay: number, options?: {
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|