| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import { UICachePolicy, UILayer } from '../framework/ui/UILayer';
- // viewId.StoreView
- export const UIViewID = {
- LoginView: 'LoginView',
- HomeView: 'HomeView',
- LoadingView: "LoadingView",
- } as const;
- export type UIViewID = typeof UIViewID[keyof typeof UIViewID];
- export interface UIViewConfig {
- id: UIViewID;
- prefabPath: string;
- layer: UILayer;
- bundle?: string;
- cache?: UICachePolicy;
- mutexGroup?: string;
- }
- /**
- * 项目全部 UIView 的静态配置。
- */
- export const UIViewConfigs: Record<string, UIViewConfig> = {
- [UIViewID.LoginView]: {
- id: UIViewID.LoginView,
- prefabPath: 'ui/login/LoginView',
- layer: UILayer.Page,
- },
- [UIViewID.HomeView]: {
- id: UIViewID.HomeView,
- prefabPath: 'ui/home/HomeView',
- layer: UILayer.Page,
- cache: UICachePolicy.Persist,
- },
- [UIViewID.LoadingView]: {
- id: UIViewID.LoadingView,
- prefabPath: 'ui/loading/LoadingView',
- layer: UILayer.Loading,
- cache: UICachePolicy.Persist,
- },
- };
- export function getUIViewConfig(viewId: UIViewID): UIViewConfig {
- return UIViewConfigs[viewId];
- }
|