W WRNexusJS
Tooling · Package reference

@wrnexus/typecheck

WRN-aware TypeScript diagnostics and virtual documents.

v0.8.17Private registryTooling

Install the package

After WorkRoot approves private registry access, install the package:

bun add @wrnexus/typecheck@0.8.17

Request preview access. Never put registry tokens in source control.

Static type checking for .wrn declarations, props, state, outputs, functions, stores, and generated virtual TypeScript files.

The package is compiler tooling rather than a browser UI package, so its public kit consists of programmatic typecheck helpers and diagnostics.

View attribute {t:key} segments are translation markers, not TypeScript expressions. Ordinary expressions in the same attribute remain typechecked. Inline event bindings accept statement lists, with event.currentTarget typed as the bound HTML/SVG element. Nullable DOM queries still require normal guards.

Complete TypeScript API

Generated from the exact installed package declarations.

import { PageAst } from '@wrnexus/syntax';
export { componentContract, storeContract } from './contracts.js';
export { findAppRoot, loadApplicationTypes } from './project.js';

interface WrnTypeDiagnostic {
    code: string;
    category: "error" | "warning" | "info";
    message: string;
    file: string;
    line: number;
    column: number;
    length: number;
    expected?: string;
    received?: string;
    hint?: string;
    related?: {
        file: string;
        line: number;
        column: number;
        message: string;
    };
}
interface TypecheckOptions {
    filePath?: string;
    appRoot?: string;
    strict?: boolean;
    noImplicitAny?: boolean;
    strictNullChecks?: boolean;
    checkRuntimeBoundaries?: boolean;
}
interface SourceMapping {
    virtualStartLine: number;
    virtualEndLine: number;
    sourceStartLine: number;
    sourceStartColumn: number;
}
interface VirtualTypeScriptModule {
    ast: PageAst;
    fileName: string;
    code: string;
    mappings: SourceMapping[];
}
declare function virtualTypeScriptModule(source: string, filePath?: string, appRoot?: string): VirtualTypeScriptModule;
declare function checkWrnSource(source: string, options?: TypecheckOptions): WrnTypeDiagnostic[];
declare function checkWrnFile(filePath: string, options?: Omit<TypecheckOptions, "filePath">): WrnTypeDiagnostic[];

export { type TypecheckOptions, type VirtualTypeScriptModule, type WrnTypeDiagnostic, checkWrnFile, checkWrnSource, virtualTypeScriptModule };

Examples

Copy-ready examples from the installed package documentation.

Install @wrnexus/typecheck

bun add @wrnexus/typecheck

Import @wrnexus/typecheck

import * as typecheck from "@wrnexus/typecheck";