@zedux/core
Version:
A high-level, declarative, composable form of Redux
48 lines (43 loc) • 1.23 kB
TypeScript
interface T {
[key: string]: any;
}
/**
The default method for cloning state tree nodes
This does not have to create a deep copy.
In fact, it probably shouldn't.
*/
export declare const clone: (node: T) => {
[x: string]: any;
};
/**
The default method for creating state tree nodes
Should return an empty node.
*/
export declare const create: () => {};
/**
The default method for retrieving the value of a property on
the state tree.
*/
export declare const get: (node: T, key: string) => any;
/**
The default method for determining if something is a state tree node
*/
export declare const isNode: (value: any) => boolean;
/**
The default method for iterating over the properties of a state tree
node.
Should call `callback` with each key-value pair.
*/
export declare const iterate: (node: T, callback: (key: string, value: any) => any) => void;
/**
The default method for setting the value of a property on the
state tree.
This can be mutating.
Zedux promises to never abuse this power.
*/
export declare const set: (node: T, key: string, val: any) => T;
/**
The default method for finding the size of a state tree node.
*/
export declare const size: (node: T) => number;
export {};