docs: update portal for WRNexusJS 0.8.0

This commit is contained in:
2026-08-02 23:57:41 +05:30
parent 9366895f78
commit 8d5d4b8f12
183 changed files with 14433 additions and 2492 deletions
+48 -4
View File
@@ -10,11 +10,11 @@ page wrnexusmobile {
<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="https://component.wrnexusjs.dev/">Components</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.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</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="https://component.wrnexusjs.dev/">Components</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="portal-main docs-layout">
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/mobile</span></nav><section class="doc-intro"><span class="eyebrow">Native · Package reference</span><h1>@wrnexus/mobile</h1><p>SSR-safe compatibility access to Capacitor plugins.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Native</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/mobile@0.7.0</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"><blockquote>SSR-safe access to Capacitor plugins from WRNexusJS browser code.</blockquote>
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/mobile</span></nav><section class="doc-intro"><span class="eyebrow">Native · Package reference</span><h1>@wrnexus/mobile</h1><p>SSR-safe compatibility access to Capacitor plugins.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Native</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/mobile@0.8.0</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"><blockquote>SSR-safe access to Capacitor plugins from WRNexusJS browser code.</blockquote>
<h3 id="overview">Overview</h3>
<p><code>@wrnexus/mobile</code> keeps optional native imports out of server rendering while giving browser-owned modules one consistent registry for Capacitor plugins. During SSR, <code>mobile.isNative()</code> is <code>false</code> and <code>mobile.platform()</code> is <code>&quot;web&quot;</code>.</p>
<p>Install a plugin through the WRNexusJS CLI so the web and native projects stay aligned:</p>
@@ -61,6 +61,14 @@ const status = network ? await network.getStatus() : &#123; connected: true, con
<li><code>isNative()</code> and <code>platform()</code> report the current Capacitor environment.</li>
</ul>
<p>Unavailable required plugins throw <code>MobileUnavailableError</code> with an actionable message.</p>
<p>The package also provides portable application-facing primitives:</p>
<ul>
<li><code>listenDeepLinks</code> normalizes initial and live links with an allowed-scheme list.</li>
<li><code>PushNotifications</code> performs permission gating and validates registrations.</li>
<li><code>SecureStorage</code> namespaces and validates keys over an application-supplied encrypted</li>
<p>Keychain/Keystore adapter; it does not mislabel browser <code>localStorage</code> as secure.</p>
<li><code>OfflineQueue</code> persists bounded sync batches through a pluggable durable store.</li>
</ul>
<h3 id="requirements-notes">Requirements / Notes</h3>
<ul>
<li>Capacitor plugin imports must remain in browser-owned modules.</li>
@@ -74,6 +82,42 @@ interface DeepLink &#123;
query: URLSearchParams;
&#125;
declare function parseDeepLink(value: string, schemes?: string[]): DeepLink | null;
interface DeepLinkSource &#123;
current?(): Promise&lt;string | undefined&gt;;
subscribe(listener: (url: string) =&gt; void): void | (() =&gt; void);
&#125;
/** Normalize initial and live native links and ignore malformed/unapproved schemes. */
declare function listenDeepLinks(source: DeepLinkSource, listener: (link: DeepLink) =&gt; void, schemes?: string[]): () =&gt; void;
interface PushRegistration &#123;
token: string;
platform?: string;
&#125;
interface PushAdapter &#123;
permission(): Promise&lt;&quot;granted&quot; | &quot;denied&quot; | &quot;prompt&quot; | &quot;unavailable&quot;&gt;;
requestPermission?(): Promise&lt;&quot;granted&quot; | &quot;denied&quot;&gt;;
register(): Promise&lt;PushRegistration&gt;;
subscribe?(listener: (notification: unknown) =&gt; void): () =&gt; void;
&#125;
declare class PushNotifications &#123;
private readonly adapter;
constructor(adapter: PushAdapter);
register(): Promise&lt;PushRegistration&gt;;
subscribe(listener: (notification: unknown) =&gt; void): () =&gt; void;
&#125;
interface SecureStorageAdapter &#123;
get(key: string): Promise&lt;string | null&gt;;
set(key: string, value: string): Promise&lt;void&gt;;
remove(key: string): Promise&lt;void&gt;;
&#125;
declare class SecureStorage &#123;
#private;
private readonly adapter;
private readonly namespace;
constructor(adapter: SecureStorageAdapter, namespace?: string);
get(key: string): Promise&lt;string | null&gt;;
set(key: string, value: string): Promise&lt;void&gt;;
remove(key: string): Promise&lt;void&gt;;
&#125;
interface OfflineTask&lt;T = unknown&gt; &#123;
id: string;
type: string;
@@ -141,7 +185,7 @@ declare const mobile: &#123;
whenNative: typeof whenNative;
&#125;;
export &#123; type CapacitorBridge, type DeepLink, type MobileEnvironment, type MobilePlatform, MobileUnavailableError, OfflineQueue, type OfflineTask, type OfflineTaskStore, invoke, isNative, memoryOfflineTaskStore, mobile, mobileEnvironment, parseDeepLink, platform, plugin, registerPlugin, requirePlugin, whenNative &#125;;
export &#123; type CapacitorBridge, type DeepLink, type DeepLinkSource, type MobileEnvironment, type MobilePlatform, MobileUnavailableError, OfflineQueue, type OfflineTask, type OfflineTaskStore, type PushAdapter, PushNotifications, type PushRegistration, SecureStorage, type SecureStorageAdapter, invoke, isNative, listenDeepLinks, memoryOfflineTaskStore, mobile, mobileEnvironment, parseDeepLink, platform, plugin, registerPlugin, requirePlugin, whenNative &#125;;
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Register and invoke a Capacitor plugin</h3><pre data-language="ts"><code>import &#123; Camera, CameraResultType &#125; from &quot;@capacitor/camera&quot;;
import &#123; mobile &#125; from &quot;@wrnexus/mobile&quot;;
@@ -169,7 +213,7 @@ const network = mobile.plugin&lt;NetworkPlugin&gt;(&quot;Network&quot;);
const status = network ? await network.getStatus() : &#123; connected: true, connectionType: &quot;unknown&quot; &#125;;</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-3" href="#overview">Overview</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#register-and-invoke-a-capacitor-plugin">Register and invoke a Capacitor plugin</a><a class="toc-level-4" href="#provide-a-browser-fallback">Provide a browser fallback</a><a class="toc-level-4" href="#read-an-optional-plugin-without-throwing">Read an optional plugin without throwing</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
</main>
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
<BackToTop />
</div>
}