/** * @module seng-event */ import { DataForIsomorphicEvent } from './EventTypings'; import IsomorphicBaseEvent, { EventOptions, EventOptionsMap } from './IsomorphicBaseEvent'; import { TypeMap } from './types'; /** * Advanced variant of the [[createEventClass]] util. Creates an _isomorphic_ event class. * This is an event class where the `data` property can be different for each event `type`. * * @typeparam TDataTuple A tuple type containing the types of the `data` property for * each event `type`. The order of this tuple corresponds to the order of the `type` * strings passed * @see For more information on the `bubbles`, `cancelable` and `setTimestamp` parameters, * see [[AbstractEvent]] * @param eventOptions Objects optionally containing the properties `bubbles`, `cancelable` * and `setTimestamp`. The order in which these objects are passed corresponds to the order * of the `type` strings passed * * @example The following snippet creates an event class with: * - A `'SELECT'` event that bubbles with an `id` property on `data` * - A `'CLOSE'` event that is cancelable with no `data` * - A `'START'` event with an `offset` property on `data` * ``` * class MyEvent extends createIsomorphicEvent< * { id: string }, void, { offset: number } * >( * { bubbles: true }, { cancelable: true } * )( * 'SELECT', 'CLOSE', 'START' * ) {} * ``` * @returns a callback that is used to pass more parameters. See the example */ declare function createIsomorphicEventClass>(...eventOptions: Array): (...types: TTypesTuple) => { new (type: TType, data: DataForIsomorphicEvent): { type: TType; data: DataForIsomorphicEvent; typeOptions: EventOptionsMap; clone(): IsomorphicBaseEvent; bubbles: boolean; cancelable: boolean; currentTarget: import("./EventDispatcher").default | null; target: import("./EventDispatcher").default | null; eventPhase: import("./EventPhase").default; timeStamp: number; defaultPrevented: boolean; stopPropagation(): void; stopImmediatePropagation(): void; preventDefault(): void; callListener(handler: import("./EventTypings").EventHandlerForEvent): import("./CallListenerResult").default; }; types: TypeMap; }; export default createIsomorphicEventClass;