mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] typing: make app and mount method properly generic
This commit is contained in:
committed by
Aaron Bohy
parent
add5fdd737
commit
ff734c706c
@@ -4,9 +4,25 @@ import type { ComponentNode } from "./component_node";
|
||||
// Component Class
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
type Props = { [key: string]: any };
|
||||
|
||||
interface StaticComponentProperties {
|
||||
template: string;
|
||||
defaultProps?: any;
|
||||
props?: any;
|
||||
}
|
||||
|
||||
export type ComponentConstructor<P extends Props = any, E = any> = (new (
|
||||
props: P,
|
||||
env: E,
|
||||
node: ComponentNode
|
||||
) => Component<P, E>) &
|
||||
StaticComponentProperties;
|
||||
|
||||
export class Component<Props = any, Env = any> {
|
||||
static template: string = "";
|
||||
static props?: any;
|
||||
static defaultProps?: any;
|
||||
|
||||
props: Props;
|
||||
env: Env;
|
||||
|
||||
Reference in New Issue
Block a user