import type * as OpenFin from '../../OpenFin'; import { NonPropagatedWebContentsEvent, WillPropagateWebContentsEvent } from './webcontents'; import { NamedEvent, PropagatedEvent } from './base'; export type BaseViewEvent = { target: OpenFin.Identity; viewIdentity: OpenFin.Identity; }; export type TargetChangedEvent = NamedEvent & { type: 'target-changed'; previousTarget: OpenFin.Identity; }; /** * A View event that does not propagate to (republish on) parent topics. */ export type NonPropagatedViewEvent = BaseViewEvent & NonPropagatedWebContentsEvent; export type AttachedEvent = NamedEvent & { type: 'attached'; }; export type CreatedEvent = NamedEvent & { type: 'created'; }; export type DestroyedEvent = NamedEvent & { type: 'destroyed'; }; export type HiddenEvent = NamedEvent & { type: 'hidden'; }; export type HotkeyEvent = NamedEvent & { type: 'hotkey'; }; export type ShownEvent = NamedEvent & { type: 'shown'; }; /** * A View event that does propagate to (republish on) parent topics. */ export type WillPropagateViewEvent = BaseViewEvent & (WillPropagateWebContentsEvent | AttachedEvent | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent); export type ViewEvent = { topic: 'view'; } & (NonPropagatedViewEvent | WillPropagateViewEvent); export type ViewEventType = ViewEvent['type']; export type PropagatedViewEvent = PropagatedEvent<'view', WillPropagateViewEvent>; export type PropagatedViewEventType = PropagatedViewEvent['type'];