PlatformManager.ts 491 B

12345678910111213141516171819
  1. export class PlatformManager {
  2. public static readonly PLATFORM_TYPE_TELEGRAM = "tg";
  3. public static readonly PLATFORM_TYPE_WEB = "web";
  4. private static _ins: PlatformManager = null!;
  5. public static get ins(): PlatformManager {
  6. return this._ins ??= new PlatformManager();
  7. }
  8. private platformType: string;
  9. public async getPlatformType(): Promise<string> {
  10. if (this.platformType) {
  11. return this.platformType;
  12. }
  13. return PlatformManager.PLATFORM_TYPE_WEB;
  14. }
  15. }