UNPKG

impair

Version:

impair is a React framework bringing several programming concepts together in order to provide a foundation for a layered, scalable, performant and enterprise level react application.

42 lines (41 loc) 1.6 kB
import { Dictionary } from '../types'; export type StateType = 'shallow' | 'deep' | 'atom' | 'default'; export type StateMetadata = { propertyKey: string; type: StateType; }; /** * @state decorator * @description This decorator is used to mark a property as a reactive state. reactivity level is 'deep' by default. * you can configure it using the 'configure' function */ export declare function state(target: any, propertyKey: string): any; export declare namespace state { var shallow: typeof shallowState; var atom: typeof atomState; var deep: typeof deepState; } /** * @state.shallow decorator * @description This decorator is used to mark a property as a shallow reactive state. Reactivity by 1st level properties of * object, arrays, maps, sets * @link https://vuejs.org/api/reactivity-advanced.html#shallowreactive */ declare function shallowState(target: any, propertyKey: string): any; /** * @state.atom decorator * @description This decorator is used to mark a property as an atom reactive state. Reactivity by re-assignment * @link https://vuejs.org/api/reactivity-advanced.html#shallowref */ declare function atomState(target: any, propertyKey: string): any; /** * @state.deep decorator * @description This decorator is used to mark a property as a deep reactive state. Reactive to deep mutations * @link https://vuejs.org/api/reactivity-core.html#ref */ declare function deepState(target: any, propertyKey: string): any; type InitParams = { instance: Dictionary; }; export declare function initState({ instance }: InitParams): void; export {};