import { FieldSchema } from '@ephox/boulder';
import { Fun } from '@ephox/katamari';
import { NoState } from '../../behaviour/common/BehaviourState';
import { derive } from '../events/AlloyEvents';
import { create as createBehaviour } from './Behaviour';
// AlloyEventKeyAndHandler type argument needs to be any here to satisfy an array of handlers
// where each item can be any subtype of EventFormat we can't use <T extends EventFormat> since
// then each item would have to be the same type
const events = (name, eventHandlers) => {
    const events = derive(eventHandlers);
    return createBehaviour({
        fields: [
            FieldSchema.required('enabled')
        ],
        name,
        active: {
            events: Fun.constant(events)
        }
    });
};
const config = (name, eventHandlers) => {
    const me = events(name, eventHandlers);
    return {
        key: name,
        value: {
            config: {},
            me,
            configAsRaw: Fun.constant({}),
            initialConfig: {},
            state: NoState
        }
    };
};
export { events, config };
//# sourceMappingURL=AddEventsBehaviour.js.map