( windowId: string = getWindowId(), windowName: WindowName = getWindowName() )
| 34 | } |
| 35 | |
| 36 | export default async function initialize( |
| 37 | windowId: string = getWindowId(), |
| 38 | windowName: WindowName = getWindowName() |
| 39 | ) { |
| 40 | const renderer = new Renderer() |
| 41 | global.windowId = windowId |
| 42 | global.windowName = windowName |
| 43 | |
| 44 | const api = new ZuiApi() |
| 45 | const store = await initStore(api, renderer) |
| 46 | const asyncTasks = initAsyncTasks(renderer) |
| 47 | initDomainModels({store}) |
| 48 | initHandlers({ |
| 49 | transition: startTransition, |
| 50 | oldApi: api, |
| 51 | dispatch: store.dispatch, |
| 52 | waitForSelector: createWaitForSelector(store), |
| 53 | select: (fn) => fn(store.getState()), |
| 54 | invoke: invoke, |
| 55 | toast, |
| 56 | asyncTasks, |
| 57 | }) |
| 58 | |
| 59 | await initGlobals(store) |
| 60 | await initLake(store) |
| 61 | api.init(store.dispatch, store.getState) |
| 62 | initDOM() |
| 63 | initIpcListeners(store) |
| 64 | |
| 65 | ViewHandler.store = store |
| 66 | setMenuContext({select: (fn) => fn(store.getState()), api}) |
| 67 | initDebugGlobals(store, api) |
| 68 | initAutosave(store) |
| 69 | commands.setContext(store, api) |
| 70 | invoke("windowInitialized", global.windowId) |
| 71 | initializeTabs(store) |
| 72 | initializeMonaco() |
| 73 | initializePluginContextSync(store) |
| 74 | initResizeListener() |
| 75 | |
| 76 | return {store, api} |
| 77 | } |
nothing calls this directly
no test coverage detected