logic-runtime-react-z 2.0.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +0,0 @@
1
- import type { LogicRuntime, IntentHandler, Effect } from "../core/types";
2
- import { LogicPlugin } from "../plugins";
3
- type ComputedDef<S, C> = {
4
- [K in keyof C]: (ctx: {
5
- state: S;
6
- }) => C[K];
7
- };
8
- type LogicDef<S extends object, C extends object = {}> = {
9
- name?: string;
10
- state: S;
11
- computed?: ComputedDef<S, C>;
12
- intents?: (bus: {
13
- on(intent: string, handler: IntentHandler<S, S & C>): void;
14
- effect(intent: string, fx: Effect<S, S & C>): void;
15
- }) => void;
16
- plugins?: LogicPlugin<S, C>[];
17
- };
18
- export declare function createLogic<S extends object = {}, C extends object = {}>(def: LogicDef<S, C>): {
19
- create(scope?: string): LogicRuntime<S, C>;
20
- };
21
- export {};
@@ -1,10 +0,0 @@
1
- type ComputeFn<S, R> = (ctx: {
2
- state: S;
3
- }) => R;
4
- export declare function createComputed<S extends object, C extends Record<string, any>>(): {
5
- compute: <K extends keyof C>(key: K, fn: ComputeFn<S, C[K]>, state: S) => C[K];
6
- invalidate: (changedKey: keyof S) => void;
7
- subscribe: <K extends keyof C>(key: K, fn: () => void) => () => boolean;
8
- reset: () => void;
9
- };
10
- export {};
@@ -1,4 +0,0 @@
1
- export { createStore } from "./store";
2
- export { createComputed } from "./computed";
3
- export { createSelector } from "./selector";
4
- export { createSignal } from "./signal";
@@ -1 +0,0 @@
1
- export declare function createSelector<T, R>(select: (state: T) => R, isEqual?: (value1: any, value2: any) => boolean): (state: T) => R;
@@ -1,6 +0,0 @@
1
- export type Subscriber = () => void;
2
- export declare function createSignal<T>(value: T): {
3
- get(): T;
4
- set(next: T): void;
5
- subscribe(fn: Subscriber): () => boolean;
6
- };
@@ -1,6 +0,0 @@
1
- import { Listener } from "../core/types";
2
- export declare function createStore<S extends object>(initial: S): {
3
- getState: () => S;
4
- setState: (mutator: (s: S) => void) => void;
5
- subscribe: (fn: Listener) => () => boolean;
6
- };