1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use wasm_bindgen::prelude::*;

mod id;
mod namespace;
mod state;
mod storage;
mod transaction;

pub use id::*;
pub use namespace::*;
pub use state::*;
pub use storage::*;
pub use transaction::*;

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen(extends=js_sys::Object)]
    pub type DurableObject;

    #[wasm_bindgen(method, js_name=fetch)]
    pub fn fetch_with_request(this: &DurableObject, req: &web_sys::Request) -> js_sys::Promise;

    #[wasm_bindgen(method, js_name=fetch)]
    pub fn fetch_with_str(this: &DurableObject, url: &str) -> js_sys::Promise;
}