Skip to documentation
KiCad WebViewDocumentation · 0.1.0-beta.1
Download release ↓

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.

Export Purpose and detailed contract
Viewer, KiCadViewer The same compact viewer class. Construction, loading, inspection, cameras, layers, analysis and events.
registerKiCadViewer Register the optional HTML custom element. Signature and attributes.
ProjectViewer, AdvancedKiCadViewer The same two-pane project wrapper. Methods, options and events.
EMBED_API_VERSION Contract identifier.
ViewerCarousel Explicit, cancellable drawing presentations.
linkViewers Saved-identity selection linking.
captureViewState Snapshot native views and exact source hashes.
restoreViewState Restore validated, source-matched views.
validateViewState Validate and copy a view-state object.
createViewLink Encode state in an HTTP(S) URL fragment.
parseViewLink Read an optional view-state fragment.
DemoController Scripted LEDs, displays, buttons, knobs and scoped keys.
ProjectTree Interactive independent schematic hierarchy.
buildProjectHierarchy Build hierarchy data from saved source strings.
loadProjectHierarchy Load a bounded project hierarchy.
hierarchyToSVG Export a script-free hierarchy diagram.
AltiumViewer Opt-in online provider adapter, not native parsing.
readZip Validated in-memory archive reader.
parseManufacturing Gerber/Excellon parser dispatch.
parseAnalysis Validate imported scalar fields.
analysisSourceHash Hash the exact saved PCB text.

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

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.