Skip to main content

diff-check

Diff checking event class.

Events

DiffCheckEvent

Defined in: events/diff-check.ts:15

Event emitted before/after checking schema differences.

Extends

Constructors

Constructor
new DiffCheckEvent(data, options?): DiffCheckEvent;

Defined in: events/diff-check.ts:23

Parameters
data
outputDir?

string

schema?

unknown

schemaHasChanges?

boolean

options?

CancellableEventOptions

Returns

DiffCheckEvent

Overrides

CancellableEvent.constructor

Properties

data
readonly data: object;

Defined in: events/diff-check.ts:17

Event data containing schema, output directory, and change status

outputDir?
optional outputDir: string;
schema?
optional schema: unknown;
schemaHasChanges?
optional schemaHasChanges: boolean;

Accessors

defaultAction
Get Signature
get defaultAction(): DefaultAction | undefined;

Defined in: events/base.ts:109

Gets the default action function if one was provided.

Returns

DefaultAction | undefined

Inherited from

CancellableEvent.defaultAction

defaultPrevented
Get Signature
get defaultPrevented(): boolean;

Defined in: events/base.ts:95

Gets whether the default action has been prevented.

Returns

boolean

Inherited from

CancellableEvent.defaultPrevented

propagationStopped
Get Signature
get propagationStopped(): boolean;

Defined in: events/base.ts:102

Gets whether propagation has been stopped.

Returns

boolean

Inherited from

CancellableEvent.propagationStopped

Methods

preventDefault()
preventDefault(): void;

Defined in: events/base.ts:127

Prevents the default action from executing. Only works if the event is cancellable.

Returns

void

Example
events.on("beforeLoadSchema", (event) => {
if (shouldUseCustomLoader) {
event.preventDefault(); // Stops default schema loading
// Custom logic here
}
});
Inherited from

CancellableEvent.preventDefault

runDefaultAction()
runDefaultAction(): Promise<void>;

Defined in: events/base.ts:160

Executes the default action for an event if it hasn't been prevented.

Returns

Promise<void>

A promise that resolves when the default action completes, or void if the action was prevented or no default action is defined

Remarks

This method will only execute the _defaultAction if:

  • The event's default has not been prevented (_defaultPrevented is false)
  • A default action function has been defined (_defaultAction is a function)
Inherited from

CancellableEvent.runDefaultAction

stopPropagation()
stopPropagation(): void;

Defined in: events/base.ts:146

Stops propagation to remaining event handlers. Handlers registered after the current one will not execute.

Returns

void

Example
events.on("beforeLoadSchema", (event) => {
if (criticalError) {
event.stopPropagation(); // No more handlers run
}
});
Inherited from

CancellableEvent.stopPropagation