Dashlet (the instance handle)
The object returned by installDashletGlobal(options). It is a plain handle — a promise plus subscriptions and methods — composable with any framework’s state and lifecycle primitives (no framework constructs).
1. Signature
interface Dashlet {
readonly init: Promise<InitContext>;
onInit(listener: (ctx: InitContext, info: InitInfo) => void): () => void;
onUpdate(listener: (ctx: InitContext, info: UpdateInfo) => void): () => void;
onError(listener: (error: unknown) => void): () => void;
call<T = unknown>(method: string, params?: unknown[]): Promise<T>;
// the seven portable facade methods (below)
openIndexData(options: OpenIndexDataOptions): Promise<boolean | undefined>;
openObject(objectId: string | number): Promise<boolean | undefined>;
openLocation(options: OpenLocationOptions): Promise<void>;
openHitListByIds(options: OpenHitListByIdsOptions): Promise<void>;
refreshHitListObjects(ids: Array<string | number>): Promise<boolean | undefined>;
getSelectedObjects(): Promise<SelectedObjectRef[]>;
resetSessionTimeout(): Promise<void>;
getWebclientApi(): WebclientApi;
getRichClientApi(): RichClientApi;
destroy(): void;
}
2. Members
| Member | Kind | Description |
|---|---|---|
|
property |
The init promise — |
|
method |
Subscribe to init emissions — |
|
method |
The reserved update slot — |
|
method |
Subscribe to failures — |
|
method |
The thin method passthrough — |
|
method |
Open the index data of an object — openIndexData. |
|
method |
Open the object in its natural view — openObject. |
|
method |
Open the object’s location — openLocation. |
|
method |
Open a mixed hit list — openHitListByIds (the fire-and-forget quirk lives there). |
|
method |
Refresh objects in open hit lists — refreshHitListObjects. |
|
method |
The selected objects, normalized in both clients — getSelectedObjects. |
|
method |
Reset the session timeout — resetSessionTimeout (documented no-op in the rich client). |
|
method |
The webclient handle — getWebclientApi (the seven endpoints + raw |
|
method |
The rich-client handle — getRichClientApi (the full |
|
method |
Stops polling, removes listeners, detaches the wire (described below). |
The seven portable facade methods route through the same dispatch core as
call(method, params) (a single shared table), so the typed facade and the
string-based call cannot drift — the wire posts, the resolve values, and the
error paths are identical.
3. destroy()
destroy(): void
Tears the dashlet down: stops the detection polling and the warm-up timer, removes the host-callback handler, destroys the webclient wire, and clears the shared message sink only if it still belongs to this instance (a sibling dashlet on the same window may have replaced it).
Ordering guarantee: if the dashlet is still in the detecting state, destroy
settles the init promise as standalone first (the promise must still
resolve — it never hangs) and only then flips the state to destroyed.
Subsequent method calls on a destroyed dashlet reject with a plain
Error('dashlet destroyed').