little-state-machine
Advanced tools
Comparing version 4.3.3-beta.0 to 4.3.3-beta.1
@@ -1,2 +0,2 @@ | ||
export declare const STORE_DEFAULT_NAME = "__LSM__"; | ||
export declare const STORE_ACTION_NAME = "__LSM_NAME__"; | ||
export declare const STORE_DEFAULT_NAME = '__LSM__'; | ||
export declare const STORE_ACTION_NAME = '__LSM_NAME__'; |
@@ -0,0 +0,0 @@ import { StateMachineProvider } from './StateMachineContext'; |
import { MiddleWare, GlobalState } from '../types'; | ||
declare const _default: { | ||
updateStore(defaultValues: GlobalState): void; | ||
saveStore(): void; | ||
middleWares: MiddleWare[]; | ||
state: GlobalState; | ||
name: string; | ||
storageType: Storage; | ||
updateStore(defaultValues: GlobalState): void; | ||
saveStore(): void; | ||
middleWares: MiddleWare[]; | ||
state: GlobalState; | ||
name: string; | ||
storageType: Storage; | ||
}; | ||
export default _default; |
@@ -1,7 +0,22 @@ | ||
import { StateMachineOptions, GlobalState, AnyCallback, AnyActions, ActionsOutput, PersistOptions } from './types'; | ||
import { | ||
StateMachineOptions, | ||
GlobalState, | ||
AnyCallback, | ||
AnyActions, | ||
ActionsOutput, | ||
PersistOptions, | ||
} from './types'; | ||
export declare let persistOption: PersistOptions; | ||
export declare function createStore(defaultState: GlobalState, options?: StateMachineOptions): void; | ||
export declare function useStateMachine<TCallback extends AnyCallback, TActions extends AnyActions<TCallback>>(actions?: TActions): { | ||
actions: ActionsOutput<TCallback, TActions>; | ||
state: GlobalState; | ||
export declare function createStore( | ||
defaultState: GlobalState, | ||
options?: StateMachineOptions, | ||
): void; | ||
export declare function useStateMachine< | ||
TCallback extends AnyCallback, | ||
TActions extends AnyActions<TCallback>, | ||
>( | ||
actions?: TActions, | ||
): { | ||
actions: ActionsOutput<TCallback, TActions>; | ||
state: GlobalState; | ||
}; |
import * as React from 'react'; | ||
import { StateMachineContextValue } from './types'; | ||
declare type PropsChildren = { | ||
children?: React.ReactNode; | ||
children?: React.ReactNode; | ||
}; | ||
@@ -6,0 +6,0 @@ export declare const StateMachineProvider: React.FC<PropsChildren>; |
import * as React from 'react'; | ||
export interface GlobalState { | ||
} | ||
export declare type AnyCallback = (state: GlobalState, payload: any) => GlobalState; | ||
export interface GlobalState {} | ||
export declare type AnyCallback = ( | ||
state: GlobalState, | ||
payload: any, | ||
) => GlobalState; | ||
export declare type AnyActions<TCallback> = Record<string, TCallback>; | ||
export declare type ActionsOutput<TCallback extends AnyCallback, TActions extends AnyActions<TCallback>> = { | ||
[K in keyof TActions]: (payload?: Parameters<TActions[K]>[1]) => void; | ||
export declare type ActionsOutput< | ||
TCallback extends AnyCallback, | ||
TActions extends AnyActions<TCallback>, | ||
> = { | ||
[K in keyof TActions]: (payload?: Parameters<TActions[K]>[1]) => void; | ||
}; | ||
export declare type StateMachineContextValue = { | ||
state: GlobalState; | ||
setState: React.Dispatch<React.SetStateAction<GlobalState>>; | ||
state: GlobalState; | ||
setState: React.Dispatch<React.SetStateAction<GlobalState>>; | ||
}; | ||
export declare type MiddleWare = (state: GlobalState, payload: any, callbackName: string) => GlobalState; | ||
export declare type MiddleWare = ( | ||
state: GlobalState, | ||
payload: any, | ||
callbackName: string, | ||
) => GlobalState; | ||
export declare type PersistOptions = 'onAction' | 'none' | 'beforeUnload'; | ||
export declare type StateMachineOptions = Partial<{ | ||
name: string; | ||
middleWares: MiddleWare[]; | ||
storageType: Storage; | ||
persist: PersistOptions; | ||
name: string; | ||
middleWares: MiddleWare[]; | ||
storageType: Storage; | ||
persist: PersistOptions; | ||
}>; | ||
declare global { | ||
interface Window { | ||
__LSM_NAME__: any; | ||
__LSM__: any; | ||
__LSM_DEBUG__: any; | ||
__LSM_RESET__: any; | ||
__LSM_GET_STORE__: any; | ||
__LSM_SAVE_TO__: any; | ||
__LSM_LOAD__: any; | ||
__LSM_DEBUG_NAME__: any; | ||
} | ||
interface Window { | ||
__LSM_NAME__: any; | ||
__LSM__: any; | ||
__LSM_DEBUG__: any; | ||
__LSM_RESET__: any; | ||
__LSM_GET_STORE__: any; | ||
__LSM_SAVE_TO__: any; | ||
__LSM_LOAD__: any; | ||
__LSM_DEBUG_NAME__: any; | ||
} | ||
} |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "4.3.3-beta.0", | ||
"version": "4.3.3-beta.1", | ||
"main": "dist/little-state-machine.js", | ||
@@ -20,2 +20,3 @@ "module": "dist/little-state-machine.es.js", | ||
"test": "jest", | ||
"prettier": "prettier --config .prettierrc --write \"**/*.{ts,tsx}\"", | ||
"test:watch": "yarn test --watchAll" | ||
@@ -22,0 +23,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112
47237