Skip to content

@moqtap/types

TypeScript interfaces mirroring moqtap Rust structs.

npm

@moqtap/types is an npm package containing TypeScript interfaces auto-generated from moqtap’s Rust structs via ts-rs. It defines the IPC contract between the Tauri backend and the Vue frontend.

Terminal window
npm install @moqtap/types
import type { TraceEvent, ControlMessage, QuicStats } from '@moqtap/types';
function handleEvent(event: TraceEvent) {
console.log(`${event.direction} ${event.message.type}`);
}
  • TraceEvent — a timestamped protocol event
  • ControlMessage — union of all MoQT control message types
  • QuicStats — QUIC transport statistics
  • SessionState — connection lifecycle states

Pinned to moqtap-client’s version. When moqtap-client releases 0.2.0, the same CI run publishes @moqtap/[email protected] to npm.

Rust structs use #[derive(TS)] from the ts-rs crate. A CI step regenerates TypeScript files into packages/types/ in the moqtap monorepo. The generated files are checked into version control.