LaunchState.ts 767 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { AppKernel } from '../../../app/AppKernel';
  2. export enum LaunchStateId {
  3. CheckVersion = 'CheckVersion',
  4. HotUpdate = 'HotUpdate',
  5. PreloadLobby = 'PreloadLobby',
  6. EnterLobby = 'EnterLobby',
  7. Complete = 'Complete',
  8. Failed = 'Failed',
  9. }
  10. export interface LaunchProgress {
  11. state: LaunchStateId;
  12. title?: string;
  13. progress?: number;
  14. }
  15. export interface LaunchDialog {
  16. title: string;
  17. message: string,
  18. lblOK?: string,
  19. lblCancel?: string,
  20. }
  21. export interface LaunchContext {
  22. readonly kernel: AppKernel;
  23. error: unknown;
  24. progress(value: LaunchProgress): void;
  25. dialog(message: LaunchDialog): Promise<boolean>;
  26. }
  27. export interface LaunchState {
  28. readonly id: LaunchStateId;
  29. enter(context: LaunchContext): Promise<LaunchStateId | null>;
  30. }