/** * Signal - Reactive primitive (callable) * Can be called as function: signal() = read, signal(value) = write */ export interface Signal { (): T; (value: T): T; value: T; readonly peek: T; update(fn: (value: T) => T): void; subscribe(fn: () => void): () => void; __gyos_signal__: true; __gyos_debug_id__?: number; __gyos_debug_label__?: string; } export interface SignalOptions { debugLabel?: string; equals?: (a: T, b: T) => boolean; } /** * Computed - Derived reactive value (callable, read-only) * Can be called as function: computed() = read value */ export interface Computed { (): T; readonly value: T; readonly peek: T; subscribe(fn: () => void): () => void; __gyos_computed__: true; } /** * Scope definition */ export interface Scope { [key: string]: any; onMount?(): void | Promise; onUnmount?(): void; onUpdate?(): void; } export type ScopeFactory = (context: ComponentContext) => Scope; export type ScopeDefinition = Scope | ScopeFactory; /** * Component context */ export interface ComponentContext { inject(key: string): T; provide(key: string, value: any): void; $refs: Record; $emit(event: string, ...args: any[]): void; $on(event: string, handler: Function): () => void; $watch(key: string, handler: WatchCallback, options?: WatchOptions): () => void; $effect(fn: () => void | (() => void)): () => void; } /** * Watch callback */ export type WatchCallback = (newValue: T, oldValue: T) => void; /** * Watch options */ export interface WatchOptions { immediate?: boolean; debounce?: number; deep?: boolean; } /** * Directive definition */ export interface Directive { mounted?(el: HTMLElement, binding: DirectiveBinding, scope?: Scope): void; updated?(el: HTMLElement, binding: DirectiveBinding, scope?: Scope): void; unmounted?(el: HTMLElement): void; } /** * Directive binding */ export interface DirectiveBinding { value: any; oldValue: any; arg?: string[]; } export interface RevealOptions { className?: string; once?: boolean; rootMargin?: string; target?: 'self' | 'parent'; threshold?: number | number[]; } /** * Pipe function */ export type PipeFn = (value: T, ...args: any[]) => R; /** * Validator function */ export type ValidatorFn = (value: any, ...args: any[]) => boolean | string | Promise; /** * Hydration strategy */ export type HydrationStrategy = 'idle' | 'visible' | 'interaction' | `media(${string})`; export interface StructuralElement { element: HTMLElement; type: 'if' | 'for' | 'switch' | 'await'; depth: number; } //# sourceMappingURL=types.d.ts.map