import type { Theme } from '@mui/material';
import type { LiteralUnion } from 'type-fest';

export type $TSFixMe = any;
export type Translations = Record<string, Record<string, any>>;
export type Locale = LiteralUnion<'en' | 'zh', string>;

// TODO: 以下为 blocklet 应用专属的全局对象类型，可以更加具体
export type User = Record<string, any>;
export type Session = Record<string, any>;
export type Passport = Record<string, any>;
export type Blocklet = {
  appId: string;
  appIds: string[];
  appPid: string;
  appName: string;
  appDescription: string;
  appLogo: string;
  appLogoRect: string;
  appUrl: string;
  isComponent: boolean;
  prefix: string;
  groupPrefix: string;
  pageGroup: string;
  version: string;
  mode: string;
  tenantMode: 'single' | 'multiple';
  theme: {
    prefer?: 'light' | 'dark' | 'system';
    light: Theme;
    dark: Theme;
  };
  navigation: $TSFixMe[];
  preferences: Record<string, any>;
  languages: {
    code: string;
    name: string;
  }[];
  passportColor: string;
  componentMountPoints: $TSFixMe[];
  alsoKnownAs: string[];
  trustedFactories: string[];
  [x: string]: any;
};
