web-api-cat 0.4.0

Bindings between boa-cat (JS engine) and the DOM (html-cat tree) plus fetch (net-cat). v0.4.0 installs `document.cookie` as a boa-cat 0.3 accessor pair: the getter reads a host-supplied projection, the setter records each `document.cookie = ...` RHS string (with attributes intact) into a hidden write log AND updates the visible projection so subsequent reads see the just-written cookie. Hosts call `set_document_cookie` to seed the projection pre-eval and `read_cookie_writes(&heap)` to recover each per-write Set-Cookie-style string post-eval -- preserving `Max-Age` / `Path` / `Domain` / `Secure` / `HttpOnly` semantics across multiple writes in one script. No mut, no Rc/Arc, no interior mutability, no panics. Seventh sub-crate of a Servo-replacement webview runtime targeting Tauri.
//! Bridge between boa-cat (JS engine) and the DOM + fetch.
//!
//! # Example
//!
//! ```
//! # fn main() -> Result<(), web_api_cat::Error> {
//! use boa_cat::{evaluate_program_with, env::Env, fuel::Fuel, heap::Heap};
//! use ecma_lex_cat::lex;
//! use ecma_parse_cat::parse_script;
//!
//! let html = html_cat::parse("<html><body><p id='g'>hi</p></body></html>")?;
//! let (env, heap) = web_api_cat::install(Env::empty(), Heap::new(), &html);
//! let tokens = lex("document.getElementById('g').textContent")
//!     .map_err(boa_cat::Error::from)?;
//! let program = parse_script(&tokens).map_err(boa_cat::Error::from)?;
//! let (value, _heap) = evaluate_program_with(&program, env, heap, Fuel::new(100_000))?;
//! assert_eq!(format!("{value}"), "\"hi\"");
//! # Ok(())
//! # }
//! ```

#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![allow(clippy::similar_names)]

pub mod cookie;
pub mod document;
pub mod element;
pub mod error;
pub mod extract;
pub mod fetch;
pub mod install;

pub use cookie::{
    get_document_cookie, install_cookie_accessor, read_cookie_writes, set_document_cookie,
};
pub use error::Error;
pub use extract::extract_document;
pub use install::install;