export * from 'alien-signals'; type Signal = { (): T; (value: T): void; }; type Computed = () => T; declare const batch: (fn: () => T) => T; declare const isDeepSignal: (source: any) => boolean; declare const isShallow: (source: any) => boolean; declare const deepSignal: (obj: T) => DeepSignal; declare const peek: , K extends keyof RevertDeepSignalObject>(obj: T, key: K) => RevertDeepSignal[K]>; declare const shallowFlag: unique symbol; declare function shallow(obj: T): Shallow; declare const rawFlag: unique symbol; declare function markRaw(obj: T): Raw; declare const raw: typeof markRaw; /** TYPES **/ type DeepSignal = T extends Function ? T : T extends { [shallowFlag]: true; } ? T : T extends { [rawFlag]: true; } ? T : T extends Array ? DeepSignalArray : T extends object ? DeepSignalObject : T; type DeepSignalObject = { [P in keyof T & string as `$${P}`]?: T[P] extends Function ? never : Signal; } & { [P in keyof T]: DeepSignal; }; /** @ts-expect-error **/ interface DeepArray extends Array { map: (callbackfn: (value: DeepSignal, index: number, array: DeepSignalArray) => U, thisArg?: any) => U[]; forEach: (callbackfn: (value: DeepSignal, index: number, array: DeepSignalArray) => void, thisArg?: any) => void; concat(...items: ConcatArray[]): DeepSignalArray; concat(...items: (T | ConcatArray)[]): DeepSignalArray; reverse(): DeepSignalArray; shift(): DeepSignal | undefined; slice(start?: number, end?: number): DeepSignalArray; splice(start: number, deleteCount?: number): DeepSignalArray; splice(start: number, deleteCount: number, ...items: T[]): DeepSignalArray; filter(predicate: (value: DeepSignal, index: number, array: DeepSignalArray) => unknown, thisArg?: any): DeepSignalArray; reduce(callbackfn: (previousValue: DeepSignal, currentValue: DeepSignal, currentIndex: number, array: DeepSignalArray) => T): DeepSignal; reduce(callbackfn: (previousValue: DeepSignal, currentValue: DeepSignal, currentIndex: number, array: DeepSignalArray) => DeepSignal, initialValue: T): DeepSignal; reduce(callbackfn: (previousValue: U, currentValue: DeepSignal, currentIndex: number, array: DeepSignalArray) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: DeepSignal, currentValue: DeepSignal, currentIndex: number, array: DeepSignalArray) => T): DeepSignal; reduceRight(callbackfn: (previousValue: DeepSignal, currentValue: DeepSignal, currentIndex: number, array: DeepSignalArray) => DeepSignal, initialValue: T): DeepSignal; reduceRight(callbackfn: (previousValue: U, currentValue: DeepSignal, currentIndex: number, array: DeepSignalArray) => U, initialValue: U): U; } type ArrayType = T extends Array ? I : T; type DeepSignalArray = DeepArray> & { [key: number]: DeepSignal>; $?: { [key: number]: Signal>; }; $length?: Signal; }; type Shallow = T & { [shallowFlag]: true; }; type Raw = T & { [rawFlag]: true; }; declare const useDeepSignal: (obj: T) => DeepSignal; type FilterSignals = K extends `$${infer P}` ? never : K; type RevertDeepSignalObject = Pick>; type RevertDeepSignalArray = Omit; type RevertDeepSignal = T extends Array ? RevertDeepSignalArray : T extends object ? RevertDeepSignalObject : T; type OnCleanup = (cleanupFn: () => void) => void; type WatchEffect = (onCleanup: OnCleanup) => void; type WatchSource = Signal | Computed | (() => T); type WatchFlush = 'pre' | 'post' | 'sync'; interface WatchOptions { immediate?: Immediate; deep?: boolean | number; once?: boolean; flush?: WatchFlush; scheduler?: (job: () => void, isFirstRun: boolean) => void; } type WatchCallback = (value: V, oldValue: OV, onCleanup: OnCleanup) => any; interface WatchHandle { (): void; pause: () => void; resume: () => void; stop: () => void; } declare function watch(source: WatchSource | WatchSource[] | WatchEffect | object, cb?: WatchCallback, options?: WatchOptions): WatchHandle; declare function traverse(value: unknown, depth?: number, seen?: Set): unknown; declare function watchEffect(effect: WatchEffect): WatchHandle; declare const isArray: typeof Array.isArray; declare const isMap: (val: unknown) => val is Map; declare const isSet: (val: unknown) => val is Set; declare const isFunction: (val: unknown) => val is Function; declare const isObject: (val: unknown) => val is Record; declare const isPlainObject: (val: unknown) => val is Record; declare const isSignal: (source: unknown) => source is Signal; declare const isComputed: (source: unknown) => source is Computed; type MaybeSignal = T | Signal; type MaybeSignalOrGetter = MaybeSignal | Computed | (() => T); declare function unSignal(source: MaybeSignal | Computed): T; declare function toValue(source: MaybeSignalOrGetter): T; declare const peekSignal: (source: Signal | Computed) => T; export { type Computed, type DeepSignal, type MaybeSignal, type MaybeSignalOrGetter, type OnCleanup, type Raw, type RevertDeepSignal, type Shallow, type Signal, type WatchCallback, type WatchEffect, type WatchFlush, type WatchHandle, type WatchOptions, type WatchSource, batch, deepSignal, isArray, isComputed, isDeepSignal, isFunction, isMap, isObject, isPlainObject, isSet, isShallow, isSignal, markRaw, peek, peekSignal, raw, shallow, toValue, traverse, unSignal, useDeepSignal, watch, watchEffect };