API reference
Release 0.1.0-beta.1 · API 1.0-beta · Source-available license 1.0
This reference describes 0.1.0-beta.1, source revision f2dd521388a29b0aea0be920e19f71edcce0f164. It covers the committed release contract rather than the newer viewer used by this website’s IRCA demonstrations. Import from the versioned module or use the same names on the classic KiCadWebView global.
import { Viewer, EMBED_API_VERSION } from
'https://wayri.github.io/assets/lib/kicad-webview/releases/0.1.0-beta.1/kivi-viewer.js';
console.log(EMBED_API_VERSION); // '1.0-beta'
No package manager is required. Types in this reference use TypeScript notation to explain the JavaScript inputs; they do not require a TypeScript build.
Public exports
Every name exported by the release’s main entry is listed here. Types and interfaces describe data, not additional runtime exports.
The separate standalone-html.mjs module exports createStandaloneHTML. It is not a member of the main KiCadWebView global.
Embed API version
const EMBED_API_VERSION: '1.0-beta'
A string identifying the beta embedding contract. Reading it has no side effects and does not test browser capabilities, source compatibility or solver validity. Pin the complete release directory when integrating; this identifier alone does not freeze every future beta implementation.
Shared conventions
- Targets are a CSS selector or a browser
HTMLElement. Give the mount a real height. A container can have one viewer owner; dispose it before reusing the container. - Themes are
'light' | 'dark'. Native drawing views are'pcb' | 'schematic' | '3d' | 'manufacturing', subject to the loaded source kind. - Saved drawing coordinates are millimetres. A 2D camera’s zoom is CSS pixels per millimetre. 3D camera vectors are board-centred millimetres.
- Attach event listeners before loading. Events are native
CustomEvents; read theirdetailrather than DOM attributes. - A successful asynchronous source operation returns
true. Superseded or disposed work returnsfalse; current failures reject and emit an error event. Check the return value as well as catching rejection. - Use
AbortSignalwhere offered. Cancelling work does not undo successful earlier steps in a multi-step presentation or restore operation. - These APIs display saved designs and supplied results. They do not edit a native design, run native KiCad ERC/DRC, execute firmware or run an engineering solver.
Release boundaries
This release does not expose the later modelsready event, setDemoInteraction method, or display anchor faceSelection / minFaceAreaMm2 options used by newer site code. Use only the methods documented for your pinned copy.
The downloadable release uses source-available license 1.0. Commercial use, including internal business use and commercial embeds, requires explicit prior written permission. The public assets do not make the source repository public.