API Reference#

Complete reference for all SignalX (sigx) exports. SignalX re-exports everything from:

  • @sigx/reactivity - Reactive primitives
  • @sigx/runtime-core - Component system
  • @sigx/runtime-dom - DOM rendering

Quick Navigation#

Reactivity#

Components#

Lifecycle#

Dependency Injection#

App & Plugins#

Advanced#

Types#

Import#

All APIs are available from the main sigx package:

TSX
import { 
    // Reactivity
    signal, effect, computed, watch,
    batch, untrack, toRaw, isReactive, effectScope,
    
    // Components
    component, Fragment, lazy, Suspense, Portal,
    
    // Lifecycle
    onMounted, onUnmounted, onCreated, onUpdated,
    
    // DI
    provide, inject, createInjectable, defineProvide,
    
    // App
    defineApp,
    
    // Types
    type Define, ComponentRef, Exposed,
    
    // Advanced
    defineFactory, createTopic, toSubscriber,
    InstanceLifetimes
} from 'sigx';

TypeScript#

SignalX is written in TypeScript and provides full type inference. All component props, events, slots, and exposed APIs are fully typed.

TSX
// Full type safety
type MyProps = 
    & Define.Prop<'name', string, true>
    & Define.Prop<'count', number>
    & Define.Event<'change', number>
    & Define.Slot<'header'>
    & Define.Expose<{ reset: () => void }>;

const MyComponent = component<MyProps>(({ props, emit, slots, expose }) => {
    // props.name is string (required)
    // props.count is number | undefined (optional)
    // emit('change', 5) is type-checked
    // slots.header is typed correctly
    
    expose({ reset: () => {} }); // Type-checked
    
    return () => <div>{props.name}</div>;
});