UNPKG

@eclipse-scout/core

Version:
50 lines 2.43 kB
import { BusyIndicator, BusySupportModel, Event, EventHandler, InitModelOf, ObjectWithType, SomeRequired } from '../index'; export declare class BusySupport implements ObjectWithType { model: BusySupportModel; initModel: SomeRequired<this['model'], 'parent'>; self: BusySupport; objectType: string; defaultBusyIndicatorModel: InitModelOf<BusyIndicator>; defaultRenderDelay: number; busyIndicator: BusyIndicator; protected _busyCounter: number; protected _busyIndicatorTimeoutId: number; protected _cancellationCallbacks: EventHandler<Event<BusyIndicator>>[]; constructor(); init(model: InitModelOf<this>): void; /** @see BusySupportModel.renderDelay */ setDefaultRenderDelay(delay: number): void; /** @see BusySupportModel.busyIndicatorModel */ setDefaultBusyIndicatorModel(model: InitModelOf<BusyIndicator>): void; isBusy(): boolean; /** * Changes the busy state * * @param options A boolean indicating if busy or not to show the busy indicator with the default settings (as passed when creating this instance) and without a cancellation callback. * Or a {@link BusyIndicatorOptions} object which allows to customize the behavior and style of the indicator and to pass a cancellation callback. */ setBusy(options: boolean | BusyIndicatorOptions): void; protected _startBusy(options: BusyIndicatorOptions): void; protected _renderBusy(): void; protected _stopBusy(): void; protected _onBusyIndicatorCancel(event: Event<BusyIndicator>): void; } export interface BusyIndicatorOptions extends BusySupportModel { /** * Specifies if the {@link BusySupport} should be set to busy or not. * The default is false. */ busy: boolean; /** * If set to true and {@link BusyIndicatorOptions.busy} is false, the {@link BusyIndicator} is removed even if there have been fewer calls with busy=false than with busy=true (asymmetric). * The default is false. */ force?: boolean; /** * Adds a callback to be executed when the {@link BusyIndicator} is cancelled. Only executed if {@link BusyIndicatorModel.cancellable} is true. * Every callback is only executed once when the {@link BusyIndicator} is removed. * Only used if {@link BusyIndicatorOptions.busy} is true. */ onCancel?: EventHandler<Event<BusyIndicator>>; } //# sourceMappingURL=BusySupport.d.ts.map