stonex

Форк
0
/
index.ts 
62 строки · 1.8 Кб
1
/**
2
 * Copyright (c) acacode, Inc. and its affiliates.
3
 *
4
 * This source code is licensed under the MIT license found in the
5
 * LICENSE file in the root directory of this source tree.
6
 *
7
 * @flow
8
 */
9

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'
18

19
/**
20
 * Map of Module creators
21
 */
22
export declare type ModuleCreatorsMap<M> = {
23
  [K in keyof M]: ModuleCreator<any, M[K]>
24
}
25

26
/**
27
 * Describes what kind of Stonex Module you can attach to Stonex store
28
 */
29
export declare type ModuleCreator<State, MI> =
30
  PureStonexModule<State> | (new (storeBinder: StoreBinder<State>) => MI) | ModuleConfiguration<any, MI>
31

32
// tslint:disable:max-line-length
33
/**
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)
37
 *
38
 * @export
39
 * @interface ModuleConfiguration
40
 * @template State
41
 * @template M
42
 */
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>
47
}
48

49
/**
50
 * Stonex Modules class map declaration
51
 */
52
export declare type StonexModules<M> = {
53
  [K in keyof M]: M[K]
54
}
55

56
/**
57
 * Object where key is name of connect to store module
58
 * and value state snapshot of store module
59
 */
60
export declare type StateSnapshot<M> = {
61
  [K in keyof M]: M[K] extends StonexModule<any> ? M[K]['state'] : null
62
}
63

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.