@qontinui/shared-types
v2.3.1
Published
Shared TypeScript types for the Qontinui ecosystem
Downloads
11,105
Readme
@qontinui/shared-types
Shared TypeScript types for the Qontinui ecosystem.
Overview
This package provides TypeScript type definitions shared across:
- qontinui-runner - Tauri desktop app
- qontinui-web - Next.js web app
Installation
# From npm
npm install @qontinui/shared-typesReleasing
The package is published to npm by a tag-triggered GitHub Actions workflow
(.github/workflows/publish.yml). Tags use the ts-v* prefix so the
workflow only fires for TypeScript-package releases (this repo also hosts
the Rust qontinui-types crate, which may eventually have its own tag
scheme).
# 1. Bump the version in ts/package.json
# 2. Commit the version bump
# 3. Tag and push
git tag ts-v0.2.2
git push --tagsThe workflow runs npm ci && npm run build && npm publish --access public
from the ts/ directory using the org-level NPM_TOKEN secret.
Local development (hot-reload via npm link)
To work on @qontinui/shared-types and have a consumer pick up changes
without publishing, use npm link:
# In this package
cd qontinui-schemas/ts
npm install
npm run build
npm link
# In the consuming project (e.g. qontinui-runner, qontinui-web/frontend)
npm link @qontinui/shared-typesTo unlink when finished:
# In the consumer
npm unlink --no-save @qontinui/shared-types
npm install
# In this package (optional, removes the global symlink)
cd qontinui-schemas/ts
npm unlinkUsage
import {
RenderLogEntry,
ComponentRenderLogEntry,
DomSnapshotRenderLogEntry,
isComponentRenderLog,
isDomSnapshotRenderLog,
} from "@qontinui/shared-types";
// Type guard usage
function processRenderLog(entry: RenderLogEntry) {
if (isComponentRenderLog(entry)) {
console.log("Component:", entry.component);
console.log("Data:", entry.data);
} else if (isDomSnapshotRenderLog(entry)) {
console.log("Page:", entry.page_url);
console.log("Elements:", entry.element_count);
}
}Types
Render Logging
Types for the render logging system used for AI-assisted debugging:
ComponentRenderLogEntry- Runner's component-level loggingDomSnapshotRenderLogEntry- Web's full DOM snapshot loggingRenderLogEntry- Union type for bothCreateRenderLogRequest- API request typeRenderLogResponse- API response typeRenderLogStats- Statistics about render logs
Naming Convention
Field names use camelCase. All public Rust structs are annotated with
#[serde(rename_all = "camelCase")] and #[serde(deny_unknown_fields)], so
the generated TypeScript interfaces are closed (no [k: string]: unknown
fallback) and expect camelCase keys at construction time.
See CONTRACT.md for the full wire-format contract, the reasoning, and the migration guide for consumer code.
Development
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npm run watchRelated
- qontinui-schemas - Python schemas (same repo)
- qontinui-runner - Desktop app
- qontinui-web - Web app