2
* Copyright (c) acacode, Inc. and its affiliates.
4
* This source code is licensed under the MIT license found in the
5
* LICENSE file in the root directory of this source tree.
10
import { PureStonexModule, StonexModule } from './StonexModule'
11
import { StoreBinder } from './StoreBinder'
12
export { default as StonexStore } from './StonexStore'
13
export * from './StonexModule'
14
export * from './StoreBinder'
15
export * from './StateWorker'
16
export * from './StonexStore'
17
export * from './ModifiersWorker'
20
* Map of Module creators
22
export declare type ModuleCreatorsMap<M> = {
23
[K in keyof M]: ModuleCreator<any, M[K]>
27
* Describes what kind of Stonex Module you can attach to Stonex store
29
export declare type ModuleCreator<State, MI> =
30
PureStonexModule<State> | (new (storeBinder: StoreBinder<State>) => MI) | ModuleConfiguration<any, MI>
32
// tslint:disable:max-line-length
34
* @typedef {Object} ModuleConfiguration
35
* @property {(PureStonexModule<State> | (new (storeBinder: StoreBinder<State>) => StonexModule<State>))} module - Stonex module
36
* @property {StoreBinder<State>?} storeBinder - StoreBinder middleware (it is optional property)
39
* @interface ModuleConfiguration
43
// tslint:enable:max-line-length
44
export declare interface ModuleConfiguration<State = any, M = any> {
45
module: (PureStonexModule<State> | (new (storeBinder: StoreBinder<State>) => StonexModule<State>)),
46
storeBinder?: StoreBinder<State>
50
* Stonex Modules class map declaration
52
export declare type StonexModules<M> = {
57
* Object where key is name of connect to store module
58
* and value state snapshot of store module
60
export declare type StateSnapshot<M> = {
61
[K in keyof M]: M[K] extends StonexModule<any> ? M[K]['state'] : null