///
import type { EventEmitter } from "events";
import type { EventLog } from "web3-core";
import type { BaseContract, Callback, ContractEventLog, EventOptions } from "../../build/types/types";
/**
* Contract event function type.
*/
export declare type ContractEvent = {
(cb?: Callback>): EventEmitter;
(options?: EventOptions, cb?: Callback>): EventEmitter;
};
/**
* Event data type specified by name.
*/
export declare type Event> = EventValues;
/**
* Concrete event type with known properties based on the event name.
*
* @remarks
* This type definition allows the TypeScript compiler to determine the type of
* the `returnValues` property based on `event` property checks. For example:
* ```
* const eventData: AnyEvent = ...
* switch (eventData.event) {
* case "Token": // ERR: 2678: Type '"Token"' is not comparable to type
* // '"OrderPlacement" | "TokenListing" | ...'
* break
* case "OrderPlacement":
* eventData.returnValues.buyToken = "asdf" // OK
* break
* case "Withdraw":
* eventData.returnValues.buyToken = "asdf" // ERR: 2339: Property 'buyToken' does not exist on type
* // '{ user: string; token: string; amount: string; ... }'.
* break
* }
* ```
*/
export declare type AnyEvent = EventMetadata & EventDiscriminant>;
export declare type EventMetadata = Omit;
export declare type EventName = Exclude;
export declare type EventValues = T extends ContractEvent ? U : never;
export declare type EventDiscriminant> = T extends unknown ? {
event: T;
returnValues: EventValues;
} : never;