58 lines
5.7 KiB
Plaintext
58 lines
5.7 KiB
Plaintext
page wrnexusnative {
|
|
seo {
|
|
title = "@wrnexus/native"
|
|
description = "Cross-platform browser and Capacitor capability registry."
|
|
}
|
|
|
|
view {
|
|
<div class="docs-shell">
|
|
<a class="skip-link" href="#main">Skip to content</a>
|
|
<header class="topbar">
|
|
<a class="brand" href="/"><span>W</span> WRNexusJS</a>
|
|
<nav aria-label="Primary"><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
|
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.2.19</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
|
</header>
|
|
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
|
<main class="page package-page">
|
|
<aside class="sidebar"><a href="/packages">← All packages</a><span class="category">Native</span><h2>@wrnexus/native</h2><p>Cross-platform browser and Capacitor capability registry.</p><span class="status status-beta">Private preview · 0.2.19</span><nav><a href="#access">Access</a><a href="#guide">Guide</a><a href="#api">Complete API</a></nav></aside>
|
|
<article id="main" class="documentation"><section class="doc-intro"><span class="eyebrow">Native · Preview</span><h1>@wrnexus/native</h1><p>Cross-platform browser and Capacitor capability registry.</p><section id="access" class="access-callout"><h2>Private registry access required</h2><p>This package is not available from the public npm registry. After WorkRoot approves access and supplies private registry instructions, install the release-aligned package:</p><pre><code>bun add @wrnexus/native@0.2.19</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide" class="prose"><p>Cross-platform capabilities for browsers, Capacitor WebViews, and compiled native apps.</p>
|
|
<pre data-language="ts"><code>import { native } from "@wrnexus/native";
|
|
|
|
if (native.supports("share")) await native.run("share", { title: "WRNexusJS", url: location.href });</code></pre>
|
|
<p>Built-ins include <code>camera</code>, <code>clipboard.write</code>, <code>share</code>, <code>geolocation</code>, <code>network</code>, <code>haptics</code>, storage, filesystem, notifications, and device information. Browser capabilities use Web APIs; mobile capabilities use installed Capacitor plugins.</p>
|
|
<p><code>platform()</code> returns <code>server</code> during SSR, <code>browser</code> on the web, and the Capacitor platform in a native WebView. Unsupported operations reject with <code>NativeUnavailableError</code>; use <code>supports()</code> before presenting optional UI.</p></section><section id="api" class="prose api"><h2>Complete TypeScript API</h2><p>This declaration comes from the exact installed package and lists its exported functions, classes, interfaces, and types.</p><pre data-language="typescript"><code>import { N as NativePlatform, a as NativeCapability, b as NativeRunOptions, c as NativeTarget } from './types-CDShWg0i.js';
|
|
export { d as NativeAdapter, e as NativeBrowserRuntime } from './types-CDShWg0i.js';
|
|
export { browserCapabilities } from './browser.js';
|
|
export { mobileCapabilities } from './mobile.js';
|
|
|
|
declare class NativeUnavailableError extends Error {
|
|
constructor(message: string);
|
|
}
|
|
declare function isMobile(): boolean;
|
|
declare function platform(): NativePlatform;
|
|
declare function register<TOptions = unknown, TResult = unknown>(name: string, capability: NativeCapability<TOptions, TResult>): () => void;
|
|
declare function registered(): string[];
|
|
declare function supports(name: string, target?: NativeTarget): boolean;
|
|
declare function run<TResult = unknown>(name: string, options?: unknown, runOptions?: NativeRunOptions): Promise<TResult>;
|
|
declare function clearRegistry(): void;
|
|
|
|
declare const native: {
|
|
isMobile: typeof isMobile;
|
|
platform: typeof platform;
|
|
register: typeof register;
|
|
registered: typeof registered;
|
|
run: typeof run;
|
|
supports: typeof supports;
|
|
};
|
|
|
|
export { NativeCapability, NativePlatform, NativeRunOptions, NativeTarget, NativeUnavailableError, clearRegistry, isMobile, native, platform, register, registered, run, supports };
|
|
</code></pre></section><section id="examples" class="prose examples"><h2>Examples</h2><p>Examples are taken from this package's installed documentation and must be evaluated with its requirements and stability notes.</p><div class="example-grid"><article class="example-card"><h3>Example 1</h3><pre data-language="ts"><code>import { native } from "@wrnexus/native";
|
|
|
|
if (native.supports("share")) await native.run("share", { title: "WRNexusJS", url: location.href });</code></pre></article></div></section></article>
|
|
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
|
</main>
|
|
<footer>WRNexusJS 0.2.19 · Private Developer Preview · Bun-native · Documentation generated from installed package APIs.</footer>
|
|
</div>
|
|
}
|
|
}
|