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
signal- Create reactive stateeffect- Run side effectscomputed- Derived valueswatch- Watch with callbacksbatch- Batch updatesuntrack- Read without trackingtoRaw- Get raw objectisReactive- Check if reactiveeffectScope- Group effects
Components
component- Define componentFragment- Render without wrapperlazy- Lazy load componentSuspense- Async boundaryPortal- Render to different DOM location
Lifecycle
onMounted- After mountonUnmounted- Before unmountonCreated- After creationonUpdated- After update
Dependency Injection
provide- Provide value to descendantsinject- Inject from ancestorscreateInjectable- Create injectabledefineProvide- Provide + create
App & Plugins
Advanced
defineFactory- Injectable factorycreateTopic- Pub/sub messagingtoSubscriber- Read-only subscriber
Types
Define.Prop- Prop type helperDefine.Event- Event type helperDefine.Slot- Slot type helperDefine.Model- Two-way binding helperDefine.Expose- Exposed API helperComponentRef- Component ref typeExposed- Extract exposed type
Import
All APIs are available from the main sigx package:
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.
// 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>;
});