import type * as OpenFin from '../../OpenFin'; import { IdentityEvent, NamedEvent, PropagatedEvent } from './base'; import { PropagatedWindowEvent } from './window'; import { PropagatedViewEvent } from './view'; export type CrashedEvent = NamedEvent & { type: 'crashed'; reason: 'normal-termination' | 'abnormal-termination' | 'killed' | 'crashed' | 'still-running' | 'launch-failed' | 'out-of-memory' | 'integrity-failure'; exitCode: number; details: { reason: string; exitCode: number; }; }; export type FileDownloadLocationChangedEvent = NamedEvent & { type: 'file-download-location-changed'; }; export type RunRequestedEvent = IdentityEvent & { type: 'run-requested'; userAppConfigArgs: Record; manifest: OpenFin.ManifestInfo; }; export type TrayIconClickedEvent = IdentityEvent & { type: 'tray-icon-clicked'; button: 0 | 1 | 2; bounds: OpenFin.Rectangle; x: number; y: number; monitorInfo: any; }; export type WindowAlertRequestedEvent = NamedEvent & { type: 'window-alert-requested'; }; export type WindowCreatedEvent = NamedEvent & { type: 'window-created'; }; export type WindowEndLoadEvent = NamedEvent & { type: 'window-end-load'; }; export type WindowNotRespondingEvent = NamedEvent & { type: 'window-not-responding'; }; export type WindowRespondingEvent = NamedEvent & { type: 'window-responding'; }; export type WindowStartLoadEvent = NamedEvent & { type: 'window-start-load'; }; /** * A Window event that is natively published at the Application level (not Window). */ export type ApplicationWindowEvent = WindowAlertRequestedEvent | WindowCreatedEvent | WindowEndLoadEvent | WindowNotRespondingEvent | WindowRespondingEvent | WindowStartLoadEvent; export type ClosedEvent = IdentityEvent & { type: 'closed'; }; export type ApplicationConnectedEvent = IdentityEvent & { type: 'connected'; }; export type InitializedEvent = IdentityEvent & { type: 'initialized'; }; export type ManifestChangedEvent = IdentityEvent & { type: 'manifest-changed'; }; export type NotRespondingEvent = IdentityEvent & { type: 'not-responding'; }; export type RespondingEvent = IdentityEvent & { type: 'responding'; }; export type StartedEvent = IdentityEvent & { type: 'started'; }; /** * An Application event that does propagate to (republish on) parent topics. */ export type WillPropagateApplicationEvent = ClosedEvent | ApplicationConnectedEvent | CrashedEvent | InitializedEvent | ManifestChangedEvent | NotRespondingEvent | RespondingEvent | RunRequestedEvent | StartedEvent | TrayIconClickedEvent | FileDownloadLocationChangedEvent; export type ApplicationEvent = { topic: 'application'; } & (PropagatedViewEvent | PropagatedWindowEvent | ApplicationWindowEvent | WillPropagateApplicationEvent); export type ApplicationEventType = ApplicationEvent['type']; export type PropagatedApplicationEvent = PropagatedEvent<'application', WillPropagateApplicationEvent> | ApplicationWindowEvent; export type PropagatedApplicationEventType = PropagatedApplicationEvent['type'];