import { ActionArgs, ActionFunction, AnyEventObject, DoNotInfer, EventObject, MachineContext, ParameterizedObject, SendExpr } from "../types.js"; export interface EmitAction { (args: ActionArgs, params: TParams): void; _out_TEmitted?: TEmitted; } /** * Emits an event to event handlers registered on the actor via `actor.on(event, * handler)`. * * @example * * ```ts * import { emit } from 'xstate'; * * const machine = createMachine({ * // ... * on: { * something: { * actions: emit({ * type: 'emitted', * some: 'data' * }) * } * } * // ... * }); * * const actor = createActor(machine).start(); * * actor.on('emitted', (event) => { * console.log(event); * }); * * actor.send({ type: 'something' }); * // logs: * // { * // type: 'emitted', * // some: 'data' * // } * ``` */ export declare function emit( /** The event to emit, or an expression that returns an event to emit. */ eventOrExpr: DoNotInfer | SendExpr, TEvent>): ActionFunction;