@eclipse-scout/core
Version:
Eclipse Scout runtime
38 lines • 1.51 kB
TypeScript
import { Constructor, InitModelOf, ObjectModel, ObjectWithType, Widget } from '../../index';
/**
* Represents a widget and optionally a non-{@link Widget} element owned by it.
*/
export declare class HybridActionContextElement implements ObjectWithType {
model: HybridActionContextElementModel;
objectType: string;
widget: Widget;
element: any;
/**
* @param widget may not be `null`
* @param element may be `null`
* @throws Error if widget is `null`
*/
static of(widget: Widget, element?: any): HybridActionContextElement;
init(model: InitModelOf<HybridActionContextElement>): void;
/**
* @returns the typed {@link widget}, never `null`
* @throws Error if the widget is not an instance of the given type
*/
getWidget(): Widget;
getWidget<W extends Widget>(widgetType: Constructor<W>): W;
/**
* @returns the typed or untyped {@link element}, never `null`
* @throws Error if the element is `null` or not an instance of the given type. Use {@link optElement} to return `null` instead.
*/
getElement<E>(elementType?: Constructor<E>): E;
/**
* @returns the typed or untyped {@link element} or `null`
* @throws Error if the element is not an instance of the given type.
*/
optElement<E>(elementType?: Constructor<E>): E;
}
export interface HybridActionContextElementModel extends ObjectModel {
widget: Widget;
element?: any;
}
//# sourceMappingURL=HybridActionContextElement.d.ts.map