@odoo/owl 3.0.0-alpha.13 → 3.0.0-alpha.14

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 (54) hide show
  1. package/dist/compile_templates.mjs +2442 -2435
  2. package/dist/owl.cjs.js +6459 -6381
  3. package/dist/owl.es.js +6459 -6379
  4. package/dist/owl.iife.js +6459 -6381
  5. package/dist/owl.iife.min.js +1 -1
  6. package/dist/types/common/owl_error.d.ts +3 -3
  7. package/dist/types/common/utils.d.ts +8 -8
  8. package/dist/types/compiler/code_generator.d.ts +150 -150
  9. package/dist/types/compiler/index.d.ts +13 -13
  10. package/dist/types/compiler/inline_expressions.d.ts +59 -59
  11. package/dist/types/compiler/parser.d.ts +171 -171
  12. package/dist/types/compiler/standalone/index.d.ts +2 -2
  13. package/dist/types/compiler/standalone/setup_jsdom.d.ts +1 -1
  14. package/dist/types/index.d.ts +1 -1
  15. package/dist/types/owl.d.ts +669 -671
  16. package/dist/types/runtime/app.d.ts +57 -57
  17. package/dist/types/runtime/blockdom/attributes.d.ts +6 -6
  18. package/dist/types/runtime/blockdom/block_compiler.d.ts +21 -21
  19. package/dist/types/runtime/blockdom/config.d.ts +8 -8
  20. package/dist/types/runtime/blockdom/event_catcher.d.ts +7 -7
  21. package/dist/types/runtime/blockdom/events.d.ts +8 -8
  22. package/dist/types/runtime/blockdom/html.d.ts +17 -17
  23. package/dist/types/runtime/blockdom/index.d.ts +26 -26
  24. package/dist/types/runtime/blockdom/list.d.ts +18 -18
  25. package/dist/types/runtime/blockdom/multi.d.ts +17 -17
  26. package/dist/types/runtime/blockdom/text.d.ts +26 -26
  27. package/dist/types/runtime/blockdom/toggler.d.ts +17 -17
  28. package/dist/types/runtime/component.d.ts +18 -18
  29. package/dist/types/runtime/component_node.d.ts +61 -61
  30. package/dist/types/runtime/event_handling.d.ts +1 -1
  31. package/dist/types/runtime/hooks.d.ts +34 -33
  32. package/dist/types/runtime/index.d.ts +43 -43
  33. package/dist/types/runtime/lifecycle_hooks.d.ts +10 -10
  34. package/dist/types/runtime/plugins.d.ts +30 -29
  35. package/dist/types/runtime/portal.d.ts +12 -12
  36. package/dist/types/runtime/props.d.ts +21 -17
  37. package/dist/types/runtime/reactivity/computations.d.ts +31 -31
  38. package/dist/types/runtime/reactivity/computed.d.ts +7 -7
  39. package/dist/types/runtime/reactivity/effect.d.ts +2 -2
  40. package/dist/types/runtime/reactivity/proxy.d.ts +48 -48
  41. package/dist/types/runtime/reactivity/signal.d.ts +18 -18
  42. package/dist/types/runtime/registry.d.ts +20 -20
  43. package/dist/types/runtime/rendering/error_handling.d.ts +13 -13
  44. package/dist/types/runtime/rendering/fibers.d.ts +37 -37
  45. package/dist/types/runtime/rendering/scheduler.d.ts +21 -21
  46. package/dist/types/runtime/rendering/template_helpers.d.ts +50 -50
  47. package/dist/types/runtime/resource.d.ts +15 -15
  48. package/dist/types/runtime/status.d.ts +9 -9
  49. package/dist/types/runtime/template_set.d.ts +39 -39
  50. package/dist/types/runtime/types.d.ts +62 -31
  51. package/dist/types/runtime/utils.d.ts +24 -24
  52. package/dist/types/runtime/validation.d.ts +19 -2
  53. package/dist/types/version.d.ts +1 -1
  54. package/package.json +13 -11
@@ -1,37 +1,37 @@
1
- import { BDom } from "../blockdom";
2
- import type { ComponentNode } from "../component_node";
3
- export declare function makeChildFiber(node: ComponentNode, parent: Fiber): Fiber;
4
- export declare function makeRootFiber(node: ComponentNode): Fiber;
5
- export declare class Fiber {
6
- node: ComponentNode;
7
- bdom: BDom | null;
8
- root: RootFiber | null;
9
- parent: Fiber | null;
10
- children: Fiber[];
11
- appliedToDom: boolean;
12
- deep: boolean;
13
- childrenMap: ComponentNode["children"];
14
- constructor(node: ComponentNode, parent: Fiber | null);
15
- render(): void;
16
- _render(): void;
17
- }
18
- export declare class RootFiber extends Fiber {
19
- counter: number;
20
- willPatch: Fiber[];
21
- patched: Fiber[];
22
- mounted: Fiber[];
23
- locked: boolean;
24
- complete(): void;
25
- setCounter(newValue: number): void;
26
- }
27
- type Position = "first-child" | "last-child";
28
- export interface MountOptions {
29
- position?: Position;
30
- }
31
- export declare class MountFiber extends RootFiber {
32
- target: HTMLElement;
33
- position: Position;
34
- constructor(node: ComponentNode, target: HTMLElement, options?: MountOptions);
35
- complete(): void;
36
- }
37
- export {};
1
+ import { BDom } from "../blockdom";
2
+ import type { ComponentNode } from "../component_node";
3
+ export declare function makeChildFiber(node: ComponentNode, parent: Fiber): Fiber;
4
+ export declare function makeRootFiber(node: ComponentNode): Fiber;
5
+ export declare class Fiber {
6
+ node: ComponentNode;
7
+ bdom: BDom | null;
8
+ root: RootFiber | null;
9
+ parent: Fiber | null;
10
+ children: Fiber[];
11
+ appliedToDom: boolean;
12
+ deep: boolean;
13
+ childrenMap: ComponentNode["children"];
14
+ constructor(node: ComponentNode, parent: Fiber | null);
15
+ render(): void;
16
+ _render(): void;
17
+ }
18
+ export declare class RootFiber extends Fiber {
19
+ counter: number;
20
+ willPatch: Fiber[];
21
+ patched: Fiber[];
22
+ mounted: Fiber[];
23
+ locked: boolean;
24
+ complete(): void;
25
+ setCounter(newValue: number): void;
26
+ }
27
+ type Position = "first-child" | "last-child";
28
+ export interface MountOptions {
29
+ position?: Position;
30
+ }
31
+ export declare class MountFiber extends RootFiber {
32
+ target: HTMLElement;
33
+ position: Position;
34
+ constructor(node: ComponentNode, target: HTMLElement, options?: MountOptions);
35
+ complete(): void;
36
+ }
37
+ export {};
@@ -1,21 +1,21 @@
1
- import type { ComponentNode } from "../component_node";
2
- import { Fiber, RootFiber } from "./fibers";
3
- export declare class Scheduler {
4
- static requestAnimationFrame: ((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame;
5
- tasks: Set<RootFiber>;
6
- requestAnimationFrame: Window["requestAnimationFrame"];
7
- frame: number;
8
- delayedRenders: Fiber[];
9
- cancelledNodes: Set<ComponentNode>;
10
- processing: boolean;
11
- constructor();
12
- addFiber(fiber: Fiber): void;
13
- scheduleDestroy(node: ComponentNode): void;
14
- /**
15
- * Process all current tasks. This only applies to the fibers that are ready.
16
- * Other tasks are left unchanged.
17
- */
18
- flush(): void;
19
- processTasks(): void;
20
- processFiber(fiber: RootFiber): void;
21
- }
1
+ import type { ComponentNode } from "../component_node";
2
+ import { Fiber, RootFiber } from "./fibers";
3
+ export declare class Scheduler {
4
+ static requestAnimationFrame: ((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame;
5
+ tasks: Set<RootFiber>;
6
+ requestAnimationFrame: Window["requestAnimationFrame"];
7
+ frame: number;
8
+ delayedRenders: Fiber[];
9
+ cancelledNodes: Set<ComponentNode>;
10
+ processing: boolean;
11
+ constructor();
12
+ addFiber(fiber: Fiber): void;
13
+ scheduleDestroy(node: ComponentNode): void;
14
+ /**
15
+ * Process all current tasks. This only applies to the fibers that are ready.
16
+ * Other tasks are left unchanged.
17
+ */
18
+ flush(): void;
19
+ processTasks(): void;
20
+ processFiber(fiber: RootFiber): void;
21
+ }
@@ -1,50 +1,50 @@
1
- import { BDom, toggler, createCatcher } from "../blockdom";
2
- import { markRaw } from "../reactivity/state";
3
- import { OwlError } from "../../common/owl_error";
4
- /**
5
- * This file contains utility functions that will be injected in each template,
6
- * to perform various useful tasks in the compiled code.
7
- */
8
- declare function withDefault(value: any, defaultValue: any): any;
9
- declare function callSlot(ctx: any, parent: any, key: string, name: string, dynamic: boolean, extra: any, defaultContent?: (ctx: any, node: any, key: string) => BDom): BDom;
10
- declare function capture(ctx: any): any;
11
- declare function withKey(elem: any, k: string): any;
12
- declare function prepareList(collection: unknown): [unknown[], unknown[], number, undefined[]];
13
- declare function setContextValue(ctx: {
14
- [key: string]: any;
15
- }, key: string, value: any): void;
16
- declare function toNumber(val: string): number | string;
17
- declare function shallowEqual(l1: any[], l2: any[]): boolean;
18
- declare class LazyValue {
19
- fn: any;
20
- ctx: any;
21
- component: any;
22
- node: any;
23
- key: any;
24
- constructor(fn: any, ctx: any, component: any, node: any, key: any);
25
- evaluate(): any;
26
- toString(): any;
27
- }
28
- export declare function safeOutput(value: any, defaultValue?: any): ReturnType<typeof toggler>;
29
- declare function createRef(ref: any): (el: HTMLElement | null, previousEl: HTMLElement | null) => void;
30
- declare function modelExpr(value: any): any;
31
- export declare const helpers: {
32
- withDefault: typeof withDefault;
33
- zero: symbol;
34
- isBoundary: symbol;
35
- callSlot: typeof callSlot;
36
- capture: typeof capture;
37
- withKey: typeof withKey;
38
- prepareList: typeof prepareList;
39
- setContextValue: typeof setContextValue;
40
- shallowEqual: typeof shallowEqual;
41
- toNumber: typeof toNumber;
42
- LazyValue: typeof LazyValue;
43
- safeOutput: typeof safeOutput;
44
- createCatcher: typeof createCatcher;
45
- markRaw: typeof markRaw;
46
- OwlError: typeof OwlError;
47
- createRef: typeof createRef;
48
- modelExpr: typeof modelExpr;
49
- };
50
- export {};
1
+ import { BDom, toggler, createCatcher } from "../blockdom";
2
+ import { markRaw } from "../reactivity/proxy";
3
+ import { OwlError } from "../../common/owl_error";
4
+ /**
5
+ * This file contains utility functions that will be injected in each template,
6
+ * to perform various useful tasks in the compiled code.
7
+ */
8
+ declare function withDefault(value: any, defaultValue: any): any;
9
+ declare function callSlot(ctx: any, parent: any, key: string, name: string, dynamic: boolean, extra: any, defaultContent?: (ctx: any, node: any, key: string) => BDom): BDom;
10
+ declare function capture(ctx: any): any;
11
+ declare function withKey(elem: any, k: string): any;
12
+ declare function prepareList(collection: unknown): [unknown[], unknown[], number, undefined[]];
13
+ declare function setContextValue(ctx: {
14
+ [key: string]: any;
15
+ }, key: string, value: any): void;
16
+ declare function toNumber(val: string): number | string;
17
+ declare function shallowEqual(l1: any[], l2: any[]): boolean;
18
+ declare class LazyValue {
19
+ fn: any;
20
+ ctx: any;
21
+ component: any;
22
+ node: any;
23
+ key: any;
24
+ constructor(fn: any, ctx: any, component: any, node: any, key: any);
25
+ evaluate(): any;
26
+ toString(): any;
27
+ }
28
+ export declare function safeOutput(value: any, defaultValue?: any): ReturnType<typeof toggler>;
29
+ declare function createRef(ref: any): (el: HTMLElement | null, previousEl: HTMLElement | null) => void;
30
+ declare function modelExpr(value: any): any;
31
+ export declare const helpers: {
32
+ withDefault: typeof withDefault;
33
+ zero: symbol;
34
+ isBoundary: symbol;
35
+ callSlot: typeof callSlot;
36
+ capture: typeof capture;
37
+ withKey: typeof withKey;
38
+ prepareList: typeof prepareList;
39
+ setContextValue: typeof setContextValue;
40
+ shallowEqual: typeof shallowEqual;
41
+ toNumber: typeof toNumber;
42
+ LazyValue: typeof LazyValue;
43
+ safeOutput: typeof safeOutput;
44
+ createCatcher: typeof createCatcher;
45
+ markRaw: typeof markRaw;
46
+ OwlError: typeof OwlError;
47
+ createRef: typeof createRef;
48
+ modelExpr: typeof modelExpr;
49
+ };
50
+ export {};
@@ -1,15 +1,15 @@
1
- interface ResourceOptions<T> {
2
- name?: string;
3
- validation?: T;
4
- }
5
- export declare class Resource<T> {
6
- private _items;
7
- private _validation?;
8
- constructor(options?: ResourceOptions<T>);
9
- items: import("./reactivity/signal").ReactiveValue<T[]>;
10
- add(item: T, sequence?: number): Resource<T>;
11
- remove(item: T): Resource<T>;
12
- has(item: T): boolean;
13
- }
14
- export declare function useResource<T>(r: Resource<T>, elements: T[]): void;
15
- export {};
1
+ interface ResourceOptions<T> {
2
+ name?: string;
3
+ validation?: T;
4
+ }
5
+ export declare class Resource<T> {
6
+ private _items;
7
+ private _validation?;
8
+ constructor(options?: ResourceOptions<T>);
9
+ items: import("./reactivity/signal").ReactiveValue<T[]>;
10
+ add(item: T, sequence?: number): Resource<T>;
11
+ delete(item: T): Resource<T>;
12
+ has(item: T): boolean;
13
+ }
14
+ export declare function useResource<T>(r: Resource<T>, elements: T[]): void;
15
+ export {};
@@ -1,9 +1,9 @@
1
- export declare const enum STATUS {
2
- NEW = 0,
3
- MOUNTED = 1,
4
- CANCELLED = 2,
5
- DESTROYED = 3
6
- }
7
- type STATUS_DESCR = "new" | "started" | "mounted" | "cancelled" | "destroyed";
8
- export declare function status(): () => STATUS_DESCR;
9
- export {};
1
+ export declare const enum STATUS {
2
+ NEW = 0,
3
+ MOUNTED = 1,// is ready, and in DOM. It has a valid el
4
+ CANCELLED = 2,
5
+ DESTROYED = 3
6
+ }
7
+ type STATUS_DESCR = "new" | "started" | "mounted" | "cancelled" | "destroyed";
8
+ export declare function status(): () => STATUS_DESCR;
9
+ export {};
@@ -1,39 +1,39 @@
1
- import { compile, CustomDirectives, Template, TemplateFunction } from "../compiler";
2
- import { Portal } from "./portal";
3
- export interface TemplateSetConfig {
4
- dev?: boolean;
5
- translatableAttributes?: string[];
6
- translateFn?: (s: string, translationCtx: string) => string;
7
- templates?: string | Document | Record<string, string>;
8
- getTemplate?: (s: string) => Element | Function | string | void;
9
- customDirectives?: CustomDirectives;
10
- globalValues?: object;
11
- }
12
- export declare class TemplateSet {
13
- static registerTemplate(name: string, fn: TemplateFunction): void;
14
- dev: boolean;
15
- rawTemplates: typeof globalTemplates;
16
- templates: {
17
- [name: string]: Template;
18
- };
19
- getRawTemplate?: (s: string) => Element | Function | string | void;
20
- translateFn?: (s: string, translationCtx: string) => string;
21
- translatableAttributes?: string[];
22
- Portal: typeof Portal;
23
- customDirectives: CustomDirectives;
24
- runtimeUtils: object;
25
- hasGlobalValues: boolean;
26
- constructor(config?: TemplateSetConfig);
27
- addTemplate(name: string, template: string | Element): void;
28
- addTemplates(xml: string | Document): void;
29
- getTemplate(name: string): Template;
30
- _compileTemplate(name: string, template: string | Element): ReturnType<typeof compile>;
31
- callTemplate(owner: any, subTemplate: string, ctx: any, parent: any, key: any): any;
32
- }
33
- export declare const globalTemplates: {
34
- [key: string]: string | Element | TemplateFunction;
35
- };
36
- export declare function xml(...args: Parameters<typeof String.raw>): string;
37
- export declare namespace xml {
38
- var nextId: number;
39
- }
1
+ import { compile, CustomDirectives, Template, TemplateFunction } from "../compiler";
2
+ import { Portal } from "./portal";
3
+ export interface TemplateSetConfig {
4
+ dev?: boolean;
5
+ translatableAttributes?: string[];
6
+ translateFn?: (s: string, translationCtx: string) => string;
7
+ templates?: string | Document | Record<string, string>;
8
+ getTemplate?: (s: string) => Element | Function | string | void;
9
+ customDirectives?: CustomDirectives;
10
+ globalValues?: object;
11
+ }
12
+ export declare class TemplateSet {
13
+ static registerTemplate(name: string, fn: TemplateFunction): void;
14
+ dev: boolean;
15
+ rawTemplates: typeof globalTemplates;
16
+ templates: {
17
+ [name: string]: Template;
18
+ };
19
+ getRawTemplate?: (s: string) => Element | Function | string | void;
20
+ translateFn?: (s: string, translationCtx: string) => string;
21
+ translatableAttributes?: string[];
22
+ Portal: typeof Portal;
23
+ customDirectives: CustomDirectives;
24
+ runtimeUtils: object;
25
+ hasGlobalValues: boolean;
26
+ constructor(config?: TemplateSetConfig);
27
+ addTemplate(name: string, template: string | Element): void;
28
+ addTemplates(xml: string | Document): void;
29
+ getTemplate(name: string): Template;
30
+ _compileTemplate(name: string, template: string | Element): ReturnType<typeof compile>;
31
+ callTemplate(owner: any, subTemplate: string, ctx: any, parent: any, key: any): any;
32
+ }
33
+ export declare const globalTemplates: {
34
+ [key: string]: string | Element | TemplateFunction;
35
+ };
36
+ export declare function xml(...args: Parameters<typeof String.raw>): string;
37
+ export declare namespace xml {
38
+ var nextId: number;
39
+ }
@@ -1,31 +1,62 @@
1
- import { ReactiveValue, Signal } from "./reactivity/signal";
2
- export type ValidationIssue = {};
3
- export type Validator = (value: any) => ValidationIssue[];
4
- type Constructor = {
5
- new (...args: any[]): any;
6
- };
7
- export declare const any: any;
8
- export declare const boolean: boolean;
9
- export declare const number: number;
10
- export declare const string: string;
11
- export declare function array<T>(type?: T): T[];
12
- export declare function func<P extends any[] = [], R = void>(parameters: P, result: R): (...parameters: P) => R;
13
- export declare function instanceOf<T extends Constructor>(type: T): InstanceType<T>;
14
- type OptionalKeyedObject<K extends string> = {
15
- [P in K as K extends `${infer Name}?` ? Name : never]?: any;
16
- };
17
- type RequiredKeyedObject<K extends string> = {
18
- [P in K as K extends `${string}?` ? never : K]: any;
19
- };
20
- type KeyedObject<K extends string> = OptionalKeyedObject<K> & RequiredKeyedObject<K>;
21
- export declare function keys<K extends string>(...keys: K[]): KeyedObject<K>;
22
- export declare function literal<T>(literal: T): T;
23
- export declare function object<T extends Record<PropertyKey, any>>(shape?: T): T;
24
- export declare function optional<T>(type: T): T | undefined;
25
- export declare function record<V>(valueType: V): Record<PropertyKey, V>;
26
- export declare function tuple<T extends any[]>(...types: T): T;
27
- export declare function constructor<T extends Constructor>(type: T): T;
28
- export declare function union<T extends any[]>(...types: T): T extends Array<infer E> ? E : never;
29
- export declare function signal<T>(type: T): Signal<T>;
30
- export declare function reactiveValue<T>(type: T): ReactiveValue<T>;
31
- export {};
1
+ import { ReactiveValue, Signal } from "./reactivity/signal";
2
+ type Constructor = {
3
+ new (...args: any[]): any;
4
+ };
5
+ export type GetOptionalEntries<T> = {
6
+ [K in keyof T as K extends `${infer P}?` ? P : never]?: T[K];
7
+ };
8
+ export type GetRequiredEntries<T> = {
9
+ [K in keyof T as K extends `${string}?` ? never : K]: T[K];
10
+ };
11
+ export type PrettifyShape<T> = T extends Function ? T : {
12
+ [K in keyof T]: T[K];
13
+ };
14
+ type ResolveOptionalEntries<T> = PrettifyShape<GetRequiredEntries<T> & GetOptionalEntries<T>>;
15
+ export type KeyedObject<K extends string[]> = {
16
+ [P in K[number]]: any;
17
+ };
18
+ type ResolveShapedObject<T extends {}> = PrettifyShape<ResolveOptionalEntries<T>>;
19
+ export type ResolveObjectType<T extends {}> = ResolveShapedObject<T extends string[] ? KeyedObject<T> : T>;
20
+ declare function arrayType(): any[];
21
+ declare function arrayType<T>(elementType: T): T[];
22
+ declare function constructorType<T extends Constructor>(constructor: T): T;
23
+ declare function customValidator<T>(type: T, validator: (value: T) => boolean, errorMessage?: string): T;
24
+ declare function functionType(): (...parameters: any[]) => any;
25
+ declare function functionType<const P extends any[]>(parameters: P): (...parameters: P) => void;
26
+ declare function functionType<const P extends any[], R>(parameters: P, result: R): (...parameters: P) => R;
27
+ declare function instanceType<T extends Constructor>(constructor: T): InstanceType<T>;
28
+ type LiteralTypes = number | string | boolean | null | undefined;
29
+ declare function literalType<const T extends LiteralTypes>(literal: T): T;
30
+ declare function objectType(): Record<string, any>;
31
+ declare function objectType<const Keys extends string[]>(keys: Keys): ResolveOptionalEntries<KeyedObject<Keys>>;
32
+ declare function objectType<Shape extends {}>(shape: Shape): ResolveOptionalEntries<Shape>;
33
+ declare function promiseType(): Promise<void>;
34
+ declare function promiseType<T>(type: T): Promise<T>;
35
+ declare function recordType(): Record<PropertyKey, any>;
36
+ declare function recordType<V>(valueType: V): Record<PropertyKey, V>;
37
+ declare function tuple<const T extends any[]>(types: T): T;
38
+ declare function union<T extends any[]>(types: T): T extends Array<infer E> ? E : never;
39
+ declare function signalType(): Signal<any>;
40
+ declare function signalType<T>(type: T): Signal<T>;
41
+ declare function reactiveValueType(): ReactiveValue<any>;
42
+ declare function reactiveValueType<T>(type: T): ReactiveValue<T>;
43
+ export declare const types: {
44
+ any: any;
45
+ array: typeof arrayType;
46
+ boolean: boolean;
47
+ constructor: typeof constructorType;
48
+ customValidator: typeof customValidator;
49
+ function: typeof functionType;
50
+ instanceOf: typeof instanceType;
51
+ literal: typeof literalType;
52
+ number: number;
53
+ object: typeof objectType;
54
+ promise: typeof promiseType;
55
+ reactiveValue: typeof reactiveValueType;
56
+ record: typeof recordType;
57
+ signal: typeof signalType;
58
+ string: string;
59
+ tuple: typeof tuple;
60
+ union: typeof union;
61
+ };
62
+ export {};
@@ -1,24 +1,24 @@
1
- export type Callback = () => void;
2
- /**
3
- * Creates a batched version of a callback so that all calls to it in the same
4
- * microtick will only call the original callback once.
5
- *
6
- * @param callback the callback to batch
7
- * @returns a batched version of the original callback
8
- */
9
- export declare function batched(callback: Callback): Callback;
10
- /**
11
- * Determine whether the given element is contained in its ownerDocument:
12
- * either directly or with a shadow root in between.
13
- */
14
- export declare function inOwnerDocument(el?: HTMLElement): boolean;
15
- export declare function validateTarget(target: HTMLElement | ShadowRoot): void;
16
- export declare class EventBus extends EventTarget {
17
- trigger(name: string, payload?: any): void;
18
- }
19
- export declare function whenReady(fn?: any): Promise<void>;
20
- export declare class Markup extends String {
21
- }
22
- export declare function htmlEscape(str: any): Markup;
23
- export declare function markup(strings: TemplateStringsArray, ...placeholders: unknown[]): Markup;
24
- export declare function markup(value: string): Markup;
1
+ export type Callback = () => void;
2
+ /**
3
+ * Creates a batched version of a callback so that all calls to it in the same
4
+ * microtick will only call the original callback once.
5
+ *
6
+ * @param callback the callback to batch
7
+ * @returns a batched version of the original callback
8
+ */
9
+ export declare function batched(callback: Callback): Callback;
10
+ /**
11
+ * Determine whether the given element is contained in its ownerDocument:
12
+ * either directly or with a shadow root in between.
13
+ */
14
+ export declare function inOwnerDocument(el?: HTMLElement): boolean;
15
+ export declare function validateTarget(target: HTMLElement | ShadowRoot): void;
16
+ export declare class EventBus extends EventTarget {
17
+ trigger(name: string, payload?: any): void;
18
+ }
19
+ export declare function whenReady(fn?: any): Promise<void>;
20
+ export declare class Markup extends String {
21
+ }
22
+ export declare function htmlEscape(str: any): Markup;
23
+ export declare function markup(strings: TemplateStringsArray, ...placeholders: unknown[]): Markup;
24
+ export declare function markup(value: string): Markup;
@@ -1,2 +1,19 @@
1
- export declare function assertType(value: any, validation: any): void;
2
- export declare function validateType(value: any, validation: any): any[];
1
+ export interface ValidationIssue {
2
+ message: string;
3
+ path?: PropertyKey[];
4
+ received?: any;
5
+ [K: string]: any;
6
+ }
7
+ export interface ValidationContext {
8
+ addIssue(issue: ValidationIssue): void;
9
+ isValid: boolean;
10
+ issueDepth: number;
11
+ mergeIssues(issues: ValidationIssue[]): void;
12
+ path: PropertyKey[];
13
+ validate(type: any): void;
14
+ value: any;
15
+ withIssues(issues: ValidationIssue[]): ValidationContext;
16
+ withKey(key: PropertyKey): ValidationContext;
17
+ }
18
+ export declare function assertType(value: any, validation: any, errorMessage?: string): void;
19
+ export declare function validateType(value: any, validation: any): ValidationIssue[];
@@ -1 +1 @@
1
- export declare const version = "3.0.0-alpha";
1
+ export declare const version = "3.0.0-alpha";
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@odoo/owl",
3
- "version": "3.0.0-alpha.13",
3
+ "version": "3.0.0-alpha.14",
4
4
  "description": "Odoo Web Library (OWL)",
5
5
  "main": "dist/owl.cjs.js",
6
6
  "module": "dist/owl.es.js",
7
7
  "types": "dist/types/owl.d.ts",
8
+ "type": "module",
8
9
  "files": [
9
10
  "dist"
10
11
  ],
@@ -55,24 +56,24 @@
55
56
  "current-git-branch": "^1.1.0",
56
57
  "eslint": "8.31.0",
57
58
  "git-rev-sync": "^3.0.2",
58
- "github-api": "^3.3.0",
59
+ "github-api": "^3.4.0",
59
60
  "jest": "^29.7.0",
60
61
  "jest-diff": "^27.3.1",
61
62
  "jest-environment-jsdom": "^30.2.0",
62
63
  "npm-run-all": "^4.1.5",
63
- "prettier": "2.4.1",
64
- "rollup": "^2.56.3",
65
- "rollup-plugin-copy": "^3.3.0",
66
- "rollup-plugin-delete": "^2.0.0",
67
- "rollup-plugin-dts": "^4.2.2",
64
+ "prettier": "3.8.0",
65
+ "rollup": "^4.55.1",
66
+ "rollup-plugin-copy": "^3.5.0",
67
+ "rollup-plugin-delete": "^3.0.2",
68
+ "rollup-plugin-dts": "^6.3.0",
68
69
  "rollup-plugin-execute": "^1.1.1",
69
70
  "rollup-plugin-string": "^3.0.0",
70
- "@rollup/plugin-terser": "^0.3.0",
71
- "rollup-plugin-typescript2": "^0.31.1",
71
+ "@rollup/plugin-terser": "^0.4.4",
72
+ "rollup-plugin-typescript2": "^0.36.0",
72
73
  "source-map-support": "^0.5.10",
73
74
  "ts-jest": "^29.4.6",
74
75
  "@types/node": "^18.16.18",
75
- "typescript": "^4.9.5",
76
+ "typescript": "^5.9.3",
76
77
  "@types/jsdom": "^21.1.7"
77
78
  },
78
79
  "jest": {
@@ -100,7 +101,8 @@
100
101
  },
101
102
  "prettier": {
102
103
  "printWidth": 100,
103
- "endOfLine": "auto"
104
+ "endOfLine": "auto",
105
+ "trailingComma": "es5"
104
106
  },
105
107
  "dependencies": {
106
108
  "jsdom": "^25.0.1"