//// Browser FFI: read and clear the URL query (to surface an OAuth `?error=`). @external(javascript, "./ffi.ts", "currentSearch") pub fn current_search() -> String @external(javascript, "./ffi.ts", "clearQuery") pub fn clear_query() -> Nil @external(javascript, "./ffi.ts", "applyTheme") pub fn apply_theme(theme: String) -> Nil @external(javascript, "./ffi.ts", "navigate") pub fn navigate(url: String) -> Nil /// The page origin (e.g. `https://crate.example`), used to absolutise a /// relative BFF path before the async xrpc transport builds its request. @external(javascript, "./ffi.ts", "origin") pub fn origin() -> String /// Today's UTC calendar date as "YYYY-MM-DD", matching the day slice off /// entry `updatedAt` timestamps - so the feed's relative-day labels compare /// like with like. @external(javascript, "./ffi.ts", "today") pub fn today() -> String @external(javascript, "./ffi.ts", "debounce") pub fn debounce(channel: String, ms: Int, callback: fn() -> Nil) -> Nil @external(javascript, "./ffi.ts", "onOutsideClick") pub fn on_outside_click(id: String, callback: fn() -> Nil) -> Nil @external(javascript, "./ffi.ts", "offOutsideClick") pub fn off_outside_click(id: String) -> Nil @external(javascript, "./ffi.ts", "uploadCover") pub fn upload_cover(url: String, callback: fn(Bool) -> Nil) -> Nil @external(javascript, "./ffi.ts", "startScanner") pub fn start_scanner( on_detect: fn(String) -> Nil, on_unsupported: fn(String) -> Nil, ) -> Nil @external(javascript, "./ffi.ts", "stopScanner") pub fn stop_scanner() -> Nil /// Copy an absolute URL built from `path` (joined against the current /// origin) to the clipboard; `callback` carries whether the write worked. @external(javascript, "./ffi.ts", "copyToClipboard") pub fn copy_to_clipboard(path: String, callback: fn(Bool) -> Nil) -> Nil