| 51 | } |
| 52 | |
| 53 | export class Simulator { |
| 54 | readonly emitter = createEventBus('Simulator') |
| 55 | |
| 56 | isSimulator = true |
| 57 | |
| 58 | readonly project: Project |
| 59 | |
| 60 | readonly designer: Designer |
| 61 | |
| 62 | readonly viewport: Viewport |
| 63 | |
| 64 | readonly scroller: Scroller |
| 65 | |
| 66 | iframe?: HTMLElement |
| 67 | |
| 68 | autoRender = true |
| 69 | |
| 70 | get editor() { |
| 71 | return this.designer.editor |
| 72 | } |
| 73 | |
| 74 | @computed |
| 75 | get renderEnv(): string { |
| 76 | return this.get('renderEnv') || 'default' |
| 77 | } |
| 78 | |
| 79 | @computed |
| 80 | get device(): string { |
| 81 | return this.get('device') || 'default' |
| 82 | } |
| 83 | |
| 84 | @computed |
| 85 | get locale(): string { |
| 86 | return this.get('locale') |
| 87 | } |
| 88 | |
| 89 | @computed |
| 90 | get deviceClassName(): string | undefined { |
| 91 | return this.get('deviceClassName') |
| 92 | } |
| 93 | |
| 94 | @computed |
| 95 | get designMode(): DesignMode { |
| 96 | // renderer 依赖 |
| 97 | return this.get('designMode') || 'design' |
| 98 | } |
| 99 | |
| 100 | @computed |
| 101 | get dataSourceEngine(): DataSourceEngine | undefined { |
| 102 | // renderer 依赖 |
| 103 | return config.get('dataSourceEngine') |
| 104 | } |
| 105 | |
| 106 | get enableStrictNotFoundMode(): any { |
| 107 | return config.get('enableStrictNotFoundMode') ?? false |
| 108 | } |
| 109 | |
| 110 | get excuteLifeCycleInDesignMode(): any { |
nothing calls this directly
no test coverage detected