import { StructureProcessor, FieldProcessor } from '@ephox/boulder';
import { AlloyComponent } from '../../api/component/ComponentApi';
import * as AlloyEvents from '../../api/events/AlloyEvents';
import { CustomEvent } from '../../events/SimulatedEvent';
import { BehaviourState, BehaviourStateInitialiser } from './BehaviourState';
import { AlloyBehaviour, BehaviourActiveSpec, BehaviourApisRecord, BehaviourConfigDetail, BehaviourConfigSpec, BehaviourExtraRecord } from './BehaviourTypes';
export type WrappedApiFunc<T extends (comp: AlloyComponent, config: any, state: any, ...args: any[]) => any> = T extends (comp: AlloyComponent, config: any, state: any, ...args: infer P) => infer R ? (comp: AlloyComponent, ...args: P) => R : never;
type Executor<D extends BehaviourConfigDetail, S extends BehaviourState> = (component: AlloyComponent, bconfig: D, bState: S) => void;
export type AlloyBehaviourWithApis<C extends BehaviourConfigSpec, D extends BehaviourConfigDetail, S extends BehaviourState, A extends BehaviourApisRecord<D, S>, E extends BehaviourExtraRecord<E>> = AlloyBehaviour<C, D, S> & {
    [K in keyof A]: WrappedApiFunc<A[K]>;
} & E;
declare const executeEvent: <C extends BehaviourConfigSpec, S extends BehaviourState>(bConfig: C, bState: S, executor: Executor<C, S>) => AlloyEvents.AlloyEventKeyAndHandler<CustomEvent>;
declare const loadEvent: <C extends BehaviourConfigSpec, S extends BehaviourState>(bConfig: C, bState: S, f: Executor<C, S>) => AlloyEvents.AlloyEventKeyAndHandler<CustomEvent>;
declare const create: <C extends BehaviourConfigSpec, D extends BehaviourConfigDetail, S extends BehaviourState, A extends BehaviourApisRecord<D, S>, E extends BehaviourExtraRecord<E>>(schema: FieldProcessor[], name: string, active: BehaviourActiveSpec<D, S>, apis: A, extra: E, state: BehaviourStateInitialiser<D, S>) => AlloyBehaviourWithApis<C, D, S, A, E>;
declare const createModes: <C extends BehaviourConfigSpec, D extends BehaviourConfigDetail, S extends BehaviourState, A extends BehaviourApisRecord<D, S>, E extends BehaviourExtraRecord<E>>(modes: StructureProcessor, name: string, active: BehaviourActiveSpec<D, S>, apis: A, extra: E, state: BehaviourStateInitialiser<D, S>) => AlloyBehaviourWithApis<C, D, S, A, E>;
export { executeEvent, loadEvent, create, createModes };
//# sourceMappingURL=Behaviour.d.ts.map