@ottili/foundation-platform
v1.0.13
Published
Distribution adapters: web, PWA, Tauri and Electron behind one contract (SoT §8.8, §29).
Readme
@ottili/foundation-platform
Distribution adapters: web, PWA, Tauri and Electron behind one contract (SoT §8.8, §29).
Install
npm install @ottili/foundation-platformThis package is part of the Ottili Foundation Framework. See docs/OTTILI_FOUNDATION_FRAMEWORK_SOURCE_OF_TRUTH.md for the canonical spec.
Public API
createPlatformAdapterreturns the right adapter for web, PWA, Tauri, or Electron.detectPlatformTargetanddescribeCapabilitiesinspect the current target and what it can do.createWebAdapter,createPwaAdapter,createDesktopAdapter,createTauriAdapter, andcreateElectronAdapterfor explicit construction.buildServiceWorkerSourceandbuildWebAppManifestfor PWA assets.
Usage
import { createPlatformAdapter, describeCapabilities } from "@ottili/foundation-platform";
const adapter = createPlatformAdapter({ appVersion: "1.0.0" });
const caps = describeCapabilities(adapter);
if (caps.nativeNotifications) {
adapter.notifications.show({ title: "Hello" });
}