/** * This is so far the core of Solid JS 1.x Reactivity, but ported to * classes and adapted to my taste. * * Adaptation for potas needs include: * * - Ported to Classes what does fit * - Signal has any options * - Writing to a signal returns `boolean` to tell if the value changed * - Signal is an object that could be used as signal.read/write or * destructuring * - Signals can save and won't run functions * - `update` function on Signal that could be used to use the old value * to set a new value * - The system is wrapped in a `createReactiveSystem` function so many * systems can be run at the same time, for example for the * developer tools context, so dev-tools context doesnt mess up the * real context * * @url https://www.solidjs.com/ * @url https://github.com/solidjs/solid * @url https://github.com/solidjs/signals */ export function createReactiveSystem(): { action: typeof import("#type/action.d.ts").action; asyncTracking: { add: () => () => void; ready: (fn: any) => void; }; batch: (fn: () => T, init?: boolean) => T; catchError: (fn: () => T, handler: (err: unknown) => void) => T | undefined; cleanup: void>(fn: T) => T; context: (defaultValue?: T) => Context; createSuspenseContext: { new (): { s: Signal; c: number; add(): () => void; isEmpty(): boolean; }; }; derived: typeof import("#type/derived.d.ts").derived; effect: (fn: () => T, options?: EffectOptions) => void; listener: () => { state: number; updatedAt: number; /** @type {Function | undefined} */ fn: Function | undefined; /** @type {any[]} */ sources: any[]; /** @type {number[]} */ sourceSlots: number[]; update(): void; dispose(): void; queue(): void; /** @type {undefined | Root} */ owner: undefined | { /** @type {undefined | Root} */ owner: undefined | /*elided*/ any; /** @type {Computation[]} */ owned: /*elided*/ any[]; /** @type {Function[]} */ cleanups: Function[]; /** @type {Record} */ context: Record; /** @param {() => void} fn */ addCleanups(fn: () => void): void; /** @param {() => void} fn */ cleanupCancel(fn: () => void): void; /** @param {Computation} value */ addOwned(value: /*elided*/ any): void; dispose(): void; disposeOwned(): void; doCleanups(): void; }; /** @type {Computation[]} */ owned: /*elided*/ any[]; /** @type {Function[]} */ cleanups: Function[]; /** @type {Record} */ context: Record; /** @param {() => void} fn */ addCleanups(fn: () => void): void; /** @param {() => void} fn */ cleanupCancel(fn: () => void): void; /** @param {Computation} value */ addOwned(value: /*elided*/ any): void; disposeOwned(): void; doCleanups(): void; }; memo: (fn: () => T, options?: SignalOptions) => SignalAccessor & { readonly memo?: void; }; on: (depend: () => any, fn: () => T, options?: EffectOptions) => void; owned: (cb: ((...args: A[]) => T) | Function, onCancel?: () => void) => (...args: any[]) => any; owner: () => { state: number; updatedAt: number; /** @type {Function | undefined} */ fn: Function | undefined; /** @type {any[]} */ sources: any[]; /** @type {number[]} */ sourceSlots: number[]; update(): void; dispose(): void; queue(): void; /** @type {undefined | Root} */ owner: undefined | { /** @type {undefined | Root} */ owner: undefined | /*elided*/ any; /** @type {Computation[]} */ owned: /*elided*/ any[]; /** @type {Function[]} */ cleanups: Function[]; /** @type {Record} */ context: Record; /** @param {() => void} fn */ addCleanups(fn: () => void): void; /** @param {() => void} fn */ cleanupCancel(fn: () => void): void; /** @param {Computation} value */ addOwned(value: /*elided*/ any): void; dispose(): void; disposeOwned(): void; doCleanups(): void; }; /** @type {Computation[]} */ owned: /*elided*/ any[]; /** @type {Function[]} */ cleanups: Function[]; /** @type {Record} */ context: Record; /** @param {() => void} fn */ addCleanups(fn: () => void): void; /** @param {() => void} fn */ cleanupCancel(fn: () => void): void; /** @param {Computation} value */ addOwned(value: /*elided*/ any): void; disposeOwned(): void; doCleanups(): void; }; root: (fn: (dispose: () => void) => T, options?: EffectOptions) => T; Root: { new (owner: { state: number; updatedAt: number; /** @type {Function | undefined} */ fn: Function | undefined; /** @type {any[]} */ sources: any[]; /** @type {number[]} */ sourceSlots: number[]; update(): void; dispose(): void; queue(): void; /** @type {undefined | Root} */ owner: undefined | { /** @type {undefined | Root} */ owner: undefined | /*elided*/ any; /** @type {Computation[]} */ owned: /*elided*/ any[]; /** @type {Function[]} */ cleanups: Function[]; /** @type {Record} */ context: Record; /** @param {() => void} fn */ addCleanups(fn: () => void): void; /** @param {() => void} fn */ cleanupCancel(fn: () => void): void; /** @param {Computation} value */ addOwned(value: /*elided*/ any): void; dispose(): void; disposeOwned(): void; doCleanups(): void; }; /** @type {Computation[]} */ owned: /*elided*/ any[]; /** @type {Function[]} */ cleanups: Function[]; /** @type {Record} */ context: Record; /** @param {() => void} fn */ addCleanups(fn: () => void): void; /** @param {() => void} fn */ cleanupCancel(fn: () => void): void; /** @param {Computation} value */ addOwned(value: /*elided*/ any): void; disposeOwned(): void; doCleanups(): void; }, options?: EffectOptions): { /** @type {undefined | Root} */ owner: undefined | /*elided*/ any; /** @type {Computation[]} */ owned: { state: number; updatedAt: number; /** @type {Function | undefined} */ fn: Function | undefined; /** @type {any[]} */ sources: any[]; /** @type {number[]} */ sourceSlots: number[]; update(): void; dispose(): void; queue(): void; /** @type {undefined | Root} */ owner: undefined | /*elided*/ any; /** @type {Computation[]} */ owned: /*elided*/ any[]; /** @type {Function[]} */ cleanups: Function[]; /** @type {Record} */ context: Record; /** @param {() => void} fn */ addCleanups(fn: () => void): void; /** @param {() => void} fn */ cleanupCancel(fn: () => void): void; /** @param {Computation} value */ addOwned(value: /*elided*/ any): void; disposeOwned(): void; doCleanups(): void; }[]; /** @type {Function[]} */ cleanups: Function[]; /** @type {Record} */ context: Record; /** @param {() => void} fn */ addCleanups(fn: () => void): void; /** @param {() => void} fn */ cleanupCancel(fn: () => void): void; /** @param {Computation} value */ addOwned(value: { state: number; updatedAt: number; /** @type {Function | undefined} */ fn: Function | undefined; /** @type {any[]} */ sources: any[]; /** @type {number[]} */ sourceSlots: number[]; update(): void; dispose(): void; queue(): void; /** @type {undefined | Root} */ owner: undefined | /*elided*/ any; /** @type {Computation[]} */ owned: /*elided*/ any[]; /** @type {Function[]} */ cleanups: Function[]; /** @type {Record} */ context: Record; /** @param {() => void} fn */ addCleanups(fn: () => void): void; /** @param {() => void} fn */ cleanupCancel(fn: () => void): void; addOwned(value: /*elided*/ any): void; disposeOwned(): void; doCleanups(): void; }): void; dispose(): void; disposeOwned(): void; doCleanups(): void; }; }; runWithOwner: (owner: any, fn: any) => any; signal: (value?: T, options?: SignalOptions) => Signal; syncEffect: (fn: () => T, options?: EffectOptions) => void; untrack: (fn: () => T) => T; useSuspense: Context<{ s: Signal; c: number; add(): () => void; isEmpty(): boolean; }>; withValue: (value: Attribute, fn: (value: T) => void, writeDefaultValue?: () => void, wroteValue?: any, resolved?: any) => void; }; //# sourceMappingURL=solid.d.ts.map