@awacloud/fw 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -0
- package/LICENSE +176 -0
- package/NOTICE +12 -0
- package/README.md +355 -0
- package/dist/build/fw.core.pure.meta.json +29 -0
- package/dist/build/fw.core.pure.min.js +26 -0
- package/dist/build/fw.full.pure.meta.json +224 -0
- package/dist/build/fw.full.pure.min.js +60 -0
- package/dist/build/fw.minimal.pure.meta.json +21 -0
- package/dist/build/fw.minimal.pure.min.js +26 -0
- package/dist/build/fw.pack.compress-heavy.pure.meta.json +29 -0
- package/dist/build/fw.pack.compress-heavy.pure.min.js +8 -0
- package/dist/build/fw.pack.crypto-advanced.pure.meta.json +38 -0
- package/dist/build/fw.pack.crypto-advanced.pure.min.js +6 -0
- package/dist/build/fw.pack.crypto-basic.pure.meta.json +29 -0
- package/dist/build/fw.pack.crypto-basic.pure.min.js +6 -0
- package/dist/build/fw.pack.crypto-identity.pure.meta.json +29 -0
- package/dist/build/fw.pack.crypto-identity.pure.min.js +9 -0
- package/dist/build/fw.pack.realtime.pure.meta.json +21 -0
- package/dist/build/fw.pack.realtime.pure.min.js +6 -0
- package/dist/build/fw.pack.sensors.pure.meta.json +21 -0
- package/dist/build/fw.pack.sensors.pure.min.js +6 -0
- package/dist/build/fw.pack.structures-advanced.pure.meta.json +20 -0
- package/dist/build/fw.pack.structures-advanced.pure.min.js +6 -0
- package/dist/build/fw.pack.text-advanced.pure.meta.json +20 -0
- package/dist/build/fw.pack.text-advanced.pure.min.js +6 -0
- package/dist/build/fw.pwa.pure.meta.json +127 -0
- package/dist/build/fw.pwa.pure.min.js +55 -0
- package/dist/build/fw.site-interactive.pure.meta.json +81 -0
- package/dist/build/fw.site-interactive.pure.min.js +52 -0
- package/dist/build/fw.site.pure.meta.json +51 -0
- package/dist/build/fw.site.pure.min.js +35 -0
- package/dist/build/fw.spa.pure.meta.json +108 -0
- package/dist/build/fw.spa.pure.min.js +55 -0
- package/dist/build/io/compress/brotli_dict.bin +432 -0
- package/dist/build/sanity-base-classic.min.js +6 -0
- package/dist/build/sanity-community-classic.min.js +6 -0
- package/dist/build/sanity.min.js +6 -0
- package/dist/types/core/logger.d.ts +71 -0
- package/dist/types/core/logger.d.ts.map +1 -0
- package/dist/types/core/modules.d.ts +3962 -0
- package/dist/types/core/modules.d.ts.map +1 -0
- package/dist/types/core/readyState.d.ts +14 -0
- package/dist/types/core/readyState.d.ts.map +1 -0
- package/dist/types/core/runtime.d.ts +625 -0
- package/dist/types/core/runtime.d.ts.map +1 -0
- package/dist/types/core/worker-helper.d.ts +153 -0
- package/dist/types/core/worker-helper.d.ts.map +1 -0
- package/dist/types/crypto/cipher/aes.d.ts +55 -0
- package/dist/types/crypto/cipher/aes.d.ts.map +1 -0
- package/dist/types/crypto/cipher/chacha20.d.ts +33 -0
- package/dist/types/crypto/cipher/chacha20.d.ts.map +1 -0
- package/dist/types/crypto/hash/adf.d.ts +65 -0
- package/dist/types/crypto/hash/adf.d.ts.map +1 -0
- package/dist/types/crypto/hash/argon2.d.ts +79 -0
- package/dist/types/crypto/hash/argon2.d.ts.map +1 -0
- package/dist/types/crypto/hash/blake2b.d.ts +40 -0
- package/dist/types/crypto/hash/blake2b.d.ts.map +1 -0
- package/dist/types/crypto/hash/hkdf.d.ts +88 -0
- package/dist/types/crypto/hash/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/hash/hmac.d.ts +85 -0
- package/dist/types/crypto/hash/hmac.d.ts.map +1 -0
- package/dist/types/crypto/hash/pbkdf2.d.ts +80 -0
- package/dist/types/crypto/hash/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/hash/poly1305.d.ts +31 -0
- package/dist/types/crypto/hash/poly1305.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha224.d.ts +80 -0
- package/dist/types/crypto/hash/sha224.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha256.d.ts +82 -0
- package/dist/types/crypto/hash/sha256.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha3.d.ts +111 -0
- package/dist/types/crypto/hash/sha3.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha384.d.ts +84 -0
- package/dist/types/crypto/hash/sha384.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512.d.ts +87 -0
- package/dist/types/crypto/hash/sha512.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512_224.d.ts +84 -0
- package/dist/types/crypto/hash/sha512_224.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512_256.d.ts +84 -0
- package/dist/types/crypto/hash/sha512_256.d.ts.map +1 -0
- package/dist/types/crypto/mode/cbc.d.ts +38 -0
- package/dist/types/crypto/mode/cbc.d.ts.map +1 -0
- package/dist/types/crypto/mode/chacha20poly1305.d.ts +71 -0
- package/dist/types/crypto/mode/chacha20poly1305.d.ts.map +1 -0
- package/dist/types/crypto/mode/cmac.d.ts +56 -0
- package/dist/types/crypto/mode/cmac.d.ts.map +1 -0
- package/dist/types/crypto/mode/ctr.d.ts +52 -0
- package/dist/types/crypto/mode/ctr.d.ts.map +1 -0
- package/dist/types/crypto/mode/gcm.d.ts +88 -0
- package/dist/types/crypto/mode/gcm.d.ts.map +1 -0
- package/dist/types/crypto/mode/kw.d.ts +60 -0
- package/dist/types/crypto/mode/kw.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ecc.d.ts +284 -0
- package/dist/types/crypto/pkc/ecc.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ed25519.d.ts +107 -0
- package/dist/types/crypto/pkc/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/pkc/hybridKem.d.ts +154 -0
- package/dist/types/crypto/pkc/hybridKem.d.ts.map +1 -0
- package/dist/types/crypto/pkc/hybridSign.d.ts +383 -0
- package/dist/types/crypto/pkc/hybridSign.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ml_dsa.d.ts +174 -0
- package/dist/types/crypto/pkc/ml_dsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ml_kem.d.ts +194 -0
- package/dist/types/crypto/pkc/ml_kem.d.ts.map +1 -0
- package/dist/types/crypto/pkc/rsa.d.ts +175 -0
- package/dist/types/crypto/pkc/rsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/slh_dsa.d.ts +232 -0
- package/dist/types/crypto/pkc/slh_dsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/x25519.d.ts +37 -0
- package/dist/types/crypto/pkc/x25519.d.ts.map +1 -0
- package/dist/types/crypto/utils/aes_ctr.d.ts +84 -0
- package/dist/types/crypto/utils/aes_ctr.d.ts.map +1 -0
- package/dist/types/crypto/utils/aes_modes.d.ts +128 -0
- package/dist/types/crypto/utils/aes_modes.d.ts.map +1 -0
- package/dist/types/crypto/utils/asn1-oid.d.ts +45 -0
- package/dist/types/crypto/utils/asn1-oid.d.ts.map +1 -0
- package/dist/types/crypto/utils/asn1.d.ts +115 -0
- package/dist/types/crypto/utils/asn1.d.ts.map +1 -0
- package/dist/types/crypto/utils/bitArray.d.ts +75 -0
- package/dist/types/crypto/utils/bitArray.d.ts.map +1 -0
- package/dist/types/crypto/utils/bn.d.ts +214 -0
- package/dist/types/crypto/utils/bn.d.ts.map +1 -0
- package/dist/types/crypto/utils/jws.d.ts +159 -0
- package/dist/types/crypto/utils/jws.d.ts.map +1 -0
- package/dist/types/crypto/utils/keyformat.d.ts +100 -0
- package/dist/types/crypto/utils/keyformat.d.ts.map +1 -0
- package/dist/types/crypto/utils/pad.d.ts +44 -0
- package/dist/types/crypto/utils/pad.d.ts.map +1 -0
- package/dist/types/crypto/utils/pem.d.ts +41 -0
- package/dist/types/crypto/utils/pem.d.ts.map +1 -0
- package/dist/types/crypto/utils/random.d.ts +203 -0
- package/dist/types/crypto/utils/random.d.ts.map +1 -0
- package/dist/types/crypto/utils/rsaKeygen.d.ts +162 -0
- package/dist/types/crypto/utils/rsaKeygen.d.ts.map +1 -0
- package/dist/types/crypto/utils/totp.d.ts +183 -0
- package/dist/types/crypto/utils/totp.d.ts.map +1 -0
- package/dist/types/crypto/utils/uuid.d.ts +29 -0
- package/dist/types/crypto/utils/uuid.d.ts.map +1 -0
- package/dist/types/crypto/wasm/aes.d.ts +59 -0
- package/dist/types/crypto/wasm/aes.d.ts.map +1 -0
- package/dist/types/crypto/wasm/argon2.d.ts +70 -0
- package/dist/types/crypto/wasm/argon2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/blake2b.d.ts +59 -0
- package/dist/types/crypto/wasm/blake2b.d.ts.map +1 -0
- package/dist/types/crypto/wasm/chacha20poly1305.d.ts +43 -0
- package/dist/types/crypto/wasm/chacha20poly1305.d.ts.map +1 -0
- package/dist/types/crypto/wasm/cmac.d.ts +42 -0
- package/dist/types/crypto/wasm/cmac.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ecc.d.ts +56 -0
- package/dist/types/crypto/wasm/ecc.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ed25519.d.ts +52 -0
- package/dist/types/crypto/wasm/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/wasm/hkdf.d.ts +40 -0
- package/dist/types/crypto/wasm/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/wasm/hmac.d.ts +42 -0
- package/dist/types/crypto/wasm/hmac.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ml_dsa.d.ts +48 -0
- package/dist/types/crypto/wasm/ml_dsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ml_kem.d.ts +58 -0
- package/dist/types/crypto/wasm/ml_kem.d.ts.map +1 -0
- package/dist/types/crypto/wasm/pbkdf2.d.ts +38 -0
- package/dist/types/crypto/wasm/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/rsa.d.ts +56 -0
- package/dist/types/crypto/wasm/rsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/runtime.d.ts +99 -0
- package/dist/types/crypto/wasm/runtime.d.ts.map +1 -0
- package/dist/types/crypto/wasm/sha2.d.ts +45 -0
- package/dist/types/crypto/wasm/sha2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/sha3.d.ts +57 -0
- package/dist/types/crypto/wasm/sha3.d.ts.map +1 -0
- package/dist/types/crypto/wasm/slh_dsa.d.ts +62 -0
- package/dist/types/crypto/wasm/slh_dsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/x25519.d.ts +53 -0
- package/dist/types/crypto/wasm/x25519.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/aes.d.ts +59 -0
- package/dist/types/crypto/webcrypto/aes.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/aeskw.d.ts +40 -0
- package/dist/types/crypto/webcrypto/aeskw.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/digest.d.ts +43 -0
- package/dist/types/crypto/webcrypto/digest.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/ecc.d.ts +51 -0
- package/dist/types/crypto/webcrypto/ecc.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/ed25519.d.ts +43 -0
- package/dist/types/crypto/webcrypto/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/hkdf.d.ts +18 -0
- package/dist/types/crypto/webcrypto/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/hmac.d.ts +43 -0
- package/dist/types/crypto/webcrypto/hmac.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/pbkdf2.d.ts +18 -0
- package/dist/types/crypto/webcrypto/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/rsa.d.ts +51 -0
- package/dist/types/crypto/webcrypto/rsa.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/x25519.d.ts +43 -0
- package/dist/types/crypto/webcrypto/x25519.d.ts.map +1 -0
- package/dist/types/dom/display/animate.d.ts +35 -0
- package/dist/types/dom/display/animate.d.ts.map +1 -0
- package/dist/types/dom/display/fullscreen.d.ts +59 -0
- package/dist/types/dom/display/fullscreen.d.ts.map +1 -0
- package/dist/types/dom/fs/download.d.ts +36 -0
- package/dist/types/dom/fs/download.d.ts.map +1 -0
- package/dist/types/dom/fs/fsAccess.d.ts +107 -0
- package/dist/types/dom/fs/fsAccess.d.ts.map +1 -0
- package/dist/types/dom/fs/indexedDB.d.ts +62 -0
- package/dist/types/dom/fs/indexedDB.d.ts.map +1 -0
- package/dist/types/dom/fs/remoteStore.d.ts +64 -0
- package/dist/types/dom/fs/remoteStore.d.ts.map +1 -0
- package/dist/types/dom/fs/storage.d.ts +56 -0
- package/dist/types/dom/fs/storage.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/idle.d.ts +91 -0
- package/dist/types/dom/lifecycle/idle.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/visibility.d.ts +49 -0
- package/dist/types/dom/lifecycle/visibility.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/wakeLock.d.ts +69 -0
- package/dist/types/dom/lifecycle/wakeLock.d.ts.map +1 -0
- package/dist/types/dom/net/ajax.d.ts +27 -0
- package/dist/types/dom/net/ajax.d.ts.map +1 -0
- package/dist/types/dom/net/broadcastChannel.d.ts +51 -0
- package/dist/types/dom/net/broadcastChannel.d.ts.map +1 -0
- package/dist/types/dom/net/network.d.ts +80 -0
- package/dist/types/dom/net/network.d.ts.map +1 -0
- package/dist/types/dom/net/sse.d.ts +72 -0
- package/dist/types/dom/net/sse.d.ts.map +1 -0
- package/dist/types/dom/net/webrtc.d.ts +149 -0
- package/dist/types/dom/net/webrtc.d.ts.map +1 -0
- package/dist/types/dom/net/ws.d.ts +70 -0
- package/dist/types/dom/net/ws.d.ts.map +1 -0
- package/dist/types/dom/query/dnd.d.ts +86 -0
- package/dist/types/dom/query/dnd.d.ts.map +1 -0
- package/dist/types/dom/query/dom.d.ts +194 -0
- package/dist/types/dom/query/dom.d.ts.map +1 -0
- package/dist/types/dom/query/events.d.ts +135 -0
- package/dist/types/dom/query/events.d.ts.map +1 -0
- package/dist/types/dom/query/gesture.d.ts +59 -0
- package/dist/types/dom/query/gesture.d.ts.map +1 -0
- package/dist/types/dom/query/media.d.ts +156 -0
- package/dist/types/dom/query/media.d.ts.map +1 -0
- package/dist/types/dom/rendering/chart.d.ts +143 -0
- package/dist/types/dom/rendering/chart.d.ts.map +1 -0
- package/dist/types/dom/rendering/component.d.ts +92 -0
- package/dist/types/dom/rendering/component.d.ts.map +1 -0
- package/dist/types/dom/rendering/devtools-ui.d.ts +83 -0
- package/dist/types/dom/rendering/devtools-ui.d.ts.map +1 -0
- package/dist/types/dom/rendering/devtools.d.ts +68 -0
- package/dist/types/dom/rendering/devtools.d.ts.map +1 -0
- package/dist/types/dom/rendering/parser.d.ts +216 -0
- package/dist/types/dom/rendering/parser.d.ts.map +1 -0
- package/dist/types/dom/rendering/reactiveBind.d.ts +101 -0
- package/dist/types/dom/rendering/reactiveBind.d.ts.map +1 -0
- package/dist/types/dom/rendering/render.d.ts +121 -0
- package/dist/types/dom/rendering/render.d.ts.map +1 -0
- package/dist/types/dom/rendering/sanitize.d.ts +48 -0
- package/dist/types/dom/rendering/sanitize.d.ts.map +1 -0
- package/dist/types/dom/rendering/secPolicy.d.ts +89 -0
- package/dist/types/dom/rendering/secPolicy.d.ts.map +1 -0
- package/dist/types/dom/rendering/template.d.ts +251 -0
- package/dist/types/dom/rendering/template.d.ts.map +1 -0
- package/dist/types/dom/rendering/themeTokens.d.ts +61 -0
- package/dist/types/dom/rendering/themeTokens.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-core.d.ts +192 -0
- package/dist/types/dom/rendering/uiSession-core.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-direct.d.ts +63 -0
- package/dist/types/dom/rendering/uiSession-direct.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-list.d.ts +205 -0
- package/dist/types/dom/rendering/uiSession-list.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession.d.ts +285 -0
- package/dist/types/dom/rendering/uiSession.d.ts.map +1 -0
- package/dist/types/dom/rendering/virtualScroll.d.ts +80 -0
- package/dist/types/dom/rendering/virtualScroll.d.ts.map +1 -0
- package/dist/types/dom/sensors/battery.d.ts +71 -0
- package/dist/types/dom/sensors/battery.d.ts.map +1 -0
- package/dist/types/dom/sensors/geolocation.d.ts +83 -0
- package/dist/types/dom/sensors/geolocation.d.ts.map +1 -0
- package/dist/types/dom/sensors/networkInfo.d.ts +82 -0
- package/dist/types/dom/sensors/networkInfo.d.ts.map +1 -0
- package/dist/types/dom/sensors/sensors.d.ts +191 -0
- package/dist/types/dom/sensors/sensors.d.ts.map +1 -0
- package/dist/types/dom/sw/backgroundSync.d.ts +48 -0
- package/dist/types/dom/sw/backgroundSync.d.ts.map +1 -0
- package/dist/types/dom/sw/cache.d.ts +71 -0
- package/dist/types/dom/sw/cache.d.ts.map +1 -0
- package/dist/types/dom/sw/push.d.ts +77 -0
- package/dist/types/dom/sw/push.d.ts.map +1 -0
- package/dist/types/dom/sw/serviceWorker.d.ts +57 -0
- package/dist/types/dom/sw/serviceWorker.d.ts.map +1 -0
- package/dist/types/dom/sw/sharedWorker.d.ts +81 -0
- package/dist/types/dom/sw/sharedWorker.d.ts.map +1 -0
- package/dist/types/dom/utils/a11y.d.ts +53 -0
- package/dist/types/dom/utils/a11y.d.ts.map +1 -0
- package/dist/types/dom/utils/clipboard.d.ts +44 -0
- package/dist/types/dom/utils/clipboard.d.ts.map +1 -0
- package/dist/types/dom/utils/entropyCollector.d.ts +58 -0
- package/dist/types/dom/utils/entropyCollector.d.ts.map +1 -0
- package/dist/types/dom/utils/focus.d.ts +123 -0
- package/dist/types/dom/utils/focus.d.ts.map +1 -0
- package/dist/types/dom/utils/form.d.ts +227 -0
- package/dist/types/dom/utils/form.d.ts.map +1 -0
- package/dist/types/dom/utils/formKit.d.ts +206 -0
- package/dist/types/dom/utils/formKit.d.ts.map +1 -0
- package/dist/types/dom/utils/keybindings.d.ts +53 -0
- package/dist/types/dom/utils/keybindings.d.ts.map +1 -0
- package/dist/types/dom/utils/leaderElection.d.ts +70 -0
- package/dist/types/dom/utils/leaderElection.d.ts.map +1 -0
- package/dist/types/dom/utils/notifications.d.ts +164 -0
- package/dist/types/dom/utils/notifications.d.ts.map +1 -0
- package/dist/types/dom/utils/permissions.d.ts +35 -0
- package/dist/types/dom/utils/permissions.d.ts.map +1 -0
- package/dist/types/dom/utils/route.d.ts +117 -0
- package/dist/types/dom/utils/route.d.ts.map +1 -0
- package/dist/types/dom/utils/ua.d.ts +35 -0
- package/dist/types/dom/utils/ua.d.ts.map +1 -0
- package/dist/types/dom/utils/webauthn.d.ts +98 -0
- package/dist/types/dom/utils/webauthn.d.ts.map +1 -0
- package/dist/types/io/binary/reader.d.ts +59 -0
- package/dist/types/io/binary/reader.d.ts.map +1 -0
- package/dist/types/io/binary/writer.d.ts +56 -0
- package/dist/types/io/binary/writer.d.ts.map +1 -0
- package/dist/types/io/calc/adler32.d.ts +31 -0
- package/dist/types/io/calc/adler32.d.ts.map +1 -0
- package/dist/types/io/calc/bigint.d.ts +74 -0
- package/dist/types/io/calc/bigint.d.ts.map +1 -0
- package/dist/types/io/calc/crc32.d.ts +36 -0
- package/dist/types/io/calc/crc32.d.ts.map +1 -0
- package/dist/types/io/calc/easing.d.ts +60 -0
- package/dist/types/io/calc/easing.d.ts.map +1 -0
- package/dist/types/io/codec/b64.d.ts +28 -0
- package/dist/types/io/codec/b64.d.ts.map +1 -0
- package/dist/types/io/codec/base32.d.ts +28 -0
- package/dist/types/io/codec/base32.d.ts.map +1 -0
- package/dist/types/io/codec/base58.d.ts +28 -0
- package/dist/types/io/codec/base58.d.ts.map +1 -0
- package/dist/types/io/codec/buffer.d.ts +66 -0
- package/dist/types/io/codec/buffer.d.ts.map +1 -0
- package/dist/types/io/codec/cbor.d.ts +43 -0
- package/dist/types/io/codec/cbor.d.ts.map +1 -0
- package/dist/types/io/codec/csv.d.ts +35 -0
- package/dist/types/io/codec/csv.d.ts.map +1 -0
- package/dist/types/io/codec/hex.d.ts +28 -0
- package/dist/types/io/codec/hex.d.ts.map +1 -0
- package/dist/types/io/codec/mime.d.ts +100 -0
- package/dist/types/io/codec/mime.d.ts.map +1 -0
- package/dist/types/io/codec/msgpack.d.ts +36 -0
- package/dist/types/io/codec/msgpack.d.ts.map +1 -0
- package/dist/types/io/codec/url.d.ts +52 -0
- package/dist/types/io/codec/url.d.ts.map +1 -0
- package/dist/types/io/codec/utf8.d.ts +22 -0
- package/dist/types/io/codec/utf8.d.ts.map +1 -0
- package/dist/types/io/codec/xml.d.ts +91 -0
- package/dist/types/io/codec/xml.d.ts.map +1 -0
- package/dist/types/io/compress/bitstream.d.ts +51 -0
- package/dist/types/io/compress/bitstream.d.ts.map +1 -0
- package/dist/types/io/compress/brotli.d.ts +86 -0
- package/dist/types/io/compress/brotli.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_dict.d.ts +76 -0
- package/dist/types/io/compress/brotli_dict.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_dict_words.d.ts +43 -0
- package/dist/types/io/compress/brotli_dict_words.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_frame.d.ts +166 -0
- package/dist/types/io/compress/brotli_frame.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_shared.d.ts +165 -0
- package/dist/types/io/compress/brotli_shared.d.ts.map +1 -0
- package/dist/types/io/compress/deflate.d.ts +89 -0
- package/dist/types/io/compress/deflate.d.ts.map +1 -0
- package/dist/types/io/compress/gzip.d.ts +100 -0
- package/dist/types/io/compress/gzip.d.ts.map +1 -0
- package/dist/types/io/compress/huffman.d.ts +37 -0
- package/dist/types/io/compress/huffman.d.ts.map +1 -0
- package/dist/types/io/compress/lz4.d.ts +45 -0
- package/dist/types/io/compress/lz4.d.ts.map +1 -0
- package/dist/types/io/compress/lz77.d.ts +66 -0
- package/dist/types/io/compress/lz77.d.ts.map +1 -0
- package/dist/types/io/compress/lzw.d.ts +37 -0
- package/dist/types/io/compress/lzw.d.ts.map +1 -0
- package/dist/types/io/compress/zip.d.ts +112 -0
- package/dist/types/io/compress/zip.d.ts.map +1 -0
- package/dist/types/io/compress/zlib.d.ts +97 -0
- package/dist/types/io/compress/zlib.d.ts.map +1 -0
- package/dist/types/io/i18n/i18n.d.ts +64 -0
- package/dist/types/io/i18n/i18n.d.ts.map +1 -0
- package/dist/types/io/math/fixed-point.d.ts +30 -0
- package/dist/types/io/math/fixed-point.d.ts.map +1 -0
- package/dist/types/io/math/geom.d.ts +125 -0
- package/dist/types/io/math/geom.d.ts.map +1 -0
- package/dist/types/io/math/interp.d.ts +48 -0
- package/dist/types/io/math/interp.d.ts.map +1 -0
- package/dist/types/io/math/linalg.d.ts +117 -0
- package/dist/types/io/math/linalg.d.ts.map +1 -0
- package/dist/types/io/math/stats.d.ts +45 -0
- package/dist/types/io/math/stats.d.ts.map +1 -0
- package/dist/types/io/structures/btree.d.ts +84 -0
- package/dist/types/io/structures/btree.d.ts.map +1 -0
- package/dist/types/io/structures/heap.d.ts +75 -0
- package/dist/types/io/structures/heap.d.ts.map +1 -0
- package/dist/types/io/structures/lruCache.d.ts +88 -0
- package/dist/types/io/structures/lruCache.d.ts.map +1 -0
- package/dist/types/io/structures/ringBuffer.d.ts +82 -0
- package/dist/types/io/structures/ringBuffer.d.ts.map +1 -0
- package/dist/types/io/structures/tree-walker.d.ts +95 -0
- package/dist/types/io/structures/tree-walker.d.ts.map +1 -0
- package/dist/types/io/structures/trie.d.ts +71 -0
- package/dist/types/io/structures/trie.d.ts.map +1 -0
- package/dist/types/io/sync/abort.d.ts +59 -0
- package/dist/types/io/sync/abort.d.ts.map +1 -0
- package/dist/types/io/sync/atomics.d.ts +107 -0
- package/dist/types/io/sync/atomics.d.ts.map +1 -0
- package/dist/types/io/sync/cancellable.d.ts +69 -0
- package/dist/types/io/sync/cancellable.d.ts.map +1 -0
- package/dist/types/io/sync/channel.d.ts +70 -0
- package/dist/types/io/sync/channel.d.ts.map +1 -0
- package/dist/types/io/sync/mutex.d.ts +39 -0
- package/dist/types/io/sync/mutex.d.ts.map +1 -0
- package/dist/types/io/sync/semaphore.d.ts +40 -0
- package/dist/types/io/sync/semaphore.d.ts.map +1 -0
- package/dist/types/io/sync/tokenBucket.d.ts +53 -0
- package/dist/types/io/sync/tokenBucket.d.ts.map +1 -0
- package/dist/types/io/text/ansi.d.ts +125 -0
- package/dist/types/io/text/ansi.d.ts.map +1 -0
- package/dist/types/io/text/html-entities.d.ts +35 -0
- package/dist/types/io/text/html-entities.d.ts.map +1 -0
- package/dist/types/io/text/semver.d.ts +75 -0
- package/dist/types/io/text/semver.d.ts.map +1 -0
- package/dist/types/io/text/str.d.ts +88 -0
- package/dist/types/io/text/str.d.ts.map +1 -0
- package/dist/types/io/text/unicode.d.ts +70 -0
- package/dist/types/io/text/unicode.d.ts.map +1 -0
- package/dist/types/io/time/date.d.ts +73 -0
- package/dist/types/io/time/date.d.ts.map +1 -0
- package/dist/types/io/timing/clock.d.ts +39 -0
- package/dist/types/io/timing/clock.d.ts.map +1 -0
- package/dist/types/io/timing/rateLimit.d.ts +40 -0
- package/dist/types/io/timing/rateLimit.d.ts.map +1 -0
- package/dist/types/io/timing/scheduler.d.ts +122 -0
- package/dist/types/io/timing/scheduler.d.ts.map +1 -0
- package/dist/types/io/utils/bitmap.d.ts +34 -0
- package/dist/types/io/utils/bitmap.d.ts.map +1 -0
- package/dist/types/io/utils/errors.d.ts +94 -0
- package/dist/types/io/utils/errors.d.ts.map +1 -0
- package/dist/types/io/utils/eventBus.d.ts +68 -0
- package/dist/types/io/utils/eventBus.d.ts.map +1 -0
- package/dist/types/io/utils/queue.d.ts +69 -0
- package/dist/types/io/utils/queue.d.ts.map +1 -0
- package/dist/types/io/utils/signal.d.ts +362 -0
- package/dist/types/io/utils/signal.d.ts.map +1 -0
- package/dist/types/io/utils/ui8.d.ts +34 -0
- package/dist/types/io/utils/ui8.d.ts.map +1 -0
- package/dist/types/io/utils/valid.d.ts +130 -0
- package/dist/types/io/utils/valid.d.ts.map +1 -0
- package/dist/types/main.d.ts +25 -0
- package/dist/types/main.d.ts.map +1 -0
- package/dist/types/process/message.d.ts +64 -0
- package/dist/types/process/message.d.ts.map +1 -0
- package/dist/types/process/rpc.d.ts +35 -0
- package/dist/types/process/rpc.d.ts.map +1 -0
- package/dist/types/process/workerPool.d.ts +62 -0
- package/dist/types/process/workerPool.d.ts.map +1 -0
- package/dist/types/sanity/base.d.ts +28 -0
- package/dist/types/sanity/base.d.ts.map +1 -0
- package/dist/types/sanity/community.d.ts +20 -0
- package/dist/types/sanity/community.d.ts.map +1 -0
- package/dist/types/sanity/lockdown-apply.d.ts +7 -0
- package/dist/types/sanity/lockdown-apply.d.ts.map +1 -0
- package/dist/types/sanity/lockdown.d.ts +43 -0
- package/dist/types/sanity/lockdown.d.ts.map +1 -0
- package/dist/types/sanity/wasm-gate.d.ts +128 -0
- package/dist/types/sanity/wasm-gate.d.ts.map +1 -0
- package/docs/README.md +301 -0
- package/docs/api/README.md +33 -0
- package/docs/api/core/README.md +14 -0
- package/docs/api/core/logger.md +151 -0
- package/docs/api/core/main.md +105 -0
- package/docs/api/core/modules.md +123 -0
- package/docs/api/core/readyState.md +94 -0
- package/docs/api/core/runtime.md +499 -0
- package/docs/api/core/worker-helper.md +180 -0
- package/docs/api/crypto/README.md +39 -0
- package/docs/api/crypto/cipher/README.md +24 -0
- package/docs/api/crypto/cipher/aes.md +101 -0
- package/docs/api/crypto/cipher/chacha20.md +85 -0
- package/docs/api/crypto/hash/README.md +49 -0
- package/docs/api/crypto/hash/adf.md +61 -0
- package/docs/api/crypto/hash/argon2.md +92 -0
- package/docs/api/crypto/hash/blake2b.md +88 -0
- package/docs/api/crypto/hash/hkdf.md +82 -0
- package/docs/api/crypto/hash/hmac.md +90 -0
- package/docs/api/crypto/hash/pbkdf2.md +93 -0
- package/docs/api/crypto/hash/poly1305.md +71 -0
- package/docs/api/crypto/hash/sha224.md +61 -0
- package/docs/api/crypto/hash/sha256.md +84 -0
- package/docs/api/crypto/hash/sha3.md +89 -0
- package/docs/api/crypto/hash/sha384.md +58 -0
- package/docs/api/crypto/hash/sha512.md +73 -0
- package/docs/api/crypto/hash/sha512_224.md +59 -0
- package/docs/api/crypto/hash/sha512_256.md +58 -0
- package/docs/api/crypto/mode/README.md +33 -0
- package/docs/api/crypto/mode/cbc.md +69 -0
- package/docs/api/crypto/mode/chacha20poly1305.md +77 -0
- package/docs/api/crypto/mode/cmac.md +79 -0
- package/docs/api/crypto/mode/ctr.md +66 -0
- package/docs/api/crypto/mode/gcm.md +93 -0
- package/docs/api/crypto/mode/kw.md +84 -0
- package/docs/api/crypto/pkc/README.md +48 -0
- package/docs/api/crypto/pkc/ecc.md +91 -0
- package/docs/api/crypto/pkc/ed25519.md +99 -0
- package/docs/api/crypto/pkc/hybridKem.md +178 -0
- package/docs/api/crypto/pkc/hybridSign.md +192 -0
- package/docs/api/crypto/pkc/ml_dsa.md +99 -0
- package/docs/api/crypto/pkc/ml_kem.md +90 -0
- package/docs/api/crypto/pkc/rsa.md +87 -0
- package/docs/api/crypto/pkc/slh_dsa.md +86 -0
- package/docs/api/crypto/pkc/x25519.md +84 -0
- package/docs/api/crypto/utils/README.md +39 -0
- package/docs/api/crypto/utils/aes_ctr.md +71 -0
- package/docs/api/crypto/utils/aes_modes.md +81 -0
- package/docs/api/crypto/utils/asn1-oid.md +130 -0
- package/docs/api/crypto/utils/asn1.md +69 -0
- package/docs/api/crypto/utils/bitArray.md +77 -0
- package/docs/api/crypto/utils/bn.md +67 -0
- package/docs/api/crypto/utils/jws.md +94 -0
- package/docs/api/crypto/utils/keyformat.md +78 -0
- package/docs/api/crypto/utils/pad.md +66 -0
- package/docs/api/crypto/utils/pem.md +63 -0
- package/docs/api/crypto/utils/random.md +103 -0
- package/docs/api/crypto/utils/rsaKeygen.md +118 -0
- package/docs/api/crypto/utils/totp.md +159 -0
- package/docs/api/crypto/utils/uuid.md +98 -0
- package/docs/api/crypto/wasm/README.md +76 -0
- package/docs/api/crypto/wasm/aes.md +128 -0
- package/docs/api/crypto/wasm/argon2.md +110 -0
- package/docs/api/crypto/wasm/blake2b.md +103 -0
- package/docs/api/crypto/wasm/chacha20poly1305.md +120 -0
- package/docs/api/crypto/wasm/cmac.md +119 -0
- package/docs/api/crypto/wasm/ecc.md +114 -0
- package/docs/api/crypto/wasm/ed25519.md +117 -0
- package/docs/api/crypto/wasm/hkdf.md +163 -0
- package/docs/api/crypto/wasm/hmac.md +129 -0
- package/docs/api/crypto/wasm/ml_dsa.md +99 -0
- package/docs/api/crypto/wasm/ml_kem.md +91 -0
- package/docs/api/crypto/wasm/pbkdf2.md +111 -0
- package/docs/api/crypto/wasm/rsa.md +113 -0
- package/docs/api/crypto/wasm/runtime.md +172 -0
- package/docs/api/crypto/wasm/sha2.md +95 -0
- package/docs/api/crypto/wasm/sha3.md +127 -0
- package/docs/api/crypto/wasm/slh_dsa.md +89 -0
- package/docs/api/crypto/wasm/x25519.md +116 -0
- package/docs/api/crypto/webcrypto/README.md +56 -0
- package/docs/api/crypto/webcrypto/aes.md +140 -0
- package/docs/api/crypto/webcrypto/aeskw.md +120 -0
- package/docs/api/crypto/webcrypto/digest.md +103 -0
- package/docs/api/crypto/webcrypto/ecc.md +122 -0
- package/docs/api/crypto/webcrypto/ed25519.md +121 -0
- package/docs/api/crypto/webcrypto/hkdf.md +141 -0
- package/docs/api/crypto/webcrypto/hmac.md +112 -0
- package/docs/api/crypto/webcrypto/pbkdf2.md +140 -0
- package/docs/api/crypto/webcrypto/rsa.md +149 -0
- package/docs/api/crypto/webcrypto/x25519.md +96 -0
- package/docs/api/dom/README.md +117 -0
- package/docs/api/dom/display/README.md +27 -0
- package/docs/api/dom/display/animate.md +113 -0
- package/docs/api/dom/display/fullscreen.md +121 -0
- package/docs/api/dom/fs/README.md +36 -0
- package/docs/api/dom/fs/download.md +108 -0
- package/docs/api/dom/fs/fsAccess.md +200 -0
- package/docs/api/dom/fs/indexedDB.md +219 -0
- package/docs/api/dom/fs/remoteStore.md +158 -0
- package/docs/api/dom/fs/storage.md +197 -0
- package/docs/api/dom/lifecycle/README.md +11 -0
- package/docs/api/dom/lifecycle/idle.md +89 -0
- package/docs/api/dom/lifecycle/visibility.md +73 -0
- package/docs/api/dom/lifecycle/wakeLock.md +94 -0
- package/docs/api/dom/net/README.md +31 -0
- package/docs/api/dom/net/ajax.md +176 -0
- package/docs/api/dom/net/broadcastChannel.md +110 -0
- package/docs/api/dom/net/network.md +137 -0
- package/docs/api/dom/net/sse.md +141 -0
- package/docs/api/dom/net/webrtc.md +158 -0
- package/docs/api/dom/net/ws.md +168 -0
- package/docs/api/dom/query/README.md +30 -0
- package/docs/api/dom/query/dnd.md +137 -0
- package/docs/api/dom/query/dom.md +275 -0
- package/docs/api/dom/query/events.md +211 -0
- package/docs/api/dom/query/gesture.md +137 -0
- package/docs/api/dom/query/media.md +188 -0
- package/docs/api/dom/rendering/README.md +41 -0
- package/docs/api/dom/rendering/chart.md +149 -0
- package/docs/api/dom/rendering/component.md +287 -0
- package/docs/api/dom/rendering/devtools-ui.md +129 -0
- package/docs/api/dom/rendering/devtools.md +157 -0
- package/docs/api/dom/rendering/parser.md +200 -0
- package/docs/api/dom/rendering/reactiveBind.md +234 -0
- package/docs/api/dom/rendering/render.md +219 -0
- package/docs/api/dom/rendering/sanitize.md +97 -0
- package/docs/api/dom/rendering/secPolicy.md +155 -0
- package/docs/api/dom/rendering/template.md +301 -0
- package/docs/api/dom/rendering/themeTokens.md +175 -0
- package/docs/api/dom/rendering/uiSession.md +546 -0
- package/docs/api/dom/rendering/virtualScroll.md +126 -0
- package/docs/api/dom/sensors/README.md +12 -0
- package/docs/api/dom/sensors/battery.md +70 -0
- package/docs/api/dom/sensors/geolocation.md +115 -0
- package/docs/api/dom/sensors/networkInfo.md +73 -0
- package/docs/api/dom/sensors/sensors.md +123 -0
- package/docs/api/dom/sw/README.md +31 -0
- package/docs/api/dom/sw/backgroundSync.md +145 -0
- package/docs/api/dom/sw/cache.md +116 -0
- package/docs/api/dom/sw/push.md +114 -0
- package/docs/api/dom/sw/serviceWorker.md +90 -0
- package/docs/api/dom/sw/sharedWorker.md +131 -0
- package/docs/api/dom/utils/README.md +25 -0
- package/docs/api/dom/utils/a11y.md +143 -0
- package/docs/api/dom/utils/clipboard.md +146 -0
- package/docs/api/dom/utils/entropyCollector.md +175 -0
- package/docs/api/dom/utils/focus.md +140 -0
- package/docs/api/dom/utils/form.md +196 -0
- package/docs/api/dom/utils/formKit.md +181 -0
- package/docs/api/dom/utils/keybindings.md +138 -0
- package/docs/api/dom/utils/leaderElection.md +130 -0
- package/docs/api/dom/utils/notifications.md +106 -0
- package/docs/api/dom/utils/permissions.md +82 -0
- package/docs/api/dom/utils/route.md +112 -0
- package/docs/api/dom/utils/ua.md +119 -0
- package/docs/api/dom/utils/webauthn.md +190 -0
- package/docs/api/io/README.md +20 -0
- package/docs/api/io/binary/README.md +29 -0
- package/docs/api/io/binary/reader.md +126 -0
- package/docs/api/io/binary/writer.md +127 -0
- package/docs/api/io/calc/README.md +22 -0
- package/docs/api/io/calc/adler32.md +75 -0
- package/docs/api/io/calc/bigint.md +105 -0
- package/docs/api/io/calc/crc32.md +74 -0
- package/docs/api/io/calc/easing.md +118 -0
- package/docs/api/io/codec/README.md +35 -0
- package/docs/api/io/codec/b64.md +92 -0
- package/docs/api/io/codec/base32.md +98 -0
- package/docs/api/io/codec/base58.md +104 -0
- package/docs/api/io/codec/buffer.md +144 -0
- package/docs/api/io/codec/cbor.md +179 -0
- package/docs/api/io/codec/csv.md +178 -0
- package/docs/api/io/codec/hex.md +75 -0
- package/docs/api/io/codec/mime.md +156 -0
- package/docs/api/io/codec/msgpack.md +142 -0
- package/docs/api/io/codec/url.md +265 -0
- package/docs/api/io/codec/utf8.md +84 -0
- package/docs/api/io/codec/xml.md +87 -0
- package/docs/api/io/compress/README.md +62 -0
- package/docs/api/io/compress/bitstream.md +131 -0
- package/docs/api/io/compress/brotli.md +232 -0
- package/docs/api/io/compress/brotli_dict.md +119 -0
- package/docs/api/io/compress/brotli_dict_words.md +142 -0
- package/docs/api/io/compress/brotli_frame.md +214 -0
- package/docs/api/io/compress/brotli_shared.md +144 -0
- package/docs/api/io/compress/deflate.md +474 -0
- package/docs/api/io/compress/gzip.md +130 -0
- package/docs/api/io/compress/huffman.md +210 -0
- package/docs/api/io/compress/lz4.md +278 -0
- package/docs/api/io/compress/lz77.md +180 -0
- package/docs/api/io/compress/lzw.md +121 -0
- package/docs/api/io/compress/zip.md +209 -0
- package/docs/api/io/compress/zlib.md +125 -0
- package/docs/api/io/i18n/README.md +23 -0
- package/docs/api/io/i18n/i18n.md +128 -0
- package/docs/api/io/math/README.md +24 -0
- package/docs/api/io/math/fixed-point.md +115 -0
- package/docs/api/io/math/geom.md +144 -0
- package/docs/api/io/math/interp.md +115 -0
- package/docs/api/io/math/linalg.md +138 -0
- package/docs/api/io/math/stats.md +109 -0
- package/docs/api/io/structures/README.md +31 -0
- package/docs/api/io/structures/btree.md +155 -0
- package/docs/api/io/structures/heap.md +166 -0
- package/docs/api/io/structures/lruCache.md +156 -0
- package/docs/api/io/structures/ringBuffer.md +188 -0
- package/docs/api/io/structures/tree-walker.md +132 -0
- package/docs/api/io/structures/trie.md +138 -0
- package/docs/api/io/sync/README.md +29 -0
- package/docs/api/io/sync/abort.md +129 -0
- package/docs/api/io/sync/atomics.md +159 -0
- package/docs/api/io/sync/cancellable.md +176 -0
- package/docs/api/io/sync/channel.md +125 -0
- package/docs/api/io/sync/mutex.md +93 -0
- package/docs/api/io/sync/semaphore.md +106 -0
- package/docs/api/io/sync/tokenBucket.md +139 -0
- package/docs/api/io/text/README.md +23 -0
- package/docs/api/io/text/ansi.md +182 -0
- package/docs/api/io/text/html-entities.md +79 -0
- package/docs/api/io/text/semver.md +158 -0
- package/docs/api/io/text/str.md +129 -0
- package/docs/api/io/text/unicode.md +89 -0
- package/docs/api/io/time/README.md +22 -0
- package/docs/api/io/time/date.md +128 -0
- package/docs/api/io/timing/README.md +32 -0
- package/docs/api/io/timing/clock.md +102 -0
- package/docs/api/io/timing/rateLimit.md +137 -0
- package/docs/api/io/timing/scheduler.md +163 -0
- package/docs/api/io/utils/README.md +30 -0
- package/docs/api/io/utils/bitmap.md +96 -0
- package/docs/api/io/utils/errors.md +165 -0
- package/docs/api/io/utils/eventBus.md +162 -0
- package/docs/api/io/utils/queue.md +141 -0
- package/docs/api/io/utils/signal.md +388 -0
- package/docs/api/io/utils/ui8.md +111 -0
- package/docs/api/io/utils/valid.md +272 -0
- package/docs/api/process/README.md +18 -0
- package/docs/api/process/message.md +166 -0
- package/docs/api/process/rpc.md +161 -0
- package/docs/api/process/workerPool.md +130 -0
- package/docs/api/sanity/base.md +132 -0
- package/docs/api/sanity/community.md +96 -0
- package/docs/api/sanity/lockdown.md +128 -0
- package/docs/api/typed.md +85 -0
- package/docs/dev/README.md +25 -0
- package/docs/dev/provenance.md +80 -0
- package/docs/dev/publishing.md +31 -0
- package/docs/dev/runtime.md +64 -0
- package/docs/dev/testing.md +61 -0
- package/docs/dev/types.md +35 -0
- package/docs/evidence/pqc-hybrid-evidence.md +438 -0
- package/docs/guide/README.md +38 -0
- package/docs/guide/_QUICK_REF.md +341 -0
- package/docs/guide/by-use-case.md +160 -0
- package/docs/guide/doc-format.md +306 -0
- package/docs/guide/gesture-dnd-side-channel.md +119 -0
- package/docs/guide/getting-started.md +134 -0
- package/docs/guide/hmr.md +187 -0
- package/docs/guide/integration-bundlers.md +193 -0
- package/docs/guide/integrations-hmr.md +103 -0
- package/docs/guide/module-creation-workflow.md +342 -0
- package/docs/guide/module-pattern.md +244 -0
- package/docs/guide/rendering-pipeline.md +422 -0
- package/docs/guide/security.md +346 -0
- package/docs/guide/test-format.md +190 -0
- package/docs/guide/tutorial-todo.md +298 -0
- package/docs/guide/typescript.md +215 -0
- package/docs/guide/worker-confinement.md +301 -0
- package/docs/guide/workers.md +168 -0
- package/docs/notes/lz77-deflate-factorization.md +96 -0
- package/docs/notes/worker-confinement-spike.md +302 -0
- package/docs/tools/README.md +56 -0
- package/docs/tools/aot.md +108 -0
- package/docs/tools/audit.md +61 -0
- package/docs/tools/bundler.md +215 -0
- package/docs/tools/codegen.md +64 -0
- package/docs/tools/jsx.md +236 -0
- package/docs/tools/precompilation.md +88 -0
- package/docs/tools/standalone.md +107 -0
- package/fw.config.json +129 -0
- package/integrations/README.md +52 -0
- package/integrations/_shared/catalog.generated.json +207 -0
- package/integrations/_shared/config-resolve.js +201 -0
- package/integrations/_shared/core.js +362 -0
- package/integrations/astro/README.md +96 -0
- package/integrations/astro/index.d.ts +42 -0
- package/integrations/astro/index.js +94 -0
- package/integrations/bun/README.md +62 -0
- package/integrations/bun/index.d.ts +30 -0
- package/integrations/bun/index.js +134 -0
- package/integrations/deno/README.md +55 -0
- package/integrations/deno/deno.json +10 -0
- package/integrations/esbuild/README.md +75 -0
- package/integrations/esbuild/backend.js +147 -0
- package/integrations/esbuild/index.d.ts +32 -0
- package/integrations/esbuild/index.js +147 -0
- package/integrations/eslint/README.md +27 -0
- package/integrations/eslint/no-factory-capture.js +99 -0
- package/integrations/jest/README.md +45 -0
- package/integrations/jest/bun-test-shim.js +43 -0
- package/integrations/nestjs/README.md +68 -0
- package/integrations/nestjs/index.d.ts +38 -0
- package/integrations/nestjs/index.js +99 -0
- package/integrations/nextjs/README.md +149 -0
- package/integrations/nextjs/index.d.ts +30 -0
- package/integrations/nextjs/index.js +98 -0
- package/integrations/nodejs/README.md +46 -0
- package/integrations/nodejs/package.node.example.json +31 -0
- package/integrations/rollup/README.md +65 -0
- package/integrations/rollup/backend.js +132 -0
- package/integrations/rollup/index.d.ts +32 -0
- package/integrations/rollup/index.js +84 -0
- package/integrations/turbopack/README.md +56 -0
- package/integrations/turbopack/index.d.ts +47 -0
- package/integrations/turbopack/index.js +164 -0
- package/integrations/typedoc/README.md +57 -0
- package/integrations/typedoc/categorize.js +121 -0
- package/integrations/typedoc/tsconfig.typedoc.json +14 -0
- package/integrations/typedoc/typedoc.json +19 -0
- package/integrations/vite/README.md +115 -0
- package/integrations/vite/index.d.ts +29 -0
- package/integrations/vite/index.js +182 -0
- package/integrations/vite/package.json +8 -0
- package/integrations/vite/vite-env.d.ts +36 -0
- package/integrations/vitest/README.md +77 -0
- package/integrations/vitest/bun-test-shim.js +92 -0
- package/integrations/vitest/vitest.config.js +41 -0
- package/integrations/webpack/README.md +53 -0
- package/integrations/webpack/index.d.ts +29 -0
- package/integrations/webpack/index.js +182 -0
- package/package.json +303 -0
- package/src/core/logger.js +373 -0
- package/src/core/modules.js +289 -0
- package/src/core/readyState.js +119 -0
- package/src/core/runtime.js +929 -0
- package/src/core/worker-helper.js +261 -0
- package/src/crypto/NIST_CONFORMANCE.md +249 -0
- package/src/crypto/cipher/aes.acvp.md +74 -0
- package/src/crypto/cipher/aes.js +512 -0
- package/src/crypto/cipher/chacha20.acvp.md +117 -0
- package/src/crypto/cipher/chacha20.js +147 -0
- package/src/crypto/hash/adf.acvp.md +144 -0
- package/src/crypto/hash/adf.js +127 -0
- package/src/crypto/hash/argon2.acvp.md +144 -0
- package/src/crypto/hash/argon2.js +517 -0
- package/src/crypto/hash/blake2b.acvp.md +122 -0
- package/src/crypto/hash/blake2b.js +367 -0
- package/src/crypto/hash/hkdf.acvp.md +128 -0
- package/src/crypto/hash/hkdf.js +145 -0
- package/src/crypto/hash/hmac.acvp.md +110 -0
- package/src/crypto/hash/hmac.js +177 -0
- package/src/crypto/hash/pbkdf2.acvp.md +122 -0
- package/src/crypto/hash/pbkdf2.js +120 -0
- package/src/crypto/hash/poly1305.acvp.md +111 -0
- package/src/crypto/hash/poly1305.js +126 -0
- package/src/crypto/hash/sha224.acvp.md +81 -0
- package/src/crypto/hash/sha224.js +60 -0
- package/src/crypto/hash/sha256.acvp.md +75 -0
- package/src/crypto/hash/sha256.js +217 -0
- package/src/crypto/hash/sha3.acvp.md +133 -0
- package/src/crypto/hash/sha3.js +391 -0
- package/src/crypto/hash/sha384.acvp.md +82 -0
- package/src/crypto/hash/sha384.js +61 -0
- package/src/crypto/hash/sha512.acvp.md +84 -0
- package/src/crypto/hash/sha512.js +314 -0
- package/src/crypto/hash/sha512_224.acvp.md +90 -0
- package/src/crypto/hash/sha512_224.js +66 -0
- package/src/crypto/hash/sha512_256.acvp.md +96 -0
- package/src/crypto/hash/sha512_256.js +75 -0
- package/src/crypto/mode/cbc.acvp.md +105 -0
- package/src/crypto/mode/cbc.js +136 -0
- package/src/crypto/mode/chacha20poly1305.acvp.md +116 -0
- package/src/crypto/mode/chacha20poly1305.js +190 -0
- package/src/crypto/mode/cmac.acvp.md +106 -0
- package/src/crypto/mode/cmac.js +172 -0
- package/src/crypto/mode/ctr.acvp.md +110 -0
- package/src/crypto/mode/ctr.js +174 -0
- package/src/crypto/mode/gcm.acvp.md +129 -0
- package/src/crypto/mode/gcm.js +333 -0
- package/src/crypto/mode/kw.acvp.md +145 -0
- package/src/crypto/mode/kw.js +323 -0
- package/src/crypto/pkc/ecc.acvp.md +181 -0
- package/src/crypto/pkc/ecc.js +941 -0
- package/src/crypto/pkc/ed25519.acvp.md +172 -0
- package/src/crypto/pkc/ed25519.js +582 -0
- package/src/crypto/pkc/hybrid-kat.provenance.md +89 -0
- package/src/crypto/pkc/hybridKem.js +255 -0
- package/src/crypto/pkc/hybridSign.js +437 -0
- package/src/crypto/pkc/ml_dsa.acvp.md +146 -0
- package/src/crypto/pkc/ml_dsa.js +984 -0
- package/src/crypto/pkc/ml_kem.acvp.md +117 -0
- package/src/crypto/pkc/ml_kem.js +596 -0
- package/src/crypto/pkc/rsa.acvp.md +187 -0
- package/src/crypto/pkc/rsa.js +470 -0
- package/src/crypto/pkc/slh_dsa.acvp.md +155 -0
- package/src/crypto/pkc/slh_dsa.js +820 -0
- package/src/crypto/pkc/x25519.acvp.md +113 -0
- package/src/crypto/pkc/x25519.js +290 -0
- package/src/crypto/utils/aes_ctr.acvp.md +67 -0
- package/src/crypto/utils/aes_ctr.js +134 -0
- package/src/crypto/utils/aes_modes.acvp.md +66 -0
- package/src/crypto/utils/aes_modes.js +241 -0
- package/src/crypto/utils/asn1-oid.js +369 -0
- package/src/crypto/utils/asn1.js +343 -0
- package/src/crypto/utils/bitArray.js +312 -0
- package/src/crypto/utils/bn.js +825 -0
- package/src/crypto/utils/jws.js +222 -0
- package/src/crypto/utils/keyformat.js +303 -0
- package/src/crypto/utils/pad.js +198 -0
- package/src/crypto/utils/pem.js +90 -0
- package/src/crypto/utils/random.acvp.md +167 -0
- package/src/crypto/utils/random.js +846 -0
- package/src/crypto/utils/rsaKeygen.acvp.md +158 -0
- package/src/crypto/utils/rsaKeygen.js +448 -0
- package/src/crypto/utils/totp.js +409 -0
- package/src/crypto/utils/uuid.acvp.md +137 -0
- package/src/crypto/utils/uuid.js +176 -0
- package/src/crypto/wasm/aes.js +494 -0
- package/src/crypto/wasm/argon2.js +236 -0
- package/src/crypto/wasm/blake2b.js +213 -0
- package/src/crypto/wasm/chacha20poly1305.js +238 -0
- package/src/crypto/wasm/cmac.js +207 -0
- package/src/crypto/wasm/ecc.js +437 -0
- package/src/crypto/wasm/ed25519.js +307 -0
- package/src/crypto/wasm/hkdf.js +183 -0
- package/src/crypto/wasm/hmac.js +215 -0
- package/src/crypto/wasm/ml_dsa.js +375 -0
- package/src/crypto/wasm/ml_kem.js +313 -0
- package/src/crypto/wasm/pbkdf2.js +205 -0
- package/src/crypto/wasm/rsa.js +674 -0
- package/src/crypto/wasm/runtime.js +400 -0
- package/src/crypto/wasm/sha2.js +183 -0
- package/src/crypto/wasm/sha3.js +221 -0
- package/src/crypto/wasm/slh_dsa.js +397 -0
- package/src/crypto/wasm/x25519.js +241 -0
- package/src/crypto/webcrypto/aes.js +370 -0
- package/src/crypto/webcrypto/aeskw.js +185 -0
- package/src/crypto/webcrypto/digest.js +136 -0
- package/src/crypto/webcrypto/ecc.js +371 -0
- package/src/crypto/webcrypto/ed25519.js +248 -0
- package/src/crypto/webcrypto/hkdf.js +132 -0
- package/src/crypto/webcrypto/hmac.js +213 -0
- package/src/crypto/webcrypto/pbkdf2.js +146 -0
- package/src/crypto/webcrypto/rsa.js +415 -0
- package/src/crypto/webcrypto/x25519.js +250 -0
- package/src/dom/display/animate.js +154 -0
- package/src/dom/display/fullscreen.js +305 -0
- package/src/dom/fs/download.js +118 -0
- package/src/dom/fs/fsAccess.js +307 -0
- package/src/dom/fs/indexedDB.js +465 -0
- package/src/dom/fs/remoteStore.js +484 -0
- package/src/dom/fs/storage.js +440 -0
- package/src/dom/lifecycle/idle.js +133 -0
- package/src/dom/lifecycle/visibility.js +140 -0
- package/src/dom/lifecycle/wakeLock.js +187 -0
- package/src/dom/net/ajax.js +303 -0
- package/src/dom/net/broadcastChannel.js +89 -0
- package/src/dom/net/network.js +260 -0
- package/src/dom/net/sse.js +295 -0
- package/src/dom/net/webrtc.js +381 -0
- package/src/dom/net/ws.js +290 -0
- package/src/dom/query/dnd.js +409 -0
- package/src/dom/query/dom.js +831 -0
- package/src/dom/query/events.js +425 -0
- package/src/dom/query/gesture.js +396 -0
- package/src/dom/query/media.js +616 -0
- package/src/dom/rendering/chart.js +663 -0
- package/src/dom/rendering/component.js +469 -0
- package/src/dom/rendering/devtools-ui.js +399 -0
- package/src/dom/rendering/devtools.js +352 -0
- package/src/dom/rendering/parser.js +1055 -0
- package/src/dom/rendering/reactiveBind.js +341 -0
- package/src/dom/rendering/render.js +601 -0
- package/src/dom/rendering/sanitize.js +364 -0
- package/src/dom/rendering/secPolicy.js +281 -0
- package/src/dom/rendering/template.js +1031 -0
- package/src/dom/rendering/themeTokens.js +522 -0
- package/src/dom/rendering/uiSession-core.js +597 -0
- package/src/dom/rendering/uiSession-direct.js +251 -0
- package/src/dom/rendering/uiSession-list.js +751 -0
- package/src/dom/rendering/uiSession.js +145 -0
- package/src/dom/rendering/virtualScroll.js +341 -0
- package/src/dom/sensors/battery.js +153 -0
- package/src/dom/sensors/geolocation.js +156 -0
- package/src/dom/sensors/networkInfo.js +136 -0
- package/src/dom/sensors/sensors.js +340 -0
- package/src/dom/sw/backgroundSync.js +113 -0
- package/src/dom/sw/cache.js +139 -0
- package/src/dom/sw/push.js +181 -0
- package/src/dom/sw/serviceWorker.js +193 -0
- package/src/dom/sw/sharedWorker.js +192 -0
- package/src/dom/utils/a11y.js +244 -0
- package/src/dom/utils/clipboard.js +113 -0
- package/src/dom/utils/entropyCollector.js +344 -0
- package/src/dom/utils/focus.js +421 -0
- package/src/dom/utils/form.js +535 -0
- package/src/dom/utils/formKit.js +427 -0
- package/src/dom/utils/keybindings.js +574 -0
- package/src/dom/utils/leaderElection.js +280 -0
- package/src/dom/utils/notifications.js +218 -0
- package/src/dom/utils/permissions.js +107 -0
- package/src/dom/utils/route.js +482 -0
- package/src/dom/utils/ua.js +109 -0
- package/src/dom/utils/webauthn.js +369 -0
- package/src/external/README.md +15 -0
- package/src/io/binary/reader.js +374 -0
- package/src/io/binary/writer.js +351 -0
- package/src/io/calc/adler32.js +94 -0
- package/src/io/calc/bigint.js +276 -0
- package/src/io/calc/crc32.js +111 -0
- package/src/io/calc/easing.js +514 -0
- package/src/io/codec/b64.js +235 -0
- package/src/io/codec/base32.js +147 -0
- package/src/io/codec/base58.js +167 -0
- package/src/io/codec/buffer.js +630 -0
- package/src/io/codec/cbor.js +550 -0
- package/src/io/codec/csv.js +299 -0
- package/src/io/codec/hex.js +129 -0
- package/src/io/codec/mime.js +398 -0
- package/src/io/codec/msgpack.js +491 -0
- package/src/io/codec/url.js +530 -0
- package/src/io/codec/utf8.js +181 -0
- package/src/io/codec/xml.js +428 -0
- package/src/io/compress/bitstream.js +199 -0
- package/src/io/compress/brotli.js +3073 -0
- package/src/io/compress/brotli_dict.bin +432 -0
- package/src/io/compress/brotli_dict.js +356 -0
- package/src/io/compress/brotli_dict_words.js +157 -0
- package/src/io/compress/brotli_frame.js +420 -0
- package/src/io/compress/brotli_shared.js +715 -0
- package/src/io/compress/deflate.js +1432 -0
- package/src/io/compress/gzip.js +406 -0
- package/src/io/compress/huffman.js +322 -0
- package/src/io/compress/lz4.js +451 -0
- package/src/io/compress/lz77.js +408 -0
- package/src/io/compress/lzw.js +332 -0
- package/src/io/compress/zip.js +815 -0
- package/src/io/compress/zlib.js +340 -0
- package/src/io/i18n/i18n.js +236 -0
- package/src/io/math/fixed-point.js +269 -0
- package/src/io/math/geom.js +350 -0
- package/src/io/math/interp.js +263 -0
- package/src/io/math/linalg.js +472 -0
- package/src/io/math/stats.js +339 -0
- package/src/io/structures/btree.js +357 -0
- package/src/io/structures/heap.js +249 -0
- package/src/io/structures/lruCache.js +219 -0
- package/src/io/structures/ringBuffer.js +208 -0
- package/src/io/structures/tree-walker.js +413 -0
- package/src/io/structures/trie.js +219 -0
- package/src/io/sync/abort.js +196 -0
- package/src/io/sync/atomics.js +342 -0
- package/src/io/sync/cancellable.js +279 -0
- package/src/io/sync/channel.js +301 -0
- package/src/io/sync/mutex.js +148 -0
- package/src/io/sync/semaphore.js +156 -0
- package/src/io/sync/tokenBucket.js +208 -0
- package/src/io/text/ansi.js +536 -0
- package/src/io/text/html-entities.js +143 -0
- package/src/io/text/semver.js +375 -0
- package/src/io/text/str.js +243 -0
- package/src/io/text/unicode.js +188 -0
- package/src/io/time/date.js +355 -0
- package/src/io/timing/clock.js +79 -0
- package/src/io/timing/rateLimit.js +264 -0
- package/src/io/timing/scheduler.js +351 -0
- package/src/io/utils/bitmap.js +94 -0
- package/src/io/utils/errors.js +269 -0
- package/src/io/utils/eventBus.js +315 -0
- package/src/io/utils/queue.js +223 -0
- package/src/io/utils/signal.js +858 -0
- package/src/io/utils/ui8.js +99 -0
- package/src/io/utils/valid.js +556 -0
- package/src/main.js +41 -0
- package/src/polyfill/README.md +9 -0
- package/src/process/message.js +257 -0
- package/src/process/rpc.js +286 -0
- package/src/process/workerPool.js +392 -0
- package/src/sanity/base.js +374 -0
- package/src/sanity/community.js +254 -0
- package/src/sanity/lockdown-apply.js +58 -0
- package/src/sanity/lockdown.js +408 -0
- package/src/sanity/wasm-gate.js +316 -0
- package/src/typed.js +53 -0
- package/third-party/NOTICE-penner-easing +88 -0
- package/third-party/NOTICE-sjcl +50 -0
- package/tools/_lib/cli-help.js +55 -0
- package/tools/rendering/aot/index.js +148 -0
- package/tools/rendering/aot/lib/dom-codegen.js +295 -0
- package/tools/rendering/jsx/index.js +654 -0
- package/tools/rendering/precompilation/index.js +368 -0
- package/types/registry.generated.d.ts +217 -0
- package/types/typed.d.ts +106 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: mime
|
|
3
|
+
category: io/codec
|
|
4
|
+
dependencies: [utf8, random]
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: true
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# mime
|
|
11
|
+
|
|
12
|
+
> MIME/HTTP helpers β structured headers (RFC 7231 Β§3.1.1, RFC 5987) and `multipart/*` bodies (form-data, mixed).
|
|
13
|
+
|
|
14
|
+
**Module** `mime` | **Source** `packages/front/fw/src/io/codec/mime.js` | **Deps** `utf8`, `random` | **Worker-safe** yes
|
|
15
|
+
|
|
16
|
+
**Scope**: JS web framework. Covers practical client/server-in-browser needs:
|
|
17
|
+
- Parse / format header values with parameters (`Content-Type`, `Content-Disposition`, `Accept`β¦)
|
|
18
|
+
- Parse / format a header block (HTTP response, multipart part)
|
|
19
|
+
- Encode / decode `multipart/form-data` bodies (upload) and `multipart/mixed` (multi-resource response)
|
|
20
|
+
- Random boundary generation
|
|
21
|
+
|
|
22
|
+
**Out of scope**: quoted-printable, base64 transfer-encoding (β [b64](./b64.md)), RFC 2047 encoded-word (email).
|
|
23
|
+
|
|
24
|
+
## Resolve
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
const mime = runtime.resolve('mime');
|
|
28
|
+
// Returns: { parseHeader, formatHeader, parseHeaders, formatHeaders,
|
|
29
|
+
// encode, decode, randomBoundary }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## API
|
|
33
|
+
|
|
34
|
+
| Method | Signature | Returns |
|
|
35
|
+
|--------|-----------|---------|
|
|
36
|
+
| `parseHeader` | `(s: string) => {value, params}` | Parses a structured header |
|
|
37
|
+
| `formatHeader` | `(value \| {value, params}, params?) => string` | Serializes (quotes when needed) |
|
|
38
|
+
| `parseHeaders` | `(text: string) => Object` | Parses a CRLF block (name β value, lowercased) |
|
|
39
|
+
| `formatHeaders` | `(headers: Object) => string` | Emits `Name: value\r\n` (Title-Case) |
|
|
40
|
+
| `encode` | `(parts, options?) => {body, boundary, contentType}` | Builds a multipart body |
|
|
41
|
+
| `decode` | `(bytes: Uint8Array, boundary: string) => Part[]` | Decomposes a multipart body |
|
|
42
|
+
| `randomBoundary` | `() => string` | Unique random boundary |
|
|
43
|
+
|
|
44
|
+
**Type `Part`** : `{ headers: Object, body: Uint8Array }`.
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
### Parse a structured header
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
mime.parseHeader('multipart/form-data; boundary=abc; charset=utf-8');
|
|
52
|
+
// { value: 'multipart/form-data', params: { boundary: 'abc', charset: 'utf-8' } }
|
|
53
|
+
|
|
54
|
+
mime.parseHeader('form-data; name="file"; filename="a.txt"');
|
|
55
|
+
// { value: 'form-data', params: { name: 'file', filename: 'a.txt' } }
|
|
56
|
+
|
|
57
|
+
// RFC 5987 extended param (UTF-8 encoded) β automatically decoded
|
|
58
|
+
mime.parseHeader("attachment; filename*=UTF-8''caf%C3%A9.txt");
|
|
59
|
+
// { value: 'attachment', params: { filename: 'cafΓ©.txt' } }
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Parameter names are lowercased. If both `name*=` and `name=` are present, the extended form (RFC 5987) takes precedence.
|
|
63
|
+
|
|
64
|
+
### Format a header
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
mime.formatHeader('text/plain', { charset: 'utf-8' });
|
|
68
|
+
// 'text/plain; charset=utf-8'
|
|
69
|
+
|
|
70
|
+
// Automatic quoting when the value contains a non-token character
|
|
71
|
+
mime.formatHeader('form-data', { name: 'a b', filename: 'my "file".txt' });
|
|
72
|
+
// 'form-data; name="a b"; filename="my \\"file\\".txt"'
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Upload form-data
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
const { utf8, mime } = fw.runtime.resolveAll(['utf8', 'mime']);
|
|
79
|
+
|
|
80
|
+
const { body, contentType } = mime.encode([
|
|
81
|
+
{
|
|
82
|
+
headers: { 'content-disposition': 'form-data; name="user"' },
|
|
83
|
+
body: 'alice'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
headers: {
|
|
87
|
+
'content-disposition': 'form-data; name="avatar"; filename="me.png"',
|
|
88
|
+
'content-type': 'image/png'
|
|
89
|
+
},
|
|
90
|
+
body: pngBytes // Uint8Array
|
|
91
|
+
}
|
|
92
|
+
]);
|
|
93
|
+
|
|
94
|
+
await fetch('/upload', {
|
|
95
|
+
method: 'POST',
|
|
96
|
+
headers: { 'Content-Type': contentType },
|
|
97
|
+
body
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Parse a multipart response
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
const response = await fetch('/byteranges-resource');
|
|
105
|
+
const ct = mime.parseHeader(response.headers.get('content-type'));
|
|
106
|
+
// ct.value === 'multipart/byteranges'
|
|
107
|
+
// ct.params.boundary === 'xyz'
|
|
108
|
+
|
|
109
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
110
|
+
const parts = mime.decode(bytes, ct.params.boundary);
|
|
111
|
+
|
|
112
|
+
for (const part of parts) {
|
|
113
|
+
const range = part.headers['content-range'];
|
|
114
|
+
console.log(range, part.body.length, 'bytes');
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Parse a header block
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
const raw = 'Content-Type: text/plain\r\nContent-Length: 42\r\nX-Foo: a\r\nX-Foo: b';
|
|
122
|
+
mime.parseHeaders(raw);
|
|
123
|
+
// { 'content-type': 'text/plain', 'content-length': '42', 'x-foo': 'a, b' }
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Names are always lowercased. Multiple values for the same name are joined with `', '` (RFC 7230 Β§3.2.2). Folded lines (obsolete line-folding) are tolerated during decoding.
|
|
127
|
+
|
|
128
|
+
## Worker Usage
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
const worker = fw.createWorker(
|
|
132
|
+
function ({ libs, args }) {
|
|
133
|
+
const [bytesArray, boundary] = args;
|
|
134
|
+
const parts = libs.mime.decode(new Uint8Array(bytesArray), boundary);
|
|
135
|
+
self.postMessage(parts.map(p => ({
|
|
136
|
+
headers: p.headers,
|
|
137
|
+
bodyLength: p.body.length
|
|
138
|
+
})));
|
|
139
|
+
},
|
|
140
|
+
{ dependencies: ['mime'], args: [Array.from(bodyBytes), boundary] }
|
|
141
|
+
);
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Notes
|
|
145
|
+
|
|
146
|
+
- The `decode` parser accepts a **preamble** before the first boundary (RFC 2046 spec).
|
|
147
|
+
- `decode` tolerates LF or CRLF after a boundary; `encode` always emits CRLF (strict RFC).
|
|
148
|
+
- For uploads where native `FormData` suffices, prefer the browser API β `mime.encode` is useful when you need precise control over framing, custom per-part headers, or `multipart/mixed` bodies.
|
|
149
|
+
- `randomBoundary` uses the CSPRNG from the [`random`](../../crypto/utils/random.md) module (8 bytes via `random.bytes(8)` β 16 hex chars). If the entropy source is unavailable, `randomBoundary` returns `false`; `encode(parts, { boundary })` lets you supply a custom boundary.
|
|
150
|
+
- The `multipart/byteranges` family (HTTP `Range` multi-range response) is decoded with the same `decode` by passing the boundary extracted from `Content-Type`.
|
|
151
|
+
|
|
152
|
+
## See also
|
|
153
|
+
|
|
154
|
+
- [utf8](./utf8.md) β dependency (text/bytes conversion)
|
|
155
|
+
- [url](./url.md) β querystring (URL-side equivalent)
|
|
156
|
+
- [b64](./b64.md) β Base64 encoding used in some MIME transfers
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: msgpack
|
|
3
|
+
category: io/codec
|
|
4
|
+
dependencies: [utf8]
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: true
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# msgpack
|
|
11
|
+
|
|
12
|
+
> MessagePack encoder/decoder (full official spec, including the timestamp extension type -1). Compact binary format, denser alternative to JSON.
|
|
13
|
+
|
|
14
|
+
**Module** `msgpack` | **Source** `packages/front/fw/src/io/codec/msgpack.js` | **Deps** `utf8` | **Worker-safe** yes
|
|
15
|
+
|
|
16
|
+
**Conformance level**: full MessagePack spec β all formats (nil, bool, int, float32/64, str, bin, array, map, ext) **including the standard timestamp extension (-1)**. Encoded in shortest form (float32 if exact, otherwise float64; fixint before int8/16/32; fixstr before str8/16/32; etc.).
|
|
17
|
+
|
|
18
|
+
## Resolve
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
const msgpack = runtime.resolve('msgpack');
|
|
22
|
+
// Returns: { encode, decode, Ext }
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## API
|
|
26
|
+
|
|
27
|
+
| Method | Signature | Returns |
|
|
28
|
+
|--------|-----------|---------|
|
|
29
|
+
| `encode` | `(value: any) => Uint8Array` | MessagePack representation |
|
|
30
|
+
| `decode` | `(bytes: Uint8Array, options?: {useMap?: boolean}) => any` | Reconstructed JS value |
|
|
31
|
+
| `Ext` | `class Ext(type, data)` | Ext wrapper (type β [-128, 127], data: `Uint8Array`). Type -1 reserved for the standard timestamp (handled automatically via `Date`) |
|
|
32
|
+
|
|
33
|
+
## JS β MessagePack mapping
|
|
34
|
+
|
|
35
|
+
| JS value | Encoding |
|
|
36
|
+
|----------|----------|
|
|
37
|
+
| `null`, `undefined` | `0xc0` (nil) |
|
|
38
|
+
| `false`, `true` | `0xc2` / `0xc3` |
|
|
39
|
+
| `Number` integer in `[-2^31, 2^32-1]` | (neg)fixint / uint / int 8/16/32 (shortest) |
|
|
40
|
+
| `Number` fractional or out of range | `float64` (`0xcb`) |
|
|
41
|
+
| `BigInt` `[0, 2^64-1]` | `uint64` (`0xcf`) |
|
|
42
|
+
| `BigInt` `[-2^63, 0)` | `int64` (`0xd3`) |
|
|
43
|
+
| `String` | fixstr / str8 / str16 / str32 (UTF-8) |
|
|
44
|
+
| `Uint8Array` | bin8 / bin16 / bin32 |
|
|
45
|
+
| `Array` | fixarray / array16 / array32 |
|
|
46
|
+
| `Map` | fixmap / map16 / map32 (order preserved) |
|
|
47
|
+
| `Object` (plain) | fixmap / map16 / map32 |
|
|
48
|
+
| `Date` | timestamp 32 / 64 / 96 (fixext4 / fixext8 / ext8) |
|
|
49
|
+
| `Ext` | fixext 1/2/4/8/16 or ext8/16/32 |
|
|
50
|
+
| `-0` | preserved as float32 (`0xca 80 00 00 00`) |
|
|
51
|
+
|
|
52
|
+
## Examples
|
|
53
|
+
|
|
54
|
+
### Basic
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
const msgpack = runtime.resolve('msgpack');
|
|
58
|
+
|
|
59
|
+
const bytes = msgpack.encode({ name: 'Alice', age: 30, tags: ['admin', 'user'] });
|
|
60
|
+
const back = msgpack.decode(bytes);
|
|
61
|
+
// { name: 'Alice', age: 30, tags: ['admin', 'user'] }
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Extensions (passthrough)
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
const { Ext } = msgpack;
|
|
68
|
+
|
|
69
|
+
// Type 1: application-defined (e.g. custom 64-bit timestamp)
|
|
70
|
+
const encoded = msgpack.encode(new Ext(1, new Uint8Array([0, 1, 2, 3])));
|
|
71
|
+
const decoded = msgpack.decode(encoded);
|
|
72
|
+
// decoded instanceof Ext β true
|
|
73
|
+
// decoded.type === 1, decoded.data : Uint8Array([0, 1, 2, 3])
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### BigInt
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
msgpack.encode(0xffffffffffffffffn); // cfffffffffffffffff (uint64)
|
|
80
|
+
msgpack.encode(-0x8000000000000000n); // d38000000000000000 (int64)
|
|
81
|
+
// Beyond 64 bits: throw
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Dates (timestamp extension standard)
|
|
85
|
+
|
|
86
|
+
`Date` is auto-encoded using the official type -1 extension and decoded back to `Date`:
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
const now = new Date();
|
|
90
|
+
msgpack.encode(now); // d6 ff xxxxxxxx (timestamp 32) or d7 ff ... (64) or c7 0c ff ... (96)
|
|
91
|
+
msgpack.decode(encoded); // Date
|
|
92
|
+
|
|
93
|
+
// Dates before 1970 or far in the future β timestamp 96 (12 bytes)
|
|
94
|
+
msgpack.encode(new Date('1900-01-01T00:00:00.500Z'));
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Variant chosen automatically:
|
|
98
|
+
- **timestamp 32** (6 bytes): whole second, 1970 β€ year β€ 2106.
|
|
99
|
+
- **timestamp 64** (10 bytes): nanosecond precision, 1970 β€ year β€ ~2514.
|
|
100
|
+
- **timestamp 96** (15 bytes): otherwise (before 1970 or far in the future).
|
|
101
|
+
|
|
102
|
+
### Preserving Map type on decode
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
// Default: msgpack map β JS Object (keys coerced to string)
|
|
106
|
+
msgpack.decode(bytes);
|
|
107
|
+
|
|
108
|
+
// useMap: true β Map with original keys and order preserved
|
|
109
|
+
msgpack.decode(bytes, { useMap: true });
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Worker Usage
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
const worker = fw.createWorker(
|
|
116
|
+
function ({ libs, args }) {
|
|
117
|
+
const [bytes] = args;
|
|
118
|
+
const value = libs.msgpack.decode(new Uint8Array(bytes));
|
|
119
|
+
self.postMessage(value);
|
|
120
|
+
},
|
|
121
|
+
{ dependencies: ['msgpack'], args: [Array.from(msgpackBytes)] }
|
|
122
|
+
);
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Notes
|
|
126
|
+
|
|
127
|
+
- Integers and strings encoded in shortest form (fixint before int8/16/32, fixstr before str8/16/32, etc.).
|
|
128
|
+
- Floats are emitted as `float32` if the value is exactly representable, otherwise `float64` β symmetric interop with msgpack-c, msgpack-python, msgpack-go.
|
|
129
|
+
- `undefined` is encoded as `nil` (`0xc0`) and read back as `null` (information loss, consistent with reference implementations).
|
|
130
|
+
- `Map` input β msgpack map. To retrieve a `Map` on output, use `{ useMap: true }`.
|
|
131
|
+
- BigInt outside the 64-bit range β **throw** (MessagePack has no standard "bignum" extension; use a custom `Ext` or switch to [cbor](./cbor.md) which handles bignums via tags 2/3).
|
|
132
|
+
- Directly unsupported JS types: `Symbol`, `Function`, `Promise`.
|
|
133
|
+
- Comparison:
|
|
134
|
+
- [cbor](./cbor.md): richer (float16, typed tags, bignum, deterministic encoding for crypto), IETF standard.
|
|
135
|
+
- [buffer](./buffer.md): awa internal format, most compact for small integers, non-interop.
|
|
136
|
+
- `msgpack`: most widely used in the Redis / MongoDB / ZeroMQ / Fluentd ecosystem.
|
|
137
|
+
|
|
138
|
+
## See also
|
|
139
|
+
|
|
140
|
+
- [cbor](./cbor.md) β IETF standard alternative
|
|
141
|
+
- [buffer](./buffer.md) β awa internal binary format
|
|
142
|
+
- [utf8](./utf8.md) β dependency
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: url
|
|
3
|
+
category: io/codec
|
|
4
|
+
dependencies: []
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: true
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# url
|
|
11
|
+
|
|
12
|
+
> Robust querystring parsing/serialization + URL helpers + CommonMark encoder. Complement to native `URLSearchParams` (which handles neither structured arrays nor nested objects).
|
|
13
|
+
|
|
14
|
+
**Module** `url` | **Source** `packages/front/fw/src/io/codec/url.js` | **Deps** none | **Worker-safe** yes
|
|
15
|
+
|
|
16
|
+
**Why not just `URLSearchParams`**:
|
|
17
|
+
- Returns only strings, not arrays or structured objects.
|
|
18
|
+
- No support for `a[]=1&a[]=2` (brackets), `a[0]=1` (indices), or `a=1,2` (comma).
|
|
19
|
+
- No nested parsing `user[name]=Alice`.
|
|
20
|
+
- No `sort` or `skipNull` option.
|
|
21
|
+
|
|
22
|
+
`url.parseURL` / `url.buildURL` use the native `URL` under the hood β they are simple wrappers that add the decomposed query and a symmetric API for building URLs.
|
|
23
|
+
|
|
24
|
+
## Resolve
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
const url = runtime.resolve('url');
|
|
28
|
+
// Returns: { parseQuery, stringifyQuery, parseURL, buildURL, encodeSafe, decodeSafe }
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## API
|
|
32
|
+
|
|
33
|
+
| Method | Signature | Returns |
|
|
34
|
+
|--------|-----------|---------|
|
|
35
|
+
| `parseQuery` | `(str: string, options?) => Object` | Object from querystring |
|
|
36
|
+
| `stringifyQuery` | `(obj: Object, options?) => string` | Querystring (without leading `?`) |
|
|
37
|
+
| `parseURL` | `(str: string, base?: string) => URLParts` | Decomposed URL + parsed `.query` |
|
|
38
|
+
| `buildURL` | `(parts: Object) => string` | Reconstructed URL |
|
|
39
|
+
| `encodeSafe` | `(s: string, options?) => string` | URI encoded CommonMark / mdurl@2 style |
|
|
40
|
+
| `decodeSafe` | `(s: string) => string` | Best-effort percent decoding (fail-soft) |
|
|
41
|
+
|
|
42
|
+
### `encodeSafe` options
|
|
43
|
+
|
|
44
|
+
| Option | Type | Default | Description |
|
|
45
|
+
|--------|------|---------|-------------|
|
|
46
|
+
| `safe` | `string` | `";/?:@&=+$,-_.!~*'()#"` | ASCII characters to leave verbatim (in addition to alphanumerics) |
|
|
47
|
+
|
|
48
|
+
### `parseQuery` / `stringifyQuery` options
|
|
49
|
+
|
|
50
|
+
| Option | Values | Default | Description |
|
|
51
|
+
|--------|--------|---------|-------------|
|
|
52
|
+
| `arrayFormat` | `'repeat'`, `'brackets'`, `'indices'`, `'comma'`, `'none'` | `'repeat'` | Array form (see table below) |
|
|
53
|
+
| `nested` | `boolean` | `false` | Support `a[b]=v` β nested object |
|
|
54
|
+
| `space` | `'percent'`, `'plus'` | `'percent'` | `+` = space (`'plus'`, HTML form compat) or literal |
|
|
55
|
+
| `delimiter` | `string` | `'&'` | Pair separator |
|
|
56
|
+
| `skipNull` | `boolean` (stringify) | `false` | Omit `null`/`undefined` entries |
|
|
57
|
+
| `sort` | `boolean` (stringify) | `false` | Lexicographic key sort |
|
|
58
|
+
|
|
59
|
+
### Array formats
|
|
60
|
+
|
|
61
|
+
| arrayFormat | Example | Use case |
|
|
62
|
+
|-------------|---------|----------|
|
|
63
|
+
| `'repeat'` | `a=1&a=2` | W3C form standard, Express `req.query` |
|
|
64
|
+
| `'brackets'` | `a[]=1&a[]=2` | PHP, Rails, qs-compat |
|
|
65
|
+
| `'indices'` | `a[0]=1&a[1]=2` | PHP, explicit order |
|
|
66
|
+
| `'comma'` | `a=1,2` | Swagger/OpenAPI, compact APIs |
|
|
67
|
+
| `'none'` | `a=1&a=2` β `a:'2'` | Strict 1-to-1 (last wins) |
|
|
68
|
+
|
|
69
|
+
## JS β querystring mapping (stringify)
|
|
70
|
+
|
|
71
|
+
| Value | Output |
|
|
72
|
+
|-------|--------|
|
|
73
|
+
| `string`, `number`, `boolean`, `bigint` | URI-encoded decimal form |
|
|
74
|
+
| `null` | key emitted with empty value (`a=`) |
|
|
75
|
+
| `undefined` | pair omitted |
|
|
76
|
+
| `Date` | ISO 8601 (`.toISOString()`) |
|
|
77
|
+
| `Array` | per `arrayFormat` |
|
|
78
|
+
| `Object` | per `nested` (otherwise `[object Object]`) |
|
|
79
|
+
|
|
80
|
+
## Examples
|
|
81
|
+
|
|
82
|
+
### Basic
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
const url = runtime.resolve('url');
|
|
86
|
+
|
|
87
|
+
url.parseQuery('a=1&b=2');
|
|
88
|
+
// { a: '1', b: '2' }
|
|
89
|
+
|
|
90
|
+
url.stringifyQuery({ q: 'hello world', page: 2 });
|
|
91
|
+
// 'q=hello%20world&page=2'
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Arrays
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
// Repeat (default)
|
|
98
|
+
url.parseQuery('tag=js&tag=web');
|
|
99
|
+
// { tag: ['js', 'web'] }
|
|
100
|
+
|
|
101
|
+
// Brackets (PHP/qs)
|
|
102
|
+
url.parseQuery('tag[]=js&tag[]=web', { arrayFormat: 'brackets' });
|
|
103
|
+
// { tag: ['js', 'web'] }
|
|
104
|
+
|
|
105
|
+
// Indices
|
|
106
|
+
url.parseQuery('tag[0]=js&tag[1]=web', { arrayFormat: 'indices' });
|
|
107
|
+
// { tag: ['js', 'web'] }
|
|
108
|
+
|
|
109
|
+
// Comma
|
|
110
|
+
url.parseQuery('tags=js,web,ts', { arrayFormat: 'comma' });
|
|
111
|
+
// { tags: ['js', 'web', 'ts'] }
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Nested objects
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
url.parseQuery('user[name]=Alice&user[age]=30', { nested: true });
|
|
118
|
+
// { user: { name: 'Alice', age: '30' } }
|
|
119
|
+
|
|
120
|
+
url.stringifyQuery({ user: { name: 'Alice', age: 30 } }, { nested: true });
|
|
121
|
+
// 'user%5Bname%5D=Alice&user%5Bage%5D=30'
|
|
122
|
+
|
|
123
|
+
// Mix with arrays
|
|
124
|
+
url.parseQuery('user[tags][]=a&user[tags][]=b', { arrayFormat: 'brackets' });
|
|
125
|
+
// { user: { tags: ['a', 'b'] } }
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Spaces: `+` vs `%20`
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
// HTML form (application/x-www-form-urlencoded)
|
|
132
|
+
url.parseQuery('q=hello+world', { space: 'plus' });
|
|
133
|
+
// { q: 'hello world' }
|
|
134
|
+
|
|
135
|
+
url.stringifyQuery({ q: 'hello world' }, { space: 'plus' });
|
|
136
|
+
// 'q=hello+world'
|
|
137
|
+
|
|
138
|
+
// Generic URI query (default)
|
|
139
|
+
url.stringifyQuery({ q: 'hello world' });
|
|
140
|
+
// 'q=hello%20world'
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### skipNull / sort
|
|
144
|
+
|
|
145
|
+
```js
|
|
146
|
+
url.stringifyQuery({ b: 2, a: 1, c: null }, { sort: true, skipNull: true });
|
|
147
|
+
// 'a=1&b=2'
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### URL helpers
|
|
151
|
+
|
|
152
|
+
```js
|
|
153
|
+
const u = url.parseURL('https://user:pass@example.com:8080/api/users?id=5&tag=new#top');
|
|
154
|
+
// {
|
|
155
|
+
// protocol: 'https:', username: 'user', password: 'pass',
|
|
156
|
+
// hostname: 'example.com', port: '8080', host: 'example.com:8080',
|
|
157
|
+
// pathname: '/api/users',
|
|
158
|
+
// search: '?id=5&tag=new', hash: '#top',
|
|
159
|
+
// origin: 'https://example.com:8080',
|
|
160
|
+
// href: 'https://user:pass@example.com:8080/api/users?id=5&tag=new#top',
|
|
161
|
+
// query: { id: '5', tag: 'new' } // β decomposed
|
|
162
|
+
// }
|
|
163
|
+
|
|
164
|
+
// Relative resolution via `base`
|
|
165
|
+
url.parseURL('/api/users', 'https://example.com');
|
|
166
|
+
// .href === 'https://example.com/api/users'
|
|
167
|
+
|
|
168
|
+
// Inverse construction
|
|
169
|
+
url.buildURL({
|
|
170
|
+
protocol: 'https',
|
|
171
|
+
hostname: 'example.com',
|
|
172
|
+
pathname: '/api/search',
|
|
173
|
+
query: { q: 'foo bar', lang: 'fr' }
|
|
174
|
+
});
|
|
175
|
+
// 'https://example.com/api/search?q=foo%20bar&lang=fr'
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### `encodeSafe` / `decodeSafe`
|
|
179
|
+
|
|
180
|
+
```js
|
|
181
|
+
const url = runtime.resolve('url');
|
|
182
|
+
|
|
183
|
+
// Encodes a URI CommonMark-style β space β %20, characters outside the safe-set encoded
|
|
184
|
+
url.encodeSafe('http://example.com/?q=foo bar');
|
|
185
|
+
// β 'http://example.com/?q=foo%20bar'
|
|
186
|
+
|
|
187
|
+
// UTF-8 multi-byte
|
|
188
|
+
url.encodeSafe('CafΓ©');
|
|
189
|
+
// β 'Caf%C3%A9'
|
|
190
|
+
|
|
191
|
+
// Valid %HH β pass-through (no double-encoding)
|
|
192
|
+
url.encodeSafe('http://x.com/%20foo');
|
|
193
|
+
// β 'http://x.com/%20foo'
|
|
194
|
+
|
|
195
|
+
// Invalid %HH β re-encoded
|
|
196
|
+
url.encodeSafe('http://x.com/%G1');
|
|
197
|
+
// β 'http://x.com/%25G1'
|
|
198
|
+
|
|
199
|
+
// Custom safe-set
|
|
200
|
+
url.encodeSafe('foo bar', { safe: 'ABCabc' });
|
|
201
|
+
// β 'foo%20bar'
|
|
202
|
+
|
|
203
|
+
// Surrogate pair (emoji) β full UTF-8
|
|
204
|
+
url.encodeSafe('π');
|
|
205
|
+
// β '%F0%9F%8E%89'
|
|
206
|
+
|
|
207
|
+
// Lone surrogate β U+FFFD encoded
|
|
208
|
+
url.encodeSafe('\uD800');
|
|
209
|
+
// β '%EF%BF%BD'
|
|
210
|
+
|
|
211
|
+
// Symmetric best-effort decoder
|
|
212
|
+
url.decodeSafe('Caf%C3%A9');
|
|
213
|
+
// β 'CafΓ©'
|
|
214
|
+
|
|
215
|
+
// Fail-soft: invalid sequence returned as-is
|
|
216
|
+
url.decodeSafe('%G1');
|
|
217
|
+
// β '%G1'
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Why not native `encodeURI`
|
|
221
|
+
|
|
222
|
+
`encodeURI` is similar but has important differences for markup usage (HTML / RSS / Markdown / Org-mode):
|
|
223
|
+
|
|
224
|
+
| Character | `encodeURI` | `encodeSafe` (CommonMark) |
|
|
225
|
+
|-----------|-------------|--------------------------|
|
|
226
|
+
| `[` `]` | preserved | encoded (`%5B` `%5D`) |
|
|
227
|
+
| `<` `>` | preserved | encoded (`%3C` `%3E`) |
|
|
228
|
+
| space | `%20` | `%20` |
|
|
229
|
+
| valid `%HH` | double-encoded | pass-through |
|
|
230
|
+
| invalid `%HH` | left as-is | `%` β `%25` |
|
|
231
|
+
| lone surrogate | error \| `%EF%BF%BD` | `%EF%BF%BD` |
|
|
232
|
+
|
|
233
|
+
`encodeURIComponent` is too strict: it encodes `/`, `:`, `@`, `&`, `=`, `+`, `$`, `,` β unsuitable for complete URLs.
|
|
234
|
+
|
|
235
|
+
`encodeSafe` faithfully implements the `mdurl@2` algorithm used by `markdown-it`, guaranteeing CommonMark compatibility without regression.
|
|
236
|
+
|
|
237
|
+
## Worker Usage
|
|
238
|
+
|
|
239
|
+
```js
|
|
240
|
+
const worker = fw.createWorker(
|
|
241
|
+
function ({ libs, args }) {
|
|
242
|
+
const [qs] = args;
|
|
243
|
+
const parsed = libs.url.parseQuery(qs, { nested: true });
|
|
244
|
+
self.postMessage(parsed);
|
|
245
|
+
},
|
|
246
|
+
{ dependencies: ['url'], args: ['user[name]=Alice&user[age]=30'] }
|
|
247
|
+
);
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Notes
|
|
251
|
+
|
|
252
|
+
- Keys and values are percent-decoded/encoded via native `encodeURIComponent` / `decodeURIComponent`. An invalid decode (`%ZZ`) returns the raw string (fail-soft).
|
|
253
|
+
- `arrayFormat: 'comma'` does **not** encode the `,` separator (common practice, compatible with OpenAPI `form` style). If values contain literal commas, use a different format.
|
|
254
|
+
- `nested` is additive to `arrayFormat: brackets/indices` β both rely on the `[...]` notation in the key.
|
|
255
|
+
- `parseURL` delegates to the native `URL` when available (browsers + workers + modern bun/node); a regex fallback exists for ultra-minimal environments.
|
|
256
|
+
- `buildURL` accepts `query` as an object **or** a string (e.g. an already-serialized query).
|
|
257
|
+
- Duplicate keys in `'none'` mode: the last one wins. In array modes, all occurrences are collected.
|
|
258
|
+
- `encodeSafe` faithfully reproduces the `mdurl@2` (CommonMark) algorithm: default safe-set `";/?:@&=+$,-_.!~*'()#"`, pass-through of valid `%HH`, re-encoding of invalid `%`, surrogates β U+FFFD. Worker-safe (no DOM or side-effects).
|
|
259
|
+
- `decodeSafe` is a fail-soft wrapper on `decodeURIComponent`: invalid sequences are returned as-is rather than throwing an exception.
|
|
260
|
+
|
|
261
|
+
## See also
|
|
262
|
+
|
|
263
|
+
- [csv](./csv.md) β another structured text codec
|
|
264
|
+
- [mime](./mime.md) β HTTP headers (body-side counterpart)
|
|
265
|
+
- [utf8](./utf8.md) β bytes β string conversion when needed
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: utf8
|
|
3
|
+
category: io/codec
|
|
4
|
+
dependencies: []
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: true
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# utf8
|
|
11
|
+
|
|
12
|
+
> UTF-8 encoding/decoding. Supports ASCII, 2-byte and 3-byte sequences (full BMP Unicode).
|
|
13
|
+
|
|
14
|
+
**Module** `utf8` | **Source** `packages/front/fw/src/io/codec/utf8.js` | **Deps** none | **Worker-safe** yes
|
|
15
|
+
|
|
16
|
+
## Resolve
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
const utf8 = runtime.resolve('utf8');
|
|
20
|
+
// Returns: { toBytes, fromBytes }
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## API
|
|
24
|
+
|
|
25
|
+
| Method | Signature | Returns |
|
|
26
|
+
|--------|-----------|---------|
|
|
27
|
+
| `toBytes` | `(text: string) => Uint8Array` | UTF-8 bytes |
|
|
28
|
+
| `fromBytes` | `(bytes: Uint8Array\|number[]) => string` | JS string |
|
|
29
|
+
|
|
30
|
+
### `utf8.toBytes(text)`
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
utf8.toBytes('Hello'); // Uint8Array [72, 101, 108, 108, 111]
|
|
34
|
+
utf8.toBytes('δΈη'); // Uint8Array [228, 184, 150, 231, 149, 140]
|
|
35
|
+
utf8.toBytes('Γ©'); // Uint8Array [195, 169]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### `utf8.fromBytes(bytes)`
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
utf8.fromBytes(new Uint8Array([72, 101, 108, 108, 111])); // "Hello"
|
|
42
|
+
utf8.fromBytes(new Uint8Array([228, 184, 150, 231, 149, 140])); // "δΈη"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Examples
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
const { utf8, b64, hex } = runtime.resolveAll(['utf8', 'b64', 'hex']);
|
|
49
|
+
|
|
50
|
+
// Encode text β bytes β base64
|
|
51
|
+
const bytes = utf8.toBytes('Bonjour le monde');
|
|
52
|
+
const encoded = b64.fromBytes(bytes);
|
|
53
|
+
console.log(encoded); // "Qm9uam91ciBsZSBtb25kZQ=="
|
|
54
|
+
|
|
55
|
+
// Decode base64 β bytes β text
|
|
56
|
+
const decoded = utf8.fromBytes(b64.toBytes(encoded));
|
|
57
|
+
console.log(decoded); // "Bonjour le monde"
|
|
58
|
+
|
|
59
|
+
// View the hex representation
|
|
60
|
+
console.log(hex.fromBytes(utf8.toBytes('AB'))); // "4142"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Worker Usage
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
const worker = fw.createWorker(
|
|
67
|
+
function ({ libs, args }) {
|
|
68
|
+
const utf8 = libs.utf8;
|
|
69
|
+
const bytes = utf8.toBytes(args.text);
|
|
70
|
+
self.postMessage(bytes);
|
|
71
|
+
},
|
|
72
|
+
{ dependencies: ['utf8'], args: { text: 'Hello World' } }
|
|
73
|
+
);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Notes
|
|
77
|
+
|
|
78
|
+
- Implemented via `encodeURI` (encoding) and manual decoding (decoding).
|
|
79
|
+
- Supports 1, 2 and 3-byte sequences β covers the Unicode BMP (U+0000 to U+FFFF).
|
|
80
|
+
- Non-BMP characters (emoji, etc.): represented as surrogate pairs via `encodeURI`.
|
|
81
|
+
|
|
82
|
+
## See also
|
|
83
|
+
|
|
84
|
+
- [hex](./hex.md), [b64](./b64.md), [buffer](./buffer.md)
|