mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
add comments, add debug flag to environment
This commit is contained in:
@@ -3,7 +3,11 @@ import { idGenerator } from "./core/utils";
|
||||
import { WEnv } from "./core/widget";
|
||||
import { ActionManager, IActionManager } from "./services/action_manager";
|
||||
import { Ajax, IAjax } from "./services/ajax";
|
||||
import { Router, IRouter } from "./services/router";
|
||||
import { IRouter, Router } from "./services/router";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Types
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
export interface Menu {
|
||||
title: string;
|
||||
@@ -11,13 +15,23 @@ export interface Menu {
|
||||
}
|
||||
|
||||
export interface Env extends WEnv {
|
||||
// services
|
||||
actionManager: IActionManager;
|
||||
ajax: IAjax;
|
||||
router: IRouter;
|
||||
menus: Menu[];
|
||||
|
||||
// helpers
|
||||
rpc: IAjax["rpc"];
|
||||
|
||||
// configuration
|
||||
debug: boolean;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Code
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
export function makeEnvironment(): Env {
|
||||
const qweb = new QWeb();
|
||||
const router = new Router();
|
||||
@@ -33,13 +47,12 @@ export function makeEnvironment(): Env {
|
||||
qweb,
|
||||
getID: idGenerator(),
|
||||
|
||||
// services
|
||||
ajax,
|
||||
router,
|
||||
actionManager,
|
||||
menus,
|
||||
|
||||
// helpers
|
||||
rpc: ajax.rpc
|
||||
rpc: ajax.rpc,
|
||||
debug: false
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user