mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] typing: Component class should be generic on Props and Env
Otherwise, it prevents proper typing with typescript
This commit is contained in:
committed by
Aaron Bohy
parent
4f35f03986
commit
99b5e9ec55
@@ -1,19 +1,18 @@
|
||||
import type { Env } from "../app/app";
|
||||
import type { ComponentNode } from "./component_node";
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Component Class
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
export class Component {
|
||||
export class Component<Props = any, Env = any> {
|
||||
static template: string = "";
|
||||
static props?: any;
|
||||
|
||||
props: any;
|
||||
props: Props;
|
||||
env: Env;
|
||||
__owl__: ComponentNode;
|
||||
|
||||
constructor(props: any, env: Env, node: ComponentNode) {
|
||||
constructor(props: Props, env: Env, node: ComponentNode) {
|
||||
this.props = props;
|
||||
this.env = env;
|
||||
this.__owl__ = node;
|
||||
|
||||
Reference in New Issue
Block a user