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, LocalActions> {
    config: Config;
    actions: LocalActions;
    subscribe: Application['hostSubscribe'];
    getState: Application['getState'];
    dispatch: Application['dispatch'];
}
export interface GetApi<Api, Config, LocalActions> {
    (options: GetApiOption<Config, LocalActions>): Api;
}
/**
 * The interface for a dynamic feature
 * @public
 * */
export interface Feature<LocalStore, LocalActions> {
    /** 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<LocalStore>;
    /** optional initial state for the feature*/
    initialState?: LocalStore;
}
export interface FeatureWithApi<LocalStore, LocalActions, Api> extends Feature<LocalStore, LocalActions> {
    getApi: GetApi<Api, ApiConfig, LocalActions>;
}
export interface FeatureWithRouterApi<LocalStore, LocalActions, Api> extends Feature<LocalStore, LocalActions> {
    getApi: GetApi<Api, ApiConfigWithRouter, LocalActions>;
    requiresRouter: true;
}
