mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
add some docstring
This commit is contained in:
@@ -68,6 +68,9 @@ export class EventBus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove all subscriptions.
|
||||||
|
*/
|
||||||
clear() {
|
clear() {
|
||||||
this.subscriptions = {};
|
this.subscriptions = {};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,10 @@ export function htmlTrim(s: string): string {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function idGenerator(): (() => number) {
|
/**
|
||||||
|
* Create a function that will generate unique id numbers
|
||||||
|
*/
|
||||||
|
export function idGenerator(): () => number {
|
||||||
let nextID = 1;
|
let nextID = 1;
|
||||||
return () => nextID++;
|
return () => nextID++;
|
||||||
}
|
}
|
||||||
@@ -88,6 +91,12 @@ interface Tree<T> {
|
|||||||
children: T[];
|
children: T[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find a node in a tree.
|
||||||
|
*
|
||||||
|
* This will traverse the tree (depth first) and return the first child that
|
||||||
|
* matches the predicate, if any
|
||||||
|
*/
|
||||||
export function findInTree<T extends Tree<T>>(
|
export function findInTree<T extends Tree<T>>(
|
||||||
tree: T,
|
tree: T,
|
||||||
predicate: (t: T) => boolean
|
predicate: (t: T) => boolean
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ import { rpcMixin } from "./rpc_mixin";
|
|||||||
import { Widget } from "../widget";
|
import { Widget } from "../widget";
|
||||||
import { View } from "../views/view";
|
import { View } from "../views/view";
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Types
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
export type Context = { [key: string]: any };
|
export type Context = { [key: string]: any };
|
||||||
|
|
||||||
export interface CommonActionInfo {
|
export interface CommonActionInfo {
|
||||||
|
|||||||
Reference in New Issue
Block a user