UNPKG

@netgrif/components-core

Version:

Netgrif Application engine frontend core Angular library

22 lines (21 loc) 1.09 kB
import { AfterAction } from '../../utility/call-chain/after-action'; /** * Wrapper for a scheduled event */ export declare class QueuedEvent { protected _isRelevant: () => boolean; protected _execute: (afterAction: AfterAction) => void; protected _revert: (afterAction: AfterAction) => void; /** * @param _isRelevant a method that determines if the event is still relevant at the time of its execution. * Returns `true` if the event is still relevant (e.g. the set field is still editable). Returns `false` otherwise. * @param _execute executes the scheduled event and then performs the provided after action * @param _revert reverts the scheduled event and then performs the provided after action */ constructor(_isRelevant: () => boolean, _execute: (afterAction: AfterAction) => void, _revert?: (afterAction: AfterAction) => void); /** * Executes the event if it is still relevant, or reverts it if it is not. * Performs the provided after action, once the event is resolved. */ resolve(afterAction: AfterAction): void; }