@odoo/owl 3.0.0-alpha.2 → 3.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/compile_templates.mjs +2430 -2532
  2. package/dist/compiler.js +2371 -0
  3. package/dist/owl.cjs.js +6571 -6615
  4. package/dist/owl.cjs.runtime.js +4070 -0
  5. package/dist/owl.es.js +6559 -6599
  6. package/dist/owl.es.runtime.js +4026 -0
  7. package/dist/owl.iife.js +6572 -6616
  8. package/dist/owl.iife.min.js +1 -1
  9. package/dist/owl.iife.runtime.js +4074 -0
  10. package/dist/owl.iife.runtime.min.js +1 -0
  11. package/dist/types/common/owl_error.d.ts +3 -3
  12. package/dist/types/common/types.d.ts +0 -28
  13. package/dist/types/common/utils.d.ts +8 -8
  14. package/dist/types/compiler/code_generator.d.ts +134 -152
  15. package/dist/types/compiler/index.d.ts +13 -13
  16. package/dist/types/compiler/inline_expressions.d.ts +58 -59
  17. package/dist/types/compiler/parser.d.ts +175 -178
  18. package/dist/types/compiler/standalone/index.d.ts +2 -2
  19. package/dist/types/compiler/standalone/setup_jsdom.d.ts +1 -1
  20. package/dist/types/index.d.ts +1 -1
  21. package/dist/types/owl.d.ts +703 -665
  22. package/dist/types/runtime/app.d.ts +55 -62
  23. package/dist/types/runtime/blockdom/attributes.d.ts +6 -6
  24. package/dist/types/runtime/blockdom/block_compiler.d.ts +21 -21
  25. package/dist/types/runtime/blockdom/config.d.ts +8 -8
  26. package/dist/types/runtime/blockdom/event_catcher.d.ts +7 -7
  27. package/dist/types/runtime/blockdom/events.d.ts +8 -8
  28. package/dist/types/runtime/blockdom/html.d.ts +17 -17
  29. package/dist/types/runtime/blockdom/index.d.ts +25 -26
  30. package/dist/types/runtime/blockdom/list.d.ts +18 -18
  31. package/dist/types/runtime/blockdom/multi.d.ts +17 -17
  32. package/dist/types/runtime/blockdom/text.d.ts +26 -26
  33. package/dist/types/runtime/blockdom/toggler.d.ts +17 -17
  34. package/dist/types/runtime/component.d.ts +17 -28
  35. package/dist/types/runtime/component_node.d.ts +57 -83
  36. package/dist/types/runtime/context.d.ts +36 -0
  37. package/dist/types/runtime/event_handling.d.ts +1 -1
  38. package/dist/types/runtime/hooks.d.ts +32 -57
  39. package/dist/types/runtime/index.d.ts +46 -35
  40. package/dist/types/runtime/lifecycle_hooks.d.ts +10 -12
  41. package/dist/types/runtime/model.d.ts +48 -0
  42. package/dist/types/runtime/plugin_hooks.d.ts +6 -0
  43. package/dist/types/runtime/plugin_manager.d.ts +34 -0
  44. package/dist/types/runtime/plugins.d.ts +36 -39
  45. package/dist/types/runtime/portal.d.ts +12 -15
  46. package/dist/types/runtime/props.d.ts +21 -0
  47. package/dist/types/runtime/reactivity/async_computed.d.ts +1 -0
  48. package/dist/types/runtime/reactivity/computations.d.ts +33 -0
  49. package/dist/types/runtime/reactivity/computed.d.ts +6 -0
  50. package/dist/types/runtime/reactivity/derived.d.ts +7 -0
  51. package/dist/types/runtime/reactivity/effect.d.ts +1 -0
  52. package/dist/types/runtime/reactivity/proxy.d.ts +47 -0
  53. package/dist/types/runtime/reactivity/reactivity.d.ts +46 -0
  54. package/dist/types/runtime/reactivity/signal.d.ts +31 -0
  55. package/dist/types/runtime/reactivity/signals.d.ts +30 -0
  56. package/dist/types/runtime/reactivity/state.d.ts +48 -0
  57. package/dist/types/runtime/reactivity.d.ts +12 -1
  58. package/dist/types/runtime/registry.d.ts +24 -15
  59. package/dist/types/runtime/rendering/error_handling.d.ts +13 -0
  60. package/dist/types/runtime/rendering/fibers.d.ts +37 -0
  61. package/dist/types/runtime/rendering/scheduler.d.ts +21 -0
  62. package/dist/types/runtime/rendering/template_helpers.d.ts +51 -0
  63. package/dist/types/runtime/resource.d.ts +18 -0
  64. package/dist/types/runtime/signals.d.ts +6 -4
  65. package/dist/types/runtime/status.d.ts +11 -10
  66. package/dist/types/runtime/suspense.d.ts +5 -0
  67. package/dist/types/runtime/template_set.d.ts +36 -40
  68. package/dist/types/runtime/types.d.ts +67 -0
  69. package/dist/types/runtime/utils.d.ts +24 -25
  70. package/dist/types/runtime/validation.d.ts +19 -36
  71. package/dist/types/version.d.ts +1 -1
  72. package/package.json +22 -19
@@ -1,62 +1,55 @@
1
- import { Component, ComponentConstructor, Props } from "./component";
2
- import { ComponentNode } from "./component_node";
3
- import { handleError } from "./error_handling";
4
- import { Fiber, RootFiber, MountOptions } from "./fibers";
5
- import { Scheduler } from "./scheduler";
6
- import { TemplateSet, TemplateSetConfig } from "./template_set";
7
- import { validateTarget } from "./utils";
8
- import { toRaw, reactive } from "./reactivity";
9
- import { PluginCtor, PluginManager } from "./plugins";
10
- export interface Env {
11
- [key: string]: any;
12
- }
13
- export interface RootConfig<P, E> {
14
- props?: P;
15
- env?: E;
16
- Plugins?: PluginCtor[];
17
- }
18
- export interface AppConfig<P, E> extends TemplateSetConfig, RootConfig<P, E> {
19
- name?: string;
20
- test?: boolean;
21
- warnIfNoStaticProps?: boolean;
22
- }
23
- declare global {
24
- interface Window {
25
- __OWL_DEVTOOLS__: {
26
- apps: Set<App>;
27
- Fiber: typeof Fiber;
28
- RootFiber: typeof RootFiber;
29
- toRaw: typeof toRaw;
30
- reactive: typeof reactive;
31
- };
32
- }
33
- }
34
- interface Root<P extends Props, E> {
35
- node: ComponentNode<P, E>;
36
- mount(target: HTMLElement | ShadowRoot, options?: MountOptions): Promise<Component<P, E>>;
37
- destroy(): void;
38
- }
39
- export declare class App<T extends abstract new (...args: any) => any = any, P extends object = any, E = any> extends TemplateSet {
40
- static validateTarget: typeof validateTarget;
41
- static apps: Set<App<any, any, any>>;
42
- static version: string;
43
- name: string;
44
- Root: ComponentConstructor<P, E>;
45
- props: P;
46
- env: E;
47
- scheduler: Scheduler;
48
- subRoots: Set<ComponentNode>;
49
- root: ComponentNode<P, E> | null;
50
- warnIfNoStaticProps: boolean;
51
- pluginManager: PluginManager;
52
- constructor(Root: ComponentConstructor<P, E>, config?: AppConfig<P, E>);
53
- mount(target: HTMLElement | ShadowRoot, options?: MountOptions): Promise<Component<P, E> & InstanceType<T>>;
54
- createRoot<Props extends object, SubEnv = any>(Root: ComponentConstructor<Props, E>, config?: RootConfig<Props, SubEnv>): Root<Props, SubEnv>;
55
- makeNode(Component: ComponentConstructor, props: any): ComponentNode;
56
- mountNode(node: ComponentNode, target: HTMLElement | ShadowRoot, options?: MountOptions): any;
57
- destroy(): void;
58
- createComponent<P extends Props>(name: string | null, isStatic: boolean, hasSlotsProp: boolean, hasDynamicPropList: boolean, propList: string[]): (props: P, key: string, ctx: ComponentNode, parent: any, C: any) => any;
59
- handleError(...args: Parameters<typeof handleError>): void;
60
- }
61
- export declare function mount<T extends abstract new (...args: any) => any = any, P extends object = any, E = any>(C: T & ComponentConstructor<P, E>, target: HTMLElement, config?: AppConfig<P, E> & MountOptions): Promise<Component<P, E> & InstanceType<T>>;
62
- export {};
1
+ import { ComponentConstructor } from "./component";
2
+ import { ComponentNode } from "./component_node";
3
+ import { PluginConstructor, PluginManager } from "./plugin_manager";
4
+ import { GetProps } from "./props";
5
+ import { proxy, toRaw } from "./reactivity/proxy";
6
+ import { handleError } from "./rendering/error_handling";
7
+ import { Fiber, MountOptions, RootFiber } from "./rendering/fibers";
8
+ import { Scheduler } from "./rendering/scheduler";
9
+ import { Resource } from "./resource";
10
+ import { TemplateSet, TemplateSetConfig } from "./template_set";
11
+ import { validateTarget } from "./utils";
12
+ type ComponentInstance<C extends ComponentConstructor> = C extends new (...args: any) => infer T ? T : never;
13
+ interface RootConfig<P> {
14
+ props?: P;
15
+ }
16
+ export interface AppConfig extends TemplateSetConfig {
17
+ name?: string;
18
+ plugins?: PluginConstructor[] | Resource<PluginConstructor>;
19
+ config?: Record<string, any>;
20
+ test?: boolean;
21
+ }
22
+ declare global {
23
+ interface Window {
24
+ __OWL_DEVTOOLS__: {
25
+ apps: Set<App>;
26
+ Fiber: typeof Fiber;
27
+ RootFiber: typeof RootFiber;
28
+ toRaw: typeof toRaw;
29
+ proxy: typeof proxy;
30
+ };
31
+ }
32
+ }
33
+ type MountTarget = HTMLElement | ShadowRoot;
34
+ interface Root<T extends ComponentConstructor> {
35
+ node: ComponentNode;
36
+ promise: Promise<ComponentInstance<T>>;
37
+ mount(target: MountTarget, options?: MountOptions): Promise<ComponentInstance<T>>;
38
+ destroy(): void;
39
+ }
40
+ export declare class App extends TemplateSet {
41
+ static validateTarget: typeof validateTarget;
42
+ static apps: Set<App>;
43
+ static version: string;
44
+ name: string;
45
+ scheduler: Scheduler;
46
+ roots: Set<Root<any>>;
47
+ pluginManager: PluginManager;
48
+ constructor(config?: AppConfig);
49
+ createRoot<T extends ComponentConstructor>(Root: T, config?: RootConfig<GetProps<ComponentInstance<T>>>): Root<T>;
50
+ private mountNode;
51
+ destroy(): void;
52
+ handleError(...args: Parameters<typeof handleError>): void;
53
+ }
54
+ export declare function mount<T extends ComponentConstructor>(C: T, target: MountTarget, config?: AppConfig & RootConfig<GetProps<ComponentInstance<T>>> & MountOptions): Promise<ComponentInstance<T>>;
55
+ export {};
@@ -1,6 +1,6 @@
1
- import type { Setter } from "./block_compiler";
2
- export declare function createAttrUpdater(attr: string): Setter<HTMLElement>;
3
- export declare function attrsSetter(this: HTMLElement, attrs: any): void;
4
- export declare function attrsUpdater(this: HTMLElement, attrs: any, oldAttrs: any): void;
5
- export declare function setClass(this: HTMLElement, val: any): void;
6
- export declare function updateClass(this: HTMLElement, val: any, oldVal: any): void;
1
+ import type { Setter } from "./block_compiler";
2
+ export declare function createAttrUpdater(attr: string): Setter<HTMLElement>;
3
+ export declare function attrsSetter(this: HTMLElement, attrs: any): void;
4
+ export declare function attrsUpdater(this: HTMLElement, attrs: any, oldAttrs: any): void;
5
+ export declare function setClass(this: HTMLElement, val: any): void;
6
+ export declare function updateClass(this: HTMLElement, val: any, oldVal: any): void;
@@ -1,21 +1,21 @@
1
- import type { VNode } from "./index";
2
- declare type BlockType = (data?: any[], children?: VNode[]) => VNode;
3
- /**
4
- * Compiling blocks is a multi-step process:
5
- *
6
- * 1. build an IntermediateTree from the HTML element. This intermediate tree
7
- * is a binary tree structure that encode dynamic info sub nodes, and the
8
- * path required to reach them
9
- * 2. process the tree to build a block context, which is an object that aggregate
10
- * all dynamic info in a list, and also, all ref indexes.
11
- * 3. process the context to build appropriate builder/setter functions
12
- * 4. make a dynamic block class, which will efficiently collect references and
13
- * create/update dynamic locations/children
14
- *
15
- * @param str
16
- * @returns a new block type, that can build concrete blocks
17
- */
18
- export declare function createBlock(str: string): BlockType;
19
- export declare type Setter<T = any> = (this: T, value: any) => void;
20
- export declare type Updater<T = any> = (this: T, value: any, oldVal: any) => void;
21
- export {};
1
+ import type { VNode } from "./index";
2
+ type BlockType = (data?: any[], children?: VNode[]) => VNode;
3
+ /**
4
+ * Compiling blocks is a multi-step process:
5
+ *
6
+ * 1. build an IntermediateTree from the HTML element. This intermediate tree
7
+ * is a binary tree structure that encode dynamic info sub nodes, and the
8
+ * path required to reach them
9
+ * 2. process the tree to build a block context, which is an object that aggregate
10
+ * all dynamic info in a list, and also, all ref indexes.
11
+ * 3. process the context to build appropriate builder/setter functions
12
+ * 4. make a dynamic block class, which will efficiently collect references and
13
+ * create/update dynamic locations/children
14
+ *
15
+ * @param str
16
+ * @returns a new block type, that can build concrete blocks
17
+ */
18
+ export declare function createBlock(str: string): BlockType;
19
+ export type Setter<T = any> = (this: T, value: any) => void;
20
+ export type Updater<T = any> = (this: T, value: any, oldVal: any) => void;
21
+ export {};
@@ -1,8 +1,8 @@
1
- export declare function filterOutModifiersFromData(dataList: any[]): {
2
- modifiers: string[];
3
- data: any[];
4
- };
5
- export declare const config: {
6
- shouldNormalizeDom: boolean;
7
- mainEventHandler: (data: any, ev: Event, currentTarget?: EventTarget | null | undefined) => boolean;
8
- };
1
+ export declare function filterOutModifiersFromData(dataList: any[]): {
2
+ modifiers: string[];
3
+ data: any[];
4
+ };
5
+ export declare const config: {
6
+ shouldNormalizeDom: boolean;
7
+ mainEventHandler: (data: any, ev: Event, currentTarget?: EventTarget | null) => boolean;
8
+ };
@@ -1,7 +1,7 @@
1
- import type { VNode } from "./index";
2
- declare type EventsSpec = {
3
- [name: string]: number;
4
- };
5
- declare type Catcher = (child: VNode, handlers: any[]) => VNode;
6
- export declare function createCatcher(eventsSpec: EventsSpec): Catcher;
7
- export {};
1
+ import type { VNode } from "./index";
2
+ type EventsSpec = {
3
+ [name: string]: number;
4
+ };
5
+ type Catcher = (child: VNode, handlers: any[]) => VNode;
6
+ export declare function createCatcher(eventsSpec: EventsSpec): Catcher;
7
+ export {};
@@ -1,8 +1,8 @@
1
- declare type EventHandlerSetter = (this: HTMLElement, data: any) => void;
2
- interface EventHandlerCreator {
3
- setup: EventHandlerSetter;
4
- update: EventHandlerSetter;
5
- remove: (this: HTMLElement) => void;
6
- }
7
- export declare function createEventHandler(rawEvent: string): EventHandlerCreator;
8
- export {};
1
+ type EventHandlerSetter = (this: HTMLElement, data: any) => void;
2
+ interface EventHandlerCreator {
3
+ setup: EventHandlerSetter;
4
+ update: EventHandlerSetter;
5
+ remove: (this: HTMLElement) => void;
6
+ }
7
+ export declare function createEventHandler(rawEvent: string): EventHandlerCreator;
8
+ export {};
@@ -1,17 +1,17 @@
1
- import type { VNode } from "./index";
2
- declare class VHtml {
3
- html: string;
4
- parentEl?: HTMLElement | undefined;
5
- content: ChildNode[];
6
- constructor(html: string);
7
- mount(parent: HTMLElement, afterNode: Node | null): void;
8
- moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
9
- moveBeforeVNode(other: VHtml | null, afterNode: Node | null): void;
10
- patch(other: VHtml): void;
11
- beforeRemove(): void;
12
- remove(): void;
13
- firstNode(): Node;
14
- toString(): string;
15
- }
16
- export declare function html(str: string): VNode<VHtml>;
17
- export {};
1
+ import type { VNode } from "./index";
2
+ declare class VHtml {
3
+ html: string;
4
+ parentEl?: HTMLElement | undefined;
5
+ content: ChildNode[];
6
+ constructor(html: string);
7
+ mount(parent: HTMLElement, afterNode: Node | null): void;
8
+ moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
9
+ moveBeforeVNode(other: VHtml | null, afterNode: Node | null): void;
10
+ patch(other: VHtml): void;
11
+ beforeRemove(): void;
12
+ remove(): void;
13
+ firstNode(): Node;
14
+ toString(): string;
15
+ }
16
+ export declare function html(str: string): VNode<VHtml>;
17
+ export {};
@@ -1,26 +1,25 @@
1
- export { config } from "./config";
2
- export { toggler } from "./toggler";
3
- export { createBlock } from "./block_compiler";
4
- export { list } from "./list";
5
- export { multi } from "./multi";
6
- export { text, comment } from "./text";
7
- export { html } from "./html";
8
- export { createCatcher } from "./event_catcher";
9
- export interface VNode<T = any> {
10
- mount(parent: HTMLElement, afterNode: Node | null): void;
11
- moveBeforeDOMNode(node: Node | null, parent?: HTMLElement): void;
12
- moveBeforeVNode(other: T | null, afterNode: Node | null): void;
13
- patch(other: T, withBeforeRemove: boolean): void;
14
- beforeRemove(): void;
15
- remove(): void;
16
- firstNode(): Node | undefined;
17
- el?: undefined | HTMLElement | Text;
18
- parentEl?: undefined | HTMLElement;
19
- isOnlyChild?: boolean | undefined;
20
- key?: any;
21
- }
22
- export declare type BDom = VNode<any>;
23
- export declare function mount(vnode: VNode, fixture: HTMLElement, afterNode?: Node | null): void;
24
- export declare function patch(vnode1: VNode, vnode2: VNode, withBeforeRemove?: boolean): void;
25
- export declare function remove(vnode: VNode, withBeforeRemove?: boolean): void;
26
- export declare function withKey(vnode: VNode, key: any): VNode<any>;
1
+ export { config } from "./config";
2
+ export { toggler } from "./toggler";
3
+ export { createBlock } from "./block_compiler";
4
+ export { list } from "./list";
5
+ export { multi } from "./multi";
6
+ export { text, comment } from "./text";
7
+ export { html } from "./html";
8
+ export { createCatcher } from "./event_catcher";
9
+ export interface VNode<T = any> {
10
+ mount(parent: HTMLElement, afterNode: Node | null): void;
11
+ moveBeforeDOMNode(node: Node | null, parent?: HTMLElement): void;
12
+ moveBeforeVNode(other: T | null, afterNode: Node | null): void;
13
+ patch(other: T, withBeforeRemove: boolean): void;
14
+ beforeRemove(): void;
15
+ remove(): void;
16
+ firstNode(): Node | undefined;
17
+ el?: undefined | HTMLElement | Text;
18
+ parentEl?: undefined | HTMLElement;
19
+ isOnlyChild?: boolean | undefined;
20
+ key?: any;
21
+ }
22
+ export type BDom = VNode<any>;
23
+ export declare function mount(vnode: VNode, fixture: HTMLElement, afterNode?: Node | null): void;
24
+ export declare function patch(vnode1: VNode, vnode2: VNode, withBeforeRemove?: boolean): void;
25
+ export declare function remove(vnode: VNode, withBeforeRemove?: boolean): void;
@@ -1,18 +1,18 @@
1
- import type { VNode } from "./index";
2
- declare class VList {
3
- children: VNode[];
4
- anchor: Node | undefined;
5
- parentEl?: HTMLElement | undefined;
6
- isOnlyChild?: boolean | undefined;
7
- constructor(children: VNode[]);
8
- mount(parent: HTMLElement, afterNode: Node | null): void;
9
- moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
10
- moveBeforeVNode(other: VList | null, afterNode: Node | null): void;
11
- patch(other: VList, withBeforeRemove: boolean): void;
12
- beforeRemove(): void;
13
- remove(): void;
14
- firstNode(): Node | undefined;
15
- toString(): string;
16
- }
17
- export declare function list(children: VNode[]): VNode<VList>;
18
- export {};
1
+ import type { VNode } from "./index";
2
+ declare class VList {
3
+ children: VNode[];
4
+ anchor: Node | undefined;
5
+ parentEl?: HTMLElement | undefined;
6
+ isOnlyChild?: boolean | undefined;
7
+ constructor(children: VNode[]);
8
+ mount(parent: HTMLElement, afterNode: Node | null): void;
9
+ moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
10
+ moveBeforeVNode(other: VList | null, afterNode: Node | null): void;
11
+ patch(other: VList, withBeforeRemove: boolean): void;
12
+ beforeRemove(): void;
13
+ remove(): void;
14
+ firstNode(): Node | undefined;
15
+ toString(): string;
16
+ }
17
+ export declare function list(children: VNode[]): VNode<VList>;
18
+ export {};
@@ -1,17 +1,17 @@
1
- import type { VNode } from "./index";
2
- export declare class VMulti {
3
- children: (VNode | undefined)[];
4
- anchors?: Node[] | undefined;
5
- parentEl?: HTMLElement | undefined;
6
- isOnlyChild?: boolean | undefined;
7
- constructor(children: (VNode | undefined)[]);
8
- mount(parent: HTMLElement, afterNode: Node | null): void;
9
- moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
10
- moveBeforeVNode(other: VMulti | null, afterNode: Node | null): void;
11
- patch(other: VMulti, withBeforeRemove: boolean): void;
12
- beforeRemove(): void;
13
- remove(): void;
14
- firstNode(): Node | undefined;
15
- toString(): string;
16
- }
17
- export declare function multi(children: (VNode | undefined)[]): VNode<VMulti>;
1
+ import type { VNode } from "./index";
2
+ export declare class VMulti {
3
+ children: (VNode | undefined)[];
4
+ anchors?: Node[] | undefined;
5
+ parentEl?: HTMLElement | undefined;
6
+ isOnlyChild?: boolean | undefined;
7
+ constructor(children: (VNode | undefined)[]);
8
+ mount(parent: HTMLElement, afterNode: Node | null): void;
9
+ moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
10
+ moveBeforeVNode(other: VMulti | null, afterNode: Node | null): void;
11
+ patch(other: VMulti, withBeforeRemove: boolean): void;
12
+ beforeRemove(): void;
13
+ remove(): void;
14
+ firstNode(): Node | undefined;
15
+ toString(): string;
16
+ }
17
+ export declare function multi(children: (VNode | undefined)[]): VNode<VMulti>;
@@ -1,26 +1,26 @@
1
- import type { VNode } from "./index";
2
- declare abstract class VSimpleNode {
3
- text: string | String;
4
- parentEl?: HTMLElement | undefined;
5
- el?: any;
6
- constructor(text: string | String);
7
- mountNode(node: Node, parent: HTMLElement, afterNode: Node | null): void;
8
- moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
9
- moveBeforeVNode(other: VText | null, afterNode: Node | null): void;
10
- beforeRemove(): void;
11
- remove(): void;
12
- firstNode(): Node;
13
- toString(): string | String;
14
- }
15
- declare class VText extends VSimpleNode {
16
- mount(parent: HTMLElement, afterNode: Node | null): void;
17
- patch(other: VText): void;
18
- }
19
- declare class VComment extends VSimpleNode {
20
- mount(parent: HTMLElement, afterNode: Node | null): void;
21
- patch(): void;
22
- }
23
- export declare function text(str: string | String): VNode<VText>;
24
- export declare function comment(str: string): VNode<VComment>;
25
- export declare function toText(value: any): string;
26
- export {};
1
+ import type { VNode } from "./index";
2
+ declare abstract class VSimpleNode {
3
+ text: string | String;
4
+ parentEl?: HTMLElement | undefined;
5
+ el?: any;
6
+ constructor(text: string | String);
7
+ mountNode(node: Node, parent: HTMLElement, afterNode: Node | null): void;
8
+ moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
9
+ moveBeforeVNode(other: VText | null, afterNode: Node | null): void;
10
+ beforeRemove(): void;
11
+ remove(): void;
12
+ firstNode(): Node;
13
+ toString(): string | String;
14
+ }
15
+ declare class VText extends VSimpleNode {
16
+ mount(parent: HTMLElement, afterNode: Node | null): void;
17
+ patch(other: VText): void;
18
+ }
19
+ declare class VComment extends VSimpleNode {
20
+ mount(parent: HTMLElement, afterNode: Node | null): void;
21
+ patch(): void;
22
+ }
23
+ export declare function text(str: string | String): VNode<VText>;
24
+ export declare function comment(str: string): VNode<VComment>;
25
+ export declare function toText(value: any): string;
26
+ export {};
@@ -1,17 +1,17 @@
1
- import type { VNode } from "./index";
2
- declare class VToggler {
3
- key: string;
4
- child: VNode;
5
- parentEl?: HTMLElement | undefined;
6
- constructor(key: string, child: VNode);
7
- mount(parent: HTMLElement, afterNode: Node | null): void;
8
- moveBeforeDOMNode(node: Node | null, parent?: HTMLElement): void;
9
- moveBeforeVNode(other: VToggler | null, afterNode: Node | null): void;
10
- patch(other: VToggler, withBeforeRemove: boolean): void;
11
- beforeRemove(): void;
12
- remove(): void;
13
- firstNode(): Node | undefined;
14
- toString(): string;
15
- }
16
- export declare function toggler(key: string, child: VNode): VNode<VToggler>;
17
- export {};
1
+ import type { VNode } from "./index";
2
+ declare class VToggler {
3
+ key: string;
4
+ child: VNode;
5
+ parentEl?: HTMLElement | undefined;
6
+ constructor(key: string, child: VNode);
7
+ mount(parent: HTMLElement, afterNode: Node | null): void;
8
+ moveBeforeDOMNode(node: Node | null, parent?: HTMLElement): void;
9
+ moveBeforeVNode(other: VToggler | null, afterNode: Node | null): void;
10
+ patch(other: VToggler, withBeforeRemove: boolean): void;
11
+ beforeRemove(): void;
12
+ remove(): void;
13
+ firstNode(): Node | undefined;
14
+ toString(): string;
15
+ }
16
+ export declare function toggler(key: string, child: VNode): VNode<VToggler>;
17
+ export {};
@@ -1,28 +1,17 @@
1
- import { Schema } from "./validation";
2
- import type { ComponentNode } from "./component_node";
3
- import type { PluginManager } from "./plugins";
4
- export declare type Props = {
5
- [key: string]: any;
6
- };
7
- interface StaticComponentProperties {
8
- template: string;
9
- defaultProps?: any;
10
- props?: Schema;
11
- components?: {
12
- [componentName: string]: ComponentConstructor;
13
- };
14
- }
15
- export declare type ComponentConstructor<P extends Props = any, Plugins = any, E = any> = (new (props: P, env: E, plugins: Plugins, node: ComponentNode) => Component<P, Plugins, E>) & StaticComponentProperties;
16
- export declare class Component<Props = any, Plugins = PluginManager["plugins"], Env = any> {
17
- static template: string;
18
- static props?: Schema;
19
- static defaultProps?: any;
20
- props: Props;
21
- env: Env;
22
- plugins: Plugins;
23
- __owl__: ComponentNode;
24
- constructor(props: Props, env: Env, plugins: Plugins, node: ComponentNode);
25
- setup(): void;
26
- render(deep?: boolean): void;
27
- }
28
- export {};
1
+ import type { ComponentNode } from "./component_node";
2
+ interface StaticComponentProperties {
3
+ template: string;
4
+ components?: {
5
+ [componentName: string]: ComponentConstructor;
6
+ };
7
+ }
8
+ export interface ComponentConstructor extends StaticComponentProperties {
9
+ new (node: ComponentNode): Component;
10
+ }
11
+ export declare class Component {
12
+ static template: string;
13
+ __owl__: ComponentNode;
14
+ constructor(node: ComponentNode);
15
+ setup(): void;
16
+ }
17
+ export {};