import { IAction, IConfiguration, Overmind } from 'overmind'; import { Options } from 'overmind/lib/internalTypes'; export interface Base extends IConfiguration { state: {}; effects: {}; actions: {}; reactions: {}; } export interface Using { using(b: U): Using; config(): Pick; app(options?: Options): Overmind; } export interface UnknownObject { [key: string]: unknown; } declare type Pass = T; declare type UnWrap = T[keyof T] extends Pass ? U : never; declare type UnWrapSettings = UnWrap>; export interface Setup> { (config: Config, settings: Settings): void; } export interface Settings { [blockName: string]: T; } export declare type Initializer = IAction; export interface BaseBlock { name: string; dependencies?: BaseBlock[]; settings?: SettingsType; onInitialize?: Initializer; setup?: Setup; } /** This interface should only be used when the App type for the block is fully * known (like in libraries) because it hides the actual config content. */ export declare type Block = Config & BaseBlock; export {};