# BaseEvent

typedef

Default type describing any event.

Every custom event has to be compatible with `BaseEvent`.

```typescript
type MyEvent = {
	// In `fire<MyEvent>( name )`, `on<MyEvent>( name )`, `once<MyEvent>( name )` and `listenTo<MyEvent>( name )` calls
	// the `name` argument will be type-checked to ensure it's `'myEvent'` or have `'myEvent:'` prefix.
	// Required.
	name: 'myEvent' | `myEvent:${ string }`;

	// In `fire<MyEvent>( name, a, b )` call, `a` and `b` parameters will be type-checked against `number` and `string`.
	// In `on<MyEvent>`, `once<MyEvent>` and `listenTo<MyEvent>` calls, the parameters of provided callback function
	// will be automatically inferred as `EventInfo`, `number` and `string`.
	// Required.
	args: [ number, string ];

	// `fire<MyEvent>` will have return type `boolean | undefined`.
	// Optional, unknown by default.
	return: boolean;

	// `fire<MyEvent>( eventInfo )` will type-check that `eventInfo` is `MyEventInfo`, not a base `EventInfo` or string.
	// In `on<MyEvent>`, `once<MyEvent>` and `listenTo<MyEvent>` calls, the first callback parameter will be of this type.
	// Optional.
	eventInfo: MyEventInfo;

	// In `on<MyEvent>`, `once<MyEvent>` and `listenTo<MyEvent>` calls, the `options` parameter will be of type
	// `{ myOption?: boolean; priority?: PriorityString }
	// Optional.
	callbackOptions: { myOption?: boolean };
};
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/emittermixin.ts#L626)

<a id="properties">

## Properties

<a id="member-args">

### `args: Array<any>`

<a id="member-name">

### `name: string`

#### Value

`object`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
