@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,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: xml
|
|
3
|
+
category: io/codec
|
|
4
|
+
dependencies: []
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: true
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# xml
|
|
11
|
+
|
|
12
|
+
> Minimal tolerant XML parser/serializer, sufficient for 90% of cases (OOXML/ODF parts, XMP metadata, inline SVG, RSS, MathML, configs).
|
|
13
|
+
|
|
14
|
+
**Module** `xml` | **Source** `packages/front/fw/src/io/codec/xml.js` | **Deps** none | **Worker-safe** yes
|
|
15
|
+
|
|
16
|
+
## Resolve
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
const xml = runtime.resolve('xml');
|
|
20
|
+
// Returns: { el, text, parse, serialize, serializeNode,
|
|
21
|
+
// findChild, findAll, textContent,
|
|
22
|
+
// encodeText, encodeAttr, decodeEntities }
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## API
|
|
26
|
+
|
|
27
|
+
| Method | Signature | Returns |
|
|
28
|
+
|--------|-----------|---------|
|
|
29
|
+
| `parse` | `(text: string) => ElementNode` | Node tree — root element. Throws `XmlParseError` if invalid. |
|
|
30
|
+
| `serialize` | `(root: ElementNode) => string` | Full XML with `UTF-8 standalone="yes"` prolog. |
|
|
31
|
+
| `serializeNode` | `(node: Node) => string` | XML without prolog. |
|
|
32
|
+
| `el` | `(name: string, attrs?: Object, children?: Node[]) => ElementNode` | Element constructor. |
|
|
33
|
+
| `text` | `(value: string) => TextNode` | Text node constructor. |
|
|
34
|
+
| `findChild` | `(node: ElementNode, name: string) => ElementNode \| null` | First named child. |
|
|
35
|
+
| `findAll` | `(node: ElementNode, name: string) => ElementNode[]` | All named children. |
|
|
36
|
+
| `textContent` | `(node: Node) => string` | Recursive text concatenation. |
|
|
37
|
+
| `encodeText` | `(s: string) => string` | Escapes `&`, `<`, `>`. |
|
|
38
|
+
| `encodeAttr` | `(s: string) => string` | Escapes `&`, `<`, `>`, `"`. |
|
|
39
|
+
| `decodeEntities` | `(s: string) => string` | Decodes `&`, `<`, `&#NNN;`, `&#xHHH;` etc. |
|
|
40
|
+
|
|
41
|
+
## Node model
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
{ type: 'element', name: 'w:p', attrs: { 'xml:lang': 'fr' }, children: [...] }
|
|
45
|
+
{ type: 'text', value: 'hello' }
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Examples
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
const xml = runtime.resolve('xml');
|
|
52
|
+
|
|
53
|
+
// Construction
|
|
54
|
+
const node = xml.el('root', { version: '1' }, [xml.text('hello')]);
|
|
55
|
+
|
|
56
|
+
// Parsing
|
|
57
|
+
const root = xml.parse('<a xmlns:w="urn:w"><w:p>hello</w:p></a>');
|
|
58
|
+
xml.textContent(xml.findChild(root, 'w:p')); // 'hello'
|
|
59
|
+
|
|
60
|
+
// Serialization
|
|
61
|
+
xml.serialize(node);
|
|
62
|
+
// '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<root version="1">hello</root>'
|
|
63
|
+
|
|
64
|
+
xml.serializeNode(xml.el('br')); // '<br/>'
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Worker Usage
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
// xml is worker-safe: all functions are pure closures,
|
|
71
|
+
// no DOM access, no global state.
|
|
72
|
+
const worker = fw.createWorker(workerScript);
|
|
73
|
+
// Transfer serialized nodes via serializeNode / parse on each side.
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Notes
|
|
77
|
+
|
|
78
|
+
- No DTD, no external entities — only predefined entities (`amp`, `lt`, `gt`, `quot`, `apos`) and numeric references (`&#NNN;`, `&#xHHH;`) are handled.
|
|
79
|
+
- No XSD validation; no strict namespace resolution — prefixes are preserved as-is in `name` (e.g. `w:p`).
|
|
80
|
+
- `XmlParseError` (code `xml/parse-error`) thrown on structural errors — the parser is tolerant for common OOXML/ODF cases but strict on basic structure.
|
|
81
|
+
- Oriented towards office documents and feeds (OOXML, ODF, XMP, SVG, RSS) — not a replacement for DOMParser with HTML5.
|
|
82
|
+
|
|
83
|
+
## See also
|
|
84
|
+
|
|
85
|
+
- [`utf8`](./utf8.md) — encoding content to bytes
|
|
86
|
+
- [`buffer`](./buffer.md) — binary object serialization
|
|
87
|
+
- [`csv`](./csv.md) — tabular text format parsing
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# IO / Compress — Compression
|
|
2
|
+
|
|
3
|
+
Binary compression modules. All worker-safe (pure factories, no DOM).
|
|
4
|
+
|
|
5
|
+
## Modules
|
|
6
|
+
|
|
7
|
+
| Module | Returns | Deps | Description |
|
|
8
|
+
|--------|----------|------|-------------|
|
|
9
|
+
| [lz4](./lz4.md) | `object` | none | LZ4 compression (fast, streaming) |
|
|
10
|
+
| [bitstream](./bitstream.md) | `object` | none | LSB-first bit read/write + reverse table |
|
|
11
|
+
| [huffman](./huffman.md) | `object` | bitstream | Canonical Huffman codes (encode + decode) |
|
|
12
|
+
| [lz77](./lz77.md) | `object` | none | LZ77 hash-chain matching (literal + match callbacks) |
|
|
13
|
+
| [lzw](./lzw.md) | `object` | none | LZW dynamic dictionary, variable codes (GIF/TIFF/.Z) |
|
|
14
|
+
| [deflate](./deflate.md) | `object` | bitstream, huffman, lz77 | Deflate (internal engine, RFC 1951) |
|
|
15
|
+
| [gzip](./gzip.md) | `object` | deflate, crc32 | Gzip sync/async/streaming (RFC 1952) |
|
|
16
|
+
| [zlib](./zlib.md) | `object` | deflate, adler32 | Zlib sync/async/streaming (RFC 1950) |
|
|
17
|
+
| [zip](./zip.md) | `object` | deflate, crc32 | ZIP sync/async/streaming archive |
|
|
18
|
+
| [brotliDict](./brotli_dict.md) | `object` | none | Brotli — tables + 121 transforms (RFC 7932 Appendix B) |
|
|
19
|
+
| [brotliDictWords](./brotli_dict_words.md) | `object` | none | Brotli — static dictionary blob (RFC 7932 Appendix A, lazy-loadable) |
|
|
20
|
+
| [brotli](./brotli.md) | `object` | bitstream, huffman, lz77, brotliDict, brotliDictWords | Brotli RFC 7932 — full decoder, dynamic encoder |
|
|
21
|
+
| [brotliShared](./brotli_shared.md) | `object` | brotli, brotliDict, brotliDictWords | RFC 9841 extensions (large window, shared dictionary §3.1/§3.2, `parseSharedDictionary` §5) |
|
|
22
|
+
| [brotliFrame](./brotli_frame.md) | `object` | none | RFC 9841 §8 Shared Brotli Framing Format parser |
|
|
23
|
+
|
|
24
|
+
## Common pattern
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
const lz4 = runtime.resolve('lz4');
|
|
28
|
+
const gzip = runtime.resolve('gzip');
|
|
29
|
+
const zip = runtime.resolve('zip');
|
|
30
|
+
const br = runtime.resolve('brotli');
|
|
31
|
+
|
|
32
|
+
// LZ4 — ultra-fast, ideal for temporary data
|
|
33
|
+
const [size, compressed] = lz4.compress(data, data.length);
|
|
34
|
+
const [origSize, original] = lz4.decompress(compressed);
|
|
35
|
+
|
|
36
|
+
// Gzip — web standard (Accept-Encoding, fetch)
|
|
37
|
+
const gz = gzip.gzipSync(data);
|
|
38
|
+
const raw = gzip.gunzipSync(gz);
|
|
39
|
+
|
|
40
|
+
// ZIP — multi-file archiving
|
|
41
|
+
const archive = zip.zipSync({ 'file.txt': textBytes, 'data.bin': binBytes });
|
|
42
|
+
const files = zip.unzipSync(archive);
|
|
43
|
+
|
|
44
|
+
// Brotli — RFC 7932, superior ratio on text
|
|
45
|
+
const enc = br.brotliCompressSync(data, { quality: 11 });
|
|
46
|
+
const dec = br.brotliDecompressSync(enc);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Choosing the right module
|
|
50
|
+
|
|
51
|
+
| Use case | Module |
|
|
52
|
+
|-------------|--------|
|
|
53
|
+
| Fast compression without standard | `lz4` |
|
|
54
|
+
| HTTP/browser compatibility (gzip Content-Encoding) | `gzip` |
|
|
55
|
+
| System tool compatibility (Unix `zlib`) | `zlib` |
|
|
56
|
+
| Multi-file archiving | `zip` |
|
|
57
|
+
| Compression only (base for gzip/zlib/zip) | `deflate` |
|
|
58
|
+
| Superior ratio on text (Brotli RFC 7932 core) | `brotli` |
|
|
59
|
+
| Shared dictionary / large window / §5 parser (RFC 9841) | `brotliShared` |
|
|
60
|
+
| Multi-resource framing container (RFC 9841 §8) | `brotliFrame` |
|
|
61
|
+
| Text compression with small dictionary | `lzw` (GIF/TIFF/.Z) |
|
|
62
|
+
| Low-level primitives for building a codec | `bitstream`, `huffman`, `lz77` |
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: bitstream
|
|
3
|
+
category: io/compress
|
|
4
|
+
dependencies: []
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: true
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# bitstream
|
|
11
|
+
|
|
12
|
+
> LSB-first bit-stream reader/writer over `Uint8Array` + 15-bit reverse table.
|
|
13
|
+
|
|
14
|
+
**Module** `bitstream` | **Source** `packages/front/fw/src/io/compress/bitstream.js` | **Deps** none | **Worker-safe** yes
|
|
15
|
+
|
|
16
|
+
Primitive shared by codecs whose bit layout follows DEFLATE/Brotli
|
|
17
|
+
conventions: little-endian packing within each byte, least-significant bit
|
|
18
|
+
first. Also exposes the `rev` 15-bit bit-reversal table used by canonical
|
|
19
|
+
Huffman decoding.
|
|
20
|
+
|
|
21
|
+
## Resolve
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
const bs = runtime.resolve('bitstream');
|
|
25
|
+
// { readBits, readBits16, writeBits, writeBits16, byteOffset, slice, max, rev }
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
| Method | Signature | Returns |
|
|
31
|
+
|--------|-----------|---------|
|
|
32
|
+
| `readBits` | `(buf: Uint8Array, bitPos: number, mask: number) => number` | up to 16 bits at `bitPos`, masked |
|
|
33
|
+
| `readBits16` | `(buf: Uint8Array, bitPos: number) => number` | up to 24 bits at `bitPos`, **not** masked |
|
|
34
|
+
| `writeBits` | `(buf: Uint8Array, bitPos: number, v: number) => void` | writes up to 16 bits (OR-into) |
|
|
35
|
+
| `writeBits16` | `(buf: Uint8Array, bitPos: number, v: number) => void` | writes up to 24 bits (OR-into) |
|
|
36
|
+
| `byteOffset` | `(bitPos: number) => number` | `ceil(bitPos / 8)` |
|
|
37
|
+
| `slice` | `(buf: Uint8Array, start?, end?) => Uint8Array` | copied sub-array (not a view) |
|
|
38
|
+
| `max` | `(arr: ArrayLike<number>) => number` | maximum |
|
|
39
|
+
| `rev` | `Uint16Array(32768)` | `rev[i]` = bit-reverse of `i` in 15 bits |
|
|
40
|
+
|
|
41
|
+
### `readBits(buf, bitPos, mask)`
|
|
42
|
+
|
|
43
|
+
Reads up to 16 bits starting at bit position `bitPos` (absolute index from
|
|
44
|
+
the beginning of `buf`). The `mask` must be pre-computed by the caller as
|
|
45
|
+
`(1 << nbits) - 1`. The explicit pattern allows the mask to be hoisted out
|
|
46
|
+
of hot loops.
|
|
47
|
+
|
|
48
|
+
### `writeBits(buf, bitPos, v)`
|
|
49
|
+
|
|
50
|
+
OR-into: destination bits must be zero before the call. This is the default
|
|
51
|
+
for a freshly allocated `Uint8Array`, which is the expected pattern
|
|
52
|
+
(pre-allocated output buffer, sequential writes).
|
|
53
|
+
|
|
54
|
+
### `rev`
|
|
55
|
+
|
|
56
|
+
15-bit bit-reversal table: `rev[i]` is `i` read in mirror over 15 bits,
|
|
57
|
+
the result right-shifted by one bit to fit in 15 useful bits. Used by
|
|
58
|
+
canonical Huffman decoders to index a table by the `maxBits` low-order
|
|
59
|
+
bits of the stream.
|
|
60
|
+
|
|
61
|
+
## Examples
|
|
62
|
+
|
|
63
|
+
### Write/read a 9-bit code
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
const bs = runtime.resolve('bitstream');
|
|
67
|
+
const out = new Uint8Array(4);
|
|
68
|
+
|
|
69
|
+
bs.writeBits(out, 5, 0x1A5); // 9 bits at position 5
|
|
70
|
+
const v = bs.readBits(out, 5, (1 << 9) - 1); // 0x1A5
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Build a mask from a bit count
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
const nbits = 11;
|
|
77
|
+
const mask = (1 << nbits) - 1;
|
|
78
|
+
bs.readBits(buf, p, mask); // reads 11 bits
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Worker Usage
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
const worker = fw.createWorker(
|
|
85
|
+
function ({ libs, args }) {
|
|
86
|
+
const bs = libs.bitstream;
|
|
87
|
+
const buf = args[0];
|
|
88
|
+
self.postMessage(bs.readBits(buf, 0, 0xFFFF));
|
|
89
|
+
},
|
|
90
|
+
{ dependencies: ['bitstream'], args: [new Uint8Array([0xCD, 0xAB])] }
|
|
91
|
+
);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Notes
|
|
95
|
+
|
|
96
|
+
- `readBits` always reads **2 consecutive bytes** starting at byte `floor(bitPos / 8)` (not `byteOffset(bitPos)`, which rounds up); an index past the end of the buffer reads as zero, never throws.
|
|
97
|
+
- `readBits16` reads **3 consecutive bytes** and does not mask — the caller must apply its own mask.
|
|
98
|
+
- `writeBits` / `writeBits16` are `OR-into`, **not** destructive writes: a second call on the same bits produces corrupt data.
|
|
99
|
+
- The `rev` table is built **once per factory instance** (~64 KB) — share the instance across consumer modules.
|
|
100
|
+
|
|
101
|
+
## Benchmark
|
|
102
|
+
|
|
103
|
+
Micro-cell `bitstream.rw`, `tools/bench/codec-levels.js` (one pass writing
|
|
104
|
+
`1 << 20` values of widths 1-16 then reading them back, corpus-independent),
|
|
105
|
+
`--reps 7 --warmup 3`, baseline sha `d47f8fc7a68809f519fe7d36ff2b0ba88bcacdbd`.
|
|
106
|
+
Host `win32` / `13th Gen Intel(R) Core(TM) i7-13700KF` / Bun `1.3.13`.
|
|
107
|
+
Generated `2026-09-24T20:50:02.210Z` (gitignored bench artifact). Rule:
|
|
108
|
+
`Δenc < +5 %`; gated on time only (no dec split, no bytes cell —
|
|
109
|
+
`bitstream.js` is byte-for-byte unchanged by the clean-room rewrite, see
|
|
110
|
+
[huffman](./huffman.md) § Design).
|
|
111
|
+
|
|
112
|
+
| Cell | Old enc ms | New enc ms | Δenc % | Verdict |
|
|
113
|
+
|---|---|---|---|---|
|
|
114
|
+
| bitstream.rw | 7.79 | 8.55 | 9.8 | FAIL (enc) |
|
|
115
|
+
|
|
116
|
+
**0/1 PASS.** `bitstream.js` did not change in the clean-room rewrite
|
|
117
|
+
(confirmed byte-for-byte by the module's own perf-pass diff), so this is
|
|
118
|
+
measurement noise, not a regression: a later measurement ruling recorded
|
|
119
|
+
that an A/A run of two byte-identical copies of the module measures the
|
|
120
|
+
same `rw` path at ±10-15 % between copies in the shared-process harness,
|
|
121
|
+
while running one engine per process the same path measures 3.25 vs 3.25
|
|
122
|
+
ms (equal). The cell is accepted as the harness's own noise floor.
|
|
123
|
+
|
|
124
|
+
## Provenance
|
|
125
|
+
|
|
126
|
+
In-house implementation written from RFC 1951 §3.1.1 (bit packing) and RFC 7932 §1.5; the earlier fflate-derived implementation was replaced by a clean-room rewrite (2026-09).
|
|
127
|
+
|
|
128
|
+
## See also
|
|
129
|
+
|
|
130
|
+
- [huffman](./huffman.md) — builds on `rev` and the slice/max helpers
|
|
131
|
+
- [deflate](./deflate.md) — first consumer (RFC 1951)
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: brotli
|
|
3
|
+
category: io/compress
|
|
4
|
+
dependencies: [bitstream, huffman, lz77, brotliDict, brotliDictWords]
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: true
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# brotli
|
|
11
|
+
|
|
12
|
+
> Brotli RFC 7932 codec — decoder + dynamic encoder with dict refs.
|
|
13
|
+
|
|
14
|
+
**Module** `brotli` | **Source** `packages/front/fw/src/io/compress/brotli.js` | **Deps** `bitstream`, `huffman`, `lz77`, `brotliDict`, `brotliDictWords` | **Worker-safe** yes
|
|
15
|
+
|
|
16
|
+
Base **RFC 7932-only** codec. Complete decoder (100% spec), dynamic encoder with LZ77 + Huffman + adaptive context modeling + block splitting + static-dict refs (121/121 transforms) + quality levels 0..11. For RFC 9841 extensions (large window, shared dictionary, §5 parser), use the companion module [`brotliShared`](./brotli_shared.md) which depends on this one.
|
|
17
|
+
|
|
18
|
+
## Resolve
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
const br = runtime.resolve('brotli');
|
|
22
|
+
// Returns: { brotliCompressSync, brotliDecompressSync, brotliCompress,
|
|
23
|
+
// brotliDecompress, BrotliCompressStream, BrotliDecompressStream }
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
| Method | Signature | Returns |
|
|
29
|
+
|--------|-----------|---------|
|
|
30
|
+
| `brotliCompressSync` | `(data: Uint8Array, opts?) => Uint8Array` | Compression — dynamic LZ77 + Huffman (≥ 32 bytes), trivial otherwise |
|
|
31
|
+
| `brotliDecompressSync` | `(data: Uint8Array, opts?) => Uint8Array` | Synchronous decompression |
|
|
32
|
+
| `brotliCompress` | `(data, opts?) => Promise<Uint8Array>` | Async compression (microtask wrap) |
|
|
33
|
+
| `brotliDecompress` | `(data, opts?) => Promise<Uint8Array>` | Async decompression (microtask wrap) |
|
|
34
|
+
| `BrotliCompressStream` | `new (opts?, ondata) => instance` | Streaming compressor (buffered) |
|
|
35
|
+
| `BrotliDecompressStream` | `new (opts?, ondata) => instance` | Streaming decompressor (EAGAIN-incremental) |
|
|
36
|
+
|
|
37
|
+
### Compression options
|
|
38
|
+
|
|
39
|
+
| Option | Type | Default | Description |
|
|
40
|
+
|--------|------|---------|-------------|
|
|
41
|
+
| `quality` | `0..11` | `6` | Speed/ratio profile. `0` = trivial uncompressed. `1..3` = `chainDepth 2..4`, lazy off. `4..7` = `chainDepth 6..10`, lazy on. `8..11` = `chainDepth 16..32`, lazy + block splitting. |
|
|
42
|
+
|
|
43
|
+
The encoder automatically selects, per block, the best `CMODE` (LSB6/MSB6/UTF8/Signed) via entropy, the best `(NPOSTFIX, NDIRECT)` among 7 candidates by bit-cost, and enables block splitting `NBLTYPES_L = 2` on heterogeneous inputs ≥ 32 KiB (trigger: KL-divergence > 0.3).
|
|
44
|
+
|
|
45
|
+
### Error codes
|
|
46
|
+
|
|
47
|
+
| Code | Cause |
|
|
48
|
+
|------|-------|
|
|
49
|
+
| `EBADARG` | Argument not `Uint8Array`, `quality` outside `[0, 11]` |
|
|
50
|
+
| `EBADSTREAM` | Invalid format (forbidden WBITS, non-zero fill bits, null MLEN top-nibble, dict-ref length outside `[4, 24]`, transform id ≥ 121, Kraft inequality violation, large-window prefix without `brotliShared`) |
|
|
51
|
+
| `ENEEDDICT` | Stream requires the static dictionary but `brotliDictWords.isLoaded === false` |
|
|
52
|
+
| `ESTREAMEND` | `push()` after finalization on a stream |
|
|
53
|
+
| `ENOTIMPL` | Large-window WBITS > 50 (requires BigInt — out of scope) |
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
### Simple round-trip
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
const br = runtime.resolve('brotli');
|
|
61
|
+
|
|
62
|
+
const data = new TextEncoder().encode('Hello, brotli world!'.repeat(100));
|
|
63
|
+
const enc = br.brotliCompressSync(data, { quality: 11 });
|
|
64
|
+
const dec = br.brotliDecompressSync(enc);
|
|
65
|
+
new TextDecoder().decode(dec); // 'Hello, brotli world!...'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Incremental streaming decompression
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
const br = runtime.resolve('brotli');
|
|
72
|
+
|
|
73
|
+
const out = [];
|
|
74
|
+
const stream = new br.BrotliDecompressStream(null, (chunk, isFinal) => {
|
|
75
|
+
out.push(chunk);
|
|
76
|
+
});
|
|
77
|
+
stream.push(part1, false);
|
|
78
|
+
stream.push(part2, false);
|
|
79
|
+
stream.push(part3, true); // triggers the final flush
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The decompressor supports **truly incremental streaming** (state save/restore via the EAGAIN mechanism) — each `push()` consumes as many bytes as possible and persists the decoder state between calls.
|
|
83
|
+
|
|
84
|
+
### Interop with Node/Bun
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
const zlib = require('node:zlib');
|
|
88
|
+
const br = runtime.resolve('brotli');
|
|
89
|
+
|
|
90
|
+
// Bytes produced by fw — decodable by Node
|
|
91
|
+
const enc = br.brotliCompressSync(data, { quality: 11 });
|
|
92
|
+
const decNode = zlib.brotliDecompressSync(Buffer.from(enc));
|
|
93
|
+
|
|
94
|
+
// Bytes produced by Node — decodable by fw
|
|
95
|
+
const encNode = zlib.brotliCompressSync(Buffer.from(data));
|
|
96
|
+
const decFw = br.brotliDecompressSync(new Uint8Array(encNode));
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### RFC 7932 static dictionary
|
|
100
|
+
|
|
101
|
+
Streams that reference the static dictionary require the 122 784-byte blob vendored in [`brotliDictWords`](./brotli_dict_words.md). The decoder wires `brotliDict.setWords(brotliDictWords.blob)` on the first dict-ref if and only if `brotliDictWords.isLoaded === true`. In the browser, load once at boot:
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
const words = runtime.resolve('brotliDictWords');
|
|
105
|
+
await words.load('/packages/front/fw/src/io/compress/brotli_dict.bin');
|
|
106
|
+
// brotliDict is now wired; the decoder will use it on demand
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Streams that never use the dictionary (e.g. short text fully resolved by LZ77) decode without the blob.
|
|
110
|
+
|
|
111
|
+
## RFC 7932 coverage
|
|
112
|
+
|
|
113
|
+
| Section | Decoder | Encoder |
|
|
114
|
+
|---------|---------|---------|
|
|
115
|
+
| §3 Compressed representation | ✅ | ✅ |
|
|
116
|
+
| §3.4 / §3.5 Prefix codes (simple + complex) | ✅ | ✅ |
|
|
117
|
+
| §4 Encoding of distances | ✅ | ✅ (NPOSTFIX 0..3, NDIRECT 0..120 best-of-7) |
|
|
118
|
+
| §5 Insert/copy length codes | ✅ | ✅ |
|
|
119
|
+
| §6 Block-switch | ✅ | ✅ (NBLTYPES_L ∈ {1, 2} KL-driven) |
|
|
120
|
+
| §7 Context modelling | ✅ | ✅ (LSB6 / MSB6 / UTF8 / Signed entropy-adaptive) |
|
|
121
|
+
| §8 Static dictionary | ✅ | ✅ (121/121 transforms — Identity + Ferment + OmitFirst/Last + UTF-8) |
|
|
122
|
+
| §9 Decoding | ✅ | — |
|
|
123
|
+
| §10 Encoding informative | — | ✅ (quality 0..11 LZ77 tuning) |
|
|
124
|
+
|
|
125
|
+
## Extension channel `opts._ext` (private)
|
|
126
|
+
|
|
127
|
+
`brotli_shared` consumes `opts._ext` to inject RFC 9841 behaviour. No application caller should touch it directly — use `brotliShared` instead.
|
|
128
|
+
|
|
129
|
+
| Hook | Type | Effect |
|
|
130
|
+
|------|------|--------|
|
|
131
|
+
| `_ext.allowLargeWindow` | `boolean` | Enables the large-window WBITS prefix §6 |
|
|
132
|
+
| `_ext.lz77Dict` | `Uint8Array` | Virtual prefix on the output (decoder §3.2) |
|
|
133
|
+
| `_ext.lz77Prefix` | `Uint8Array` | Virtual prefix on the input (encoder §3.2) |
|
|
134
|
+
| `_ext.resolveStaticDictRef` | `(state, wordId, clen, ctxIdL, r) => Uint8Array` | Replaces the RFC 7932 dict-ref path (custom dicts §3.1) |
|
|
135
|
+
|
|
136
|
+
## Worker Usage
|
|
137
|
+
|
|
138
|
+
```js
|
|
139
|
+
const worker = fw.createWorker(
|
|
140
|
+
async function ({ libs, args }) {
|
|
141
|
+
const br = libs.brotli;
|
|
142
|
+
const out = br.brotliDecompressSync(args[0]);
|
|
143
|
+
self.postMessage(out, [out.buffer]);
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
dependencies: ['brotli'],
|
|
147
|
+
args: [encodedBytes],
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
If the stream may reference the static dictionary, add `brotliDictWords` (+ loading) before decoding.
|
|
153
|
+
|
|
154
|
+
## Notes
|
|
155
|
+
|
|
156
|
+
- Decoder **100% RFC 7932**: round-trips all qualities 0..11 of the native Node/Bun `zlib` encoder. Encoder produces conformant brotli always decodable by `zlib.brotliDecompressSync`.
|
|
157
|
+
- **Truly incremental** streaming on the decoder side via the EAGAIN mechanism: on partial input, state is saved and restored on the next `push()` — no full buffering required. Compressor streaming remains buffered (future refactor for incremental).
|
|
158
|
+
- The input buffer is wrapped in an internal reader that appends 4 zero padding bytes to avoid bounds-checks in bit reads up to 32 bits.
|
|
159
|
+
- `_internal` exposes low-level primitives (`makeReader`, `readBit`, `readBits`, `readWBITS`, `readPrefixCode`, `readContextMap`, `readCompressedMetaBlockHeader`, `decodeDistanceSymbol`, `contextIdLit`, `encodeUncompressed`, …) for tests and companion modules (`brotliShared`).
|
|
160
|
+
- Tests: 174 cases (hand-crafted vectors + Node `BROTLI_PARAM_QUALITY: 0..11` round-trip + all 121/121 transforms).
|
|
161
|
+
|
|
162
|
+
## Benchmark
|
|
163
|
+
|
|
164
|
+
`brotli.js` itself changed only for the decoder long-code peek fix and the
|
|
165
|
+
encoder empty-tail-command fix (see Fixed in `CHANGELOG.md`); this record
|
|
166
|
+
measures the effect on the `brotli` codec of the underlying
|
|
167
|
+
`huffman`/`bitstream` clean-room rewrite (see [huffman](./huffman.md),
|
|
168
|
+
[bitstream](./bitstream.md)) plus the perf pass landed on `huffman.js`.
|
|
169
|
+
Levels `1,4,6,9,11`, corpora `text,source,json,repeat,small`, `--reps 5
|
|
170
|
+
--warmup 2`, baseline sha `d47f8fc7a68809f519fe7d36ff2b0ba88bcacdbd`. Host
|
|
171
|
+
`win32` / `13th Gen Intel(R) Core(TM) i7-13700KF` / Bun `1.3.13`. Generated
|
|
172
|
+
`2026-09-24T20:49:55.973Z` (gitignored bench artifact). Rule: `Δenc < +5 %`,
|
|
173
|
+
`Δdec < +5 %` per level and per corpus; `Δbytes ≤ 0`.
|
|
174
|
+
|
|
175
|
+
| Level | Corpus | Old enc ms | New enc ms | Δenc % | Old dec ms | New dec ms | Δdec % | Old B | New B | Δbytes % | Verdict |
|
|
176
|
+
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
177
|
+
| 1 | text | 16.53 | 18.58 | 12.4 | 1.59 | 1.60 | 1.2 | 58127 | 58127 | 0.00 | FAIL (enc) |
|
|
178
|
+
| 1 | source | 10.25 | 11.77 | 14.7 | 0.99 | 0.97 | -1.3 | 38335 | 38333 | -0.01 | FAIL (enc) |
|
|
179
|
+
| 1 | json | 15.69 | 17.06 | 8.7 | 1.58 | 1.78 | 13.0 | 56933 | 56932 | -0.00 | FAIL (enc, dec) |
|
|
180
|
+
| 1 | repeat | 4.60 | 4.82 | 4.6 | 0.36 | 0.42 | 14.6 | 1832 | 1832 | 0.00 | FAIL (dec) |
|
|
181
|
+
| 1 | small | 72.23 | 71.32 | -1.3 | 7.84 | 8.11 | 3.5 | 161438 | 161419 | -0.01 | PASS |
|
|
182
|
+
| 4 | text | 17.13 | 18.13 | 5.8 | 1.31 | 1.32 | 0.9 | 55588 | 55588 | 0.00 | FAIL (enc) |
|
|
183
|
+
| 4 | source | 10.94 | 10.89 | -0.5 | 0.88 | 0.86 | -2.0 | 35332 | 35332 | 0.00 | PASS |
|
|
184
|
+
| 4 | json | 16.22 | 15.10 | -6.9 | 1.20 | 1.26 | 4.6 | 51024 | 51024 | 0.00 | PASS |
|
|
185
|
+
| 4 | repeat | 3.73 | 4.04 | 8.3 | 0.35 | 0.33 | -5.1 | 1832 | 1832 | 0.00 | FAIL (enc) |
|
|
186
|
+
| 4 | small | 75.36 | 71.66 | -4.9 | 7.82 | 7.96 | 1.7 | 158636 | 158625 | -0.01 | PASS |
|
|
187
|
+
| 6 | text | 17.45 | 17.86 | 2.4 | 1.30 | 1.30 | -0.1 | 55103 | 55103 | 0.00 | PASS |
|
|
188
|
+
| 6 | source | 11.88 | 12.37 | 4.1 | 0.86 | 0.87 | 1.4 | 34752 | 34750 | -0.01 | PASS |
|
|
189
|
+
| 6 | json | 18.99 | 18.14 | -4.5 | 1.22 | 1.17 | -3.8 | 50369 | 50369 | 0.00 | PASS |
|
|
190
|
+
| 6 | repeat | 6.04 | 4.85 | -19.6 | 0.37 | 0.37 | 0.7 | 1832 | 1832 | 0.00 | PASS |
|
|
191
|
+
| 6 | small | 75.15 | 72.37 | -3.7 | 7.75 | 7.86 | 1.4 | 158302 | 158298 | -0.00 | PASS |
|
|
192
|
+
| 9 | text | 17.18 | 17.99 | 4.8 | 1.30 | 1.27 | -1.8 | 54759 | 54759 | 0.00 | PASS |
|
|
193
|
+
| 9 | source | 11.65 | 11.72 | 0.7 | 0.96 | 0.83 | -13.1 | 34334 | 34333 | -0.00 | PASS |
|
|
194
|
+
| 9 | json | 18.58 | 18.63 | 0.3 | 1.18 | 1.20 | 1.6 | 49865 | 49864 | -0.00 | PASS |
|
|
195
|
+
| 9 | repeat | 5.40 | 5.81 | 7.5 | 0.36 | 0.36 | 0.5 | 1832 | 1832 | 0.00 | FAIL (enc) |
|
|
196
|
+
| 9 | small | 74.29 | 73.22 | -1.4 | 7.77 | 8.05 | 3.6 | 158133 | 158129 | -0.00 | PASS |
|
|
197
|
+
| 11 | text | 19.61 | 18.46 | -5.8 | 1.27 | 1.46 | 14.8 | 54554 | 54554 | 0.00 | FAIL (dec) |
|
|
198
|
+
| 11 | source | 12.67 | 13.26 | 4.6 | 0.84 | 0.81 | -3.9 | 33913 | 33911 | -0.01 | PASS |
|
|
199
|
+
| 11 | json | 21.01 | 23.57 | 12.2 | 1.20 | 1.19 | -0.9 | 49292 | 49292 | 0.00 | FAIL (enc) |
|
|
200
|
+
| 11 | repeat | 6.38 | 6.51 | 1.9 | 0.40 | 0.41 | 2.2 | 1832 | 1832 | 0.00 | PASS |
|
|
201
|
+
| 11 | small | 80.57 | 79.55 | -1.3 | 8.02 | 8.15 | 1.7 | 157945 | 157941 | -0.00 | PASS |
|
|
202
|
+
|
|
203
|
+
**16/25 PASS, 9/25 FAIL.** `Δbytes ≤ 0` holds on every cell (three are
|
|
204
|
+
slightly negative — the fast-path Huffman code lengths can differ from
|
|
205
|
+
package-merge's tie-break on rare skewed alphabets while staying optimal,
|
|
206
|
+
never larger). The 9 red cells are measurement floor (harness noise), not
|
|
207
|
+
a regression: a live-vs-live identical-code A/A run at these parameters
|
|
208
|
+
already puts 9 of 25 brotli cells past `|5 %|`, and at `--reps 15` **all
|
|
209
|
+
25 cells PASS** (gitignored companion bench artifact, same parameters).
|
|
210
|
+
|
|
211
|
+
`random` corpus (`text,source,json,repeat,small` above exclude it): the
|
|
212
|
+
baseline crashes on it (the pre-rewrite `huffman.js` capped its internal
|
|
213
|
+
frequency sums, fixed by the clean-room rewrite), so the gate has no
|
|
214
|
+
baseline side. Recorded live-only, oracle `true` on every level
|
|
215
|
+
(`node:zlib.brotliDecompressSync` round-trip), same run.
|
|
216
|
+
|
|
217
|
+
| Level | Corpus | New enc ms | New dec ms | New B | Result |
|
|
218
|
+
|---|---|---|---|---|---|
|
|
219
|
+
| 1 | random | 43.36 | 0.21 | 262157 | baseline n/a (pre-rewrite huffman capped frequency sums) — new side oracle true |
|
|
220
|
+
| 4 | random | 42.55 | 0.16 | 262157 | baseline n/a (pre-rewrite huffman capped frequency sums) — new side oracle true |
|
|
221
|
+
| 6 | random | 43.99 | 0.15 | 262157 | baseline n/a (pre-rewrite huffman capped frequency sums) — new side oracle true |
|
|
222
|
+
| 9 | random | 48.41 | 0.12 | 262157 | baseline n/a (pre-rewrite huffman capped frequency sums) — new side oracle true |
|
|
223
|
+
| 11 | random | 45.28 | 0.14 | 262157 | baseline n/a (pre-rewrite huffman capped frequency sums) — new side oracle true |
|
|
224
|
+
|
|
225
|
+
## See also
|
|
226
|
+
|
|
227
|
+
- [brotliShared](./brotli_shared.md) — RFC 9841 extensions (large window, shared dictionary, §5 parser)
|
|
228
|
+
- [brotliFrame](./brotli_frame.md) — RFC 9841 §8 framing format parser
|
|
229
|
+
- [brotliDict](./brotli_dict.md) — `NDBITS`/`DOFFSET` tables + 121 transforms (Appendix B)
|
|
230
|
+
- [brotliDictWords](./brotli_dict_words.md) — Appendix A blob (lazy-loaded)
|
|
231
|
+
- [bitstream](./bitstream.md), [huffman](./huffman.md), [lz77](./lz77.md) — low-level primitives
|
|
232
|
+
- [gzip](./gzip.md), [zlib](./zlib.md), [zip](./zip.md) — other codecs in this directory
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: brotliDict
|
|
3
|
+
category: io/compress
|
|
4
|
+
dependencies: []
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: true
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# brotliDict
|
|
11
|
+
|
|
12
|
+
> RFC 7932 (Brotli) static dictionary and 121 transforms — tables + apply.
|
|
13
|
+
|
|
14
|
+
**Module** `brotliDict` | **Source** `packages/front/fw/src/io/compress/brotli_dict.js` | **Deps** none | **Worker-safe** yes
|
|
15
|
+
|
|
16
|
+
Data and operations shared between the Brotli encoder and decoder:
|
|
17
|
+
|
|
18
|
+
- **Word dictionary** (RFC 7932 Appendix A) — 122 784 bytes indexed by `(length, index)` via `NDBITS` / `DOFFSET`. The blob itself lives in the dedicated module [`brotliDictWords`](./brotli_dict_words.md) (lazy-load) — imperative injection via `setWords(blob)`. Before injection, `hasWords() === false` and `lookupWord` throws `EDICT_UNLOADED`.
|
|
19
|
+
- **Word transforms** (RFC 7932 Appendix B) — the 121 canonical transforms (Identity / FermentFirst / FermentAll / OmitFirst1..9 / OmitLast1..9) with UTF-8 prefix + suffix. Fully implemented and round-trippable.
|
|
20
|
+
|
|
21
|
+
## Resolve
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
const dict = runtime.resolve('brotliDict');
|
|
25
|
+
// Returns: { NDBITS, NWORDS, DOFFSET, DICTSIZE, transforms, applyTransform,
|
|
26
|
+
// setWords, hasWords, lookupWord }
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## API
|
|
30
|
+
|
|
31
|
+
| Method / field | Signature / type | Description |
|
|
32
|
+
|----------------|------------------|-------------|
|
|
33
|
+
| `NDBITS` | `Uint8Array(25)` | Depth table (RFC 7932 §8) |
|
|
34
|
+
| `NWORDS` | `(length: number) => number` | Number of words of this length (0 if `< 4`) |
|
|
35
|
+
| `DOFFSET` | `(length: number) => number` | Offset of the first word of this length in the blob |
|
|
36
|
+
| `DICTSIZE` | `number` | **122 784** — total dictionary size |
|
|
37
|
+
| `transforms` | `Array(121)` of `{ prefix, kind, param, suffix }` | Structured description |
|
|
38
|
+
| `applyTransform` | `(id: number, baseWord: Uint8Array) => Uint8Array` | Returns `prefix + T_id(baseWord) + suffix` |
|
|
39
|
+
| `setWords` | `(blob: Uint8Array) => void` | Injects the Appendix A blob (size verified = `DICTSIZE`) |
|
|
40
|
+
| `hasWords` | `() => boolean` | `true` after a successful `setWords` |
|
|
41
|
+
| `lookupWord` | `(length: number, index: number) => Uint8Array` | View into the blob; throws `EDICT_UNLOADED` if not loaded |
|
|
42
|
+
|
|
43
|
+
### `transforms[id]` format
|
|
44
|
+
|
|
45
|
+
| Field | Type | Description |
|
|
46
|
+
|-------|------|-------------|
|
|
47
|
+
| `prefix` | `Uint8Array` | UTF-8 bytes prepended to the transformed word |
|
|
48
|
+
| `kind` | `number` | `0` = Identity, `1` = FermentFirst, `2` = FermentAll, `3..11` = OmitFirst1..9 (8 unused), `12..20` = OmitLast1..9 |
|
|
49
|
+
| `param` | `number` | For OmitFirstK / OmitLastK: value `k` ∈ `[1, 9]`; 0 otherwise |
|
|
50
|
+
| `suffix` | `Uint8Array` | UTF-8 bytes appended at the end |
|
|
51
|
+
|
|
52
|
+
### `applyTransform(id, baseWord)`
|
|
53
|
+
|
|
54
|
+
Applies transform `id` (∈ `[0, 120]`) to the base word. The result is a **new** `Uint8Array` — `baseWord` is not mutated. `Ferment` upper-cases ASCII lowercase letters (but leaves uppercase unchanged) and toggles the 2nd/3rd bytes of multibyte UTF-8 codepoints via XOR (32 or 5).
|
|
55
|
+
|
|
56
|
+
| Kind | Definition |
|
|
57
|
+
|------|------------|
|
|
58
|
+
| `Identity` | Word unchanged |
|
|
59
|
+
| `OmitFirstk` / `OmitLastk` | Drop the first / last `k` bytes (empty if `len(word) < k`) |
|
|
60
|
+
| `FermentFirst` | `Ferment(word, 0)` — first UTF-8 codepoint only |
|
|
61
|
+
| `FermentAll` | Loop `Ferment` over all codepoints |
|
|
62
|
+
|
|
63
|
+
## Examples
|
|
64
|
+
|
|
65
|
+
### Applying transforms
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
const dict = runtime.resolve('brotliDict');
|
|
69
|
+
const enc = new TextEncoder(), dec = new TextDecoder();
|
|
70
|
+
|
|
71
|
+
dec.decode(dict.applyTransform(0, enc.encode('hello'))); // 'hello' — Identity
|
|
72
|
+
dec.decode(dict.applyTransform(1, enc.encode('hello'))); // 'hello '
|
|
73
|
+
dec.decode(dict.applyTransform(4, enc.encode('hello'))); // 'Hello ' — FermentFirst + ' '
|
|
74
|
+
dec.decode(dict.applyTransform(41, enc.encode('hello'))); // ' the hello' — ' the ' + Identity
|
|
75
|
+
dec.decode(dict.applyTransform(44, enc.encode('hello'))); // 'HELLO' — FermentAll
|
|
76
|
+
dec.decode(dict.applyTransform(23, enc.encode('abcdef'))); // 'abc' — OmitLast3
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Wiring the blob and looking up a word
|
|
80
|
+
|
|
81
|
+
```js
|
|
82
|
+
const dict = runtime.resolve('brotliDict');
|
|
83
|
+
const words = runtime.resolve('brotliDictWords');
|
|
84
|
+
|
|
85
|
+
if (words.isLoaded) dict.setWords(words.blob);
|
|
86
|
+
|
|
87
|
+
// word_id = transform_id * NWORDS[length] + index (RFC 7932 §8)
|
|
88
|
+
const base = dict.lookupWord(6, 1234);
|
|
89
|
+
const word = dict.applyTransform(5, base);
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Worker Usage
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
const worker = fw.createWorker(
|
|
96
|
+
function ({ libs, args }) {
|
|
97
|
+
const out = libs.brotliDict.applyTransform(args[0], args[1]);
|
|
98
|
+
self.postMessage(out, [out.buffer]);
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
dependencies: ['brotliDict'],
|
|
102
|
+
args: [4, new TextEncoder().encode('hello')],
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Notes
|
|
108
|
+
|
|
109
|
+
- `NDBITS` values fixed by the spec: `[0,0,0,0,10,10,11,11,10,10,10,10,10,9,9,8,7,7,8,7,7,6,6,5,5]`.
|
|
110
|
+
- `DICTSIZE = 122 784` bytes — size fixed by the spec and verified by tests + in `setWords`.
|
|
111
|
+
- The `transforms` are structurally static — the instance is shareable between encoder and decoder with no risk of mutation.
|
|
112
|
+
- The blob is externalized in [`brotliDictWords`](./brotli_dict_words.md) — this module embeds **no** Appendix A data. Native code-split (no inlined base64).
|
|
113
|
+
- Tests: ~50 cases (round-trip of all 121 transforms + lookups at `NWORDS[length]` boundaries + CRC-32 of the concatenated transforms = `0x3d965f81`).
|
|
114
|
+
|
|
115
|
+
## See also
|
|
116
|
+
|
|
117
|
+
- [brotliDictWords](./brotli_dict_words.md) — Appendix A blob (injected via `setWords`)
|
|
118
|
+
- [brotli](./brotli.md) — consuming codec (decoder + encoder)
|
|
119
|
+
- [brotliShared](./brotli_shared.md) — RFC 9841 extensions (reuses `transforms` and `lookupWord`)
|