import type * as OpenFin from '../../OpenFin'; import { PropagatedApplicationEvent } from './application'; import { BaseEvent, IdentityEvent } from './base'; import { PropagatedViewEvent } from './view'; import { PropagatedWindowEvent } from './window'; import { AppVersionCompleteEvent, AppVersionErrorEvent, AppVersionProgressEvent, AppVersionRuntimeStatusEvent } from '../../OpenFin'; export type NotRequested = EventType extends `${infer U}-requested` ? never : EventType; export type ExcludeRequested = Extract; }>; export type IdleEvent = { type: 'idle-state-changed'; elapsedTime: number; isIdle: boolean; }; export type MonitorEvent = OpenFin.MonitorInfo & { type: 'monitor-info-changed'; }; export type SessionChangedEvent = { type: 'session-changed'; reason: 'lock' | 'unlock' | 'remote-connect' | 'remote-disconnect' | 'unknown'; }; export type AppVersionEvent = AppVersionProgressEvent | AppVersionRuntimeStatusEvent | AppVersionCompleteEvent | AppVersionErrorEvent; export type AppVersionEventType = AppVersionEvent['type']; export type IdEventType = WithId; export type WithId = `${T}.${string}`; export type WithoutId = T extends WithId ? U : never; export type AppVersionTypeFromIdEvent = Extract; }>; export type EventWithId = Event extends infer E extends { type: AppVersionEventType; } ? Omit & { type: WithId; topic: 'system'; appVersionId: string; } : never; export type AppVersionEventWithId = EventWithId; export type ApplicationCreatedEvent = IdentityEvent & { type: 'application-created'; }; export type DesktopIconClickedEvent = BaseEvent & { type: 'desktop-icon-clicked'; }; export type SystemShutdownEvent = BaseEvent & { type: 'system-shutdown'; }; export type SystemEvent = { topic: 'system'; } & (ExcludeRequested | PropagatedViewEvent | PropagatedApplicationEvent | ApplicationCreatedEvent | DesktopIconClickedEvent | IdleEvent | MonitorEvent | SessionChangedEvent | AppVersionEventWithId | SystemShutdownEvent); export type SystemEventType = SystemEvent['type'];