/** * Copyright (c) acacode, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import { PureStonexModule, StonexModule } from './StonexModule' import { StoreBinder } from './StoreBinder' export { default as StonexStore } from './StonexStore' export * from './StonexModule' export * from './StoreBinder' export * from './StateWorker' export * from './StonexStore' export * from './ModifiersWorker' /** * Map of Module creators */ export declare type ModuleCreatorsMap = { [K in keyof M]: ModuleCreator } /** * Describes what kind of Stonex Module you can attach to Stonex store */ export declare type ModuleCreator = PureStonexModule | (new (storeBinder: StoreBinder) => MI) | ModuleConfiguration // tslint:disable:max-line-length /** * @typedef {Object} ModuleConfiguration * @property {(PureStonexModule | (new (storeBinder: StoreBinder) => StonexModule))} module - Stonex module * @property {StoreBinder?} storeBinder - StoreBinder middleware (it is optional property) * * @export * @interface ModuleConfiguration * @template State * @template M */ // tslint:enable:max-line-length export declare interface ModuleConfiguration { module: (PureStonexModule | (new (storeBinder: StoreBinder) => StonexModule)), storeBinder?: StoreBinder } /** * Stonex Modules class map declaration */ export declare type StonexModules = { [K in keyof M]: M[K] } /** * Object where key is name of connect to store module * and value state snapshot of store module */ export declare type StateSnapshot = { [K in keyof M]: M[K] extends StonexModule ? M[K]['state'] : null }