import { Reducer } from 'redux'; import { Store } from '../../store'; import { ApiClientConfig, Application } from '../../types'; export interface ApiConfig extends ApiClientConfig { hostName?: string; } export interface ApiConfigWithRouter extends ApiConfig { hostName: string; } export interface GetApiOption { config: Config; actions: LocalActions; subscribe: Application['hostSubscribe']; getState: Application['getState']; dispatch: Application['dispatch']; } export interface GetApi { (options: GetApiOption): Api; } /** * The interface for a dynamic feature * @public * */ export interface Feature { /** actions for the feature*/ actions: LocalActions; /** the key matching the property name in the store*/ key: keyof Store; /** the reducer for the feature*/ reducer: Reducer; /** optional initial state for the feature*/ initialState?: LocalStore; } export interface FeatureWithApi extends Feature { getApi: GetApi; } export interface FeatureWithRouterApi extends Feature { getApi: GetApi; requiresRouter: true; }