18 lines
724 B
Markdown
18 lines
724 B
Markdown
# @wrnexus/native
|
|
|
|
Cross-platform capabilities for browsers, Capacitor WebViews, and compiled native apps.
|
|
|
|
```ts
|
|
import { native } from "@wrnexus/native";
|
|
|
|
if (native.supports("share")) await native.run("share", { title: "WrNexus", url: location.href });
|
|
```
|
|
|
|
Built-ins include `camera`, `clipboard.write`, `share`, `geolocation`, `network`,
|
|
`haptics`, storage, filesystem, notifications, and device information. Browser
|
|
capabilities use Web APIs; mobile capabilities use installed Capacitor plugins.
|
|
|
|
`platform()` returns `server` during SSR, `browser` on the web, and the Capacitor
|
|
platform in a native WebView. Unsupported operations reject with
|
|
`NativeUnavailableError`; use `supports()` before presenting optional UI.
|