@odoo/owl 3.0.0-alpha.34 → 3.0.0-alpha.36
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.
- package/dist/owl.cjs.js +178 -85
- package/dist/owl.es.js +178 -85
- package/dist/owl.iife.js +178 -85
- package/dist/owl.iife.min.js +9 -9
- package/dist/types/owl.d.ts +193 -107
- package/package.json +4 -4
package/dist/types/owl.d.ts
CHANGED
|
@@ -142,6 +142,150 @@ export interface ComputationAtom<T = any> extends Atom<T> {
|
|
|
142
142
|
state: ComputationState;
|
|
143
143
|
}
|
|
144
144
|
export declare function untrack<T>(fn: (...args: any[]) => T): T;
|
|
145
|
+
export type Constructor<T = any> = {
|
|
146
|
+
new (...args: any[]): T;
|
|
147
|
+
};
|
|
148
|
+
declare const hasDefault: unique symbol;
|
|
149
|
+
export type WithDefault<T> = T & {
|
|
150
|
+
[hasDefault]: T;
|
|
151
|
+
};
|
|
152
|
+
declare const isOptional: unique symbol;
|
|
153
|
+
export type Optional<T> = T & {
|
|
154
|
+
[isOptional]: T;
|
|
155
|
+
};
|
|
156
|
+
declare const typeBrand: unique symbol;
|
|
157
|
+
export type Type<T> = T & {
|
|
158
|
+
[typeBrand]: T;
|
|
159
|
+
/**
|
|
160
|
+
* Marks the type as optional: `undefined` passes validation, and an object
|
|
161
|
+
* key with an optional type may be omitted.
|
|
162
|
+
*/
|
|
163
|
+
optional(): Optional<T>;
|
|
164
|
+
/**
|
|
165
|
+
* Marks the type as optional, with a default value to fill it: the reader
|
|
166
|
+
* of the value always gets one (the default replaces an omitted value). The
|
|
167
|
+
* default can be given as a factory (`() => value`), which is called once
|
|
168
|
+
* per consumer, so mutable defaults ([], {}) are not shared. A default for
|
|
169
|
+
* a function type must use the factory form.
|
|
170
|
+
*/
|
|
171
|
+
optional(value: T extends Function ? () => T : T | (() => T)): WithDefault<T>;
|
|
172
|
+
};
|
|
173
|
+
export type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
174
|
+
export type HasDefault<T> = IsAny<T> extends true ? false : T extends {
|
|
175
|
+
[hasDefault]: any;
|
|
176
|
+
} ? true : false;
|
|
177
|
+
export type IsOptional<T> = IsAny<T> extends true ? false : T extends {
|
|
178
|
+
[isOptional]: any;
|
|
179
|
+
} ? true : false;
|
|
180
|
+
export type StripDefault<T> = T extends {
|
|
181
|
+
[hasDefault]: infer U;
|
|
182
|
+
} ? U : T;
|
|
183
|
+
export type StripOptional<T> = T extends {
|
|
184
|
+
[isOptional]: infer U;
|
|
185
|
+
} ? U | undefined : T;
|
|
186
|
+
export type StripType<T> = T extends {
|
|
187
|
+
[typeBrand]: infer U;
|
|
188
|
+
} ? U : T;
|
|
189
|
+
export type StripBrands<T> = StripType<StripDefault<StripOptional<T>>>;
|
|
190
|
+
export type StripBrandsAll<T extends any[]> = {
|
|
191
|
+
[K in keyof T]: StripBrands<T[K]>;
|
|
192
|
+
};
|
|
193
|
+
export type GetDefaultedKeys<T> = keyof T extends infer K ? K extends keyof T ? HasDefault<T[K]> extends true ? K : never : never : never;
|
|
194
|
+
export type GetOptionalEntries<T> = {
|
|
195
|
+
[K in keyof T as IsOptional<T[K]> extends true ? K : HasDefault<T[K]> extends true ? K : never]?: StripBrands<T[K]>;
|
|
196
|
+
};
|
|
197
|
+
export type GetRequiredEntries<T> = {
|
|
198
|
+
[K in keyof T as IsOptional<T[K]> extends true ? never : HasDefault<T[K]> extends true ? never : K]: StripBrands<T[K]>;
|
|
199
|
+
};
|
|
200
|
+
export type PrettifyShape<T> = T extends Function ? T : {
|
|
201
|
+
[K in keyof T]: T[K];
|
|
202
|
+
};
|
|
203
|
+
export type ResolveOptionalEntries<T> = PrettifyShape<GetRequiredEntries<T> & GetOptionalEntries<T>>;
|
|
204
|
+
export type ResolveReaderObjectType<T> = PrettifyShape<{
|
|
205
|
+
[K in keyof T as IsOptional<T[K]> extends true ? never : K]: StripBrands<T[K]>;
|
|
206
|
+
} & {
|
|
207
|
+
[K in keyof T as IsOptional<T[K]> extends true ? K : never]?: StripBrands<T[K]>;
|
|
208
|
+
}>;
|
|
209
|
+
export type KeyedObject<K extends string[]> = {
|
|
210
|
+
[P in K[number]]: any;
|
|
211
|
+
};
|
|
212
|
+
export type ResolveShapedObject<T extends {}> = PrettifyShape<ResolveOptionalEntries<T>>;
|
|
213
|
+
export type ResolveObjectType<T extends {}> = ResolveShapedObject<T extends string[] ? KeyedObject<T> : T>;
|
|
214
|
+
export type UnionToIntersection<U> = (U extends any ? (_: U) => any : never) extends (_: infer I) => void ? I : never;
|
|
215
|
+
/**
|
|
216
|
+
* Returns the default value factory attached to a type by `.optional(value)`,
|
|
217
|
+
* if any. This is how consumers (props, config, ...) resolve defaults at
|
|
218
|
+
* runtime: validation only runs in dev mode, so defaults are metadata on the
|
|
219
|
+
* schema, not a validation side-effect.
|
|
220
|
+
*/
|
|
221
|
+
export declare function getDefault(type: any): (() => any) | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Returns `value` with defaults from the schema filled in, at any depth: a
|
|
224
|
+
* default fires when the value at its schema position is `undefined`. The
|
|
225
|
+
* input is never mutated; objects are copied along the changed paths only, so
|
|
226
|
+
* if nothing is filled in, `value` is returned as is.
|
|
227
|
+
*
|
|
228
|
+
* Note that this only recurses through object shapes, tuples and arrays
|
|
229
|
+
* (unions are ambiguous, records have no fixed keys).
|
|
230
|
+
*/
|
|
231
|
+
export declare function applyDefaults<T>(value: unknown, type: T): StripBrands<T>;
|
|
232
|
+
declare function anyType(): Type<any>;
|
|
233
|
+
declare function booleanType(): Type<boolean>;
|
|
234
|
+
declare function numberType<T extends number = number>(): Type<T>;
|
|
235
|
+
declare function stringType<T extends string = string>(): Type<T>;
|
|
236
|
+
declare function arrayType(): Type<any[]>;
|
|
237
|
+
declare function arrayType<T>(): Type<T[]>;
|
|
238
|
+
declare function arrayType<T>(elementType: T): Type<StripBrands<T>[]>;
|
|
239
|
+
declare function constructorType<T extends Constructor>(constructor: T): Type<T>;
|
|
240
|
+
declare function customValidator<T>(type: T, validator: (value: StripBrands<T>) => boolean, errorMessage?: string): Type<StripBrands<T>>;
|
|
241
|
+
declare function functionType(): Type<(...parameters: any[]) => any>;
|
|
242
|
+
declare function functionType<const P extends any[]>(parameters: P): Type<(...parameters: StripBrandsAll<P>) => void>;
|
|
243
|
+
declare function functionType<const P extends any[], R>(): Type<(...parameters: P) => R>;
|
|
244
|
+
declare function functionType<const P extends any[], R>(parameters: P, result: R): Type<(...parameters: StripBrandsAll<P>) => StripBrands<R>>;
|
|
245
|
+
declare function instanceType<T extends Constructor>(constructor: T): Type<InstanceType<T>>;
|
|
246
|
+
declare function intersection<T extends any[]>(types: T): Type<UnionToIntersection<StripBrands<T[number]>>>;
|
|
247
|
+
export type LiteralTypes = number | string | boolean | null | undefined;
|
|
248
|
+
declare function literalType<const T extends LiteralTypes>(literal: T): Type<T>;
|
|
249
|
+
declare function literalSelection<const T extends LiteralTypes>(literals: T[]): Type<T>;
|
|
250
|
+
declare function objectType(): Type<Record<string, any>>;
|
|
251
|
+
declare function objectType<const Keys extends string[]>(keys: Keys): Type<ResolveOptionalEntries<KeyedObject<Keys>>>;
|
|
252
|
+
declare function objectType<Shape extends {}>(): Type<ResolveOptionalEntries<Shape>>;
|
|
253
|
+
declare function objectType<Shape extends {}>(shape: Shape): Type<ResolveOptionalEntries<Shape>>;
|
|
254
|
+
declare function strictObjectType<const Keys extends string[]>(keys: Keys): Type<ResolveOptionalEntries<KeyedObject<Keys>>>;
|
|
255
|
+
declare function strictObjectType<Shape extends {}>(shape: Shape): Type<ResolveOptionalEntries<Shape>>;
|
|
256
|
+
declare function promiseType(): Type<Promise<void>>;
|
|
257
|
+
declare function promiseType<T>(type: T): Type<Promise<StripBrands<T>>>;
|
|
258
|
+
declare function recordType(): Type<Record<PropertyKey, any>>;
|
|
259
|
+
declare function recordType<V>(valueType: V): Type<Record<PropertyKey, StripBrands<V>>>;
|
|
260
|
+
declare function tuple<const T extends any[]>(types: T): Type<StripBrandsAll<T>>;
|
|
261
|
+
declare function union<T extends any[]>(types: T): Type<StripBrands<T[number]>>;
|
|
262
|
+
declare function reactiveValueType(): Type<ReactiveValue<any>>;
|
|
263
|
+
declare function reactiveValueType<T>(): Type<ReactiveValue<T>>;
|
|
264
|
+
declare function reactiveValueType<T>(type: T): Type<ReactiveValue<StripBrands<T>>>;
|
|
265
|
+
declare function ref(): Type<HTMLElement | null>;
|
|
266
|
+
declare function ref<T extends Constructor<HTMLElement>>(type: T): Type<InstanceType<T> | null>;
|
|
267
|
+
declare const types: {
|
|
268
|
+
and: typeof intersection;
|
|
269
|
+
any: typeof anyType;
|
|
270
|
+
array: typeof arrayType;
|
|
271
|
+
boolean: typeof booleanType;
|
|
272
|
+
constructor: typeof constructorType;
|
|
273
|
+
customValidator: typeof customValidator;
|
|
274
|
+
function: typeof functionType;
|
|
275
|
+
instanceOf: typeof instanceType;
|
|
276
|
+
literal: typeof literalType;
|
|
277
|
+
number: typeof numberType;
|
|
278
|
+
object: typeof objectType;
|
|
279
|
+
or: typeof union;
|
|
280
|
+
promise: typeof promiseType;
|
|
281
|
+
record: typeof recordType;
|
|
282
|
+
ref: typeof ref;
|
|
283
|
+
selection: typeof literalSelection;
|
|
284
|
+
signal: typeof reactiveValueType;
|
|
285
|
+
strictObject: typeof strictObjectType;
|
|
286
|
+
string: typeof stringType;
|
|
287
|
+
tuple: typeof tuple;
|
|
288
|
+
};
|
|
145
289
|
export interface ResourceOptions<T> {
|
|
146
290
|
name?: string;
|
|
147
291
|
validation?: T;
|
|
@@ -149,16 +293,17 @@ export interface ResourceOptions<T> {
|
|
|
149
293
|
export interface ResourceAddOptions {
|
|
150
294
|
sequence?: number;
|
|
151
295
|
}
|
|
296
|
+
export type Item<T> = StripBrands<T>;
|
|
152
297
|
export declare class Resource<T> {
|
|
153
298
|
private _items;
|
|
154
299
|
private _name?;
|
|
155
300
|
private _validation?;
|
|
156
301
|
constructor(options?: ResourceOptions<T>);
|
|
157
|
-
items: ReactiveValue<T[]
|
|
158
|
-
add(item: T
|
|
159
|
-
delete(item: T): Resource<T>;
|
|
160
|
-
has(item: T): boolean;
|
|
161
|
-
use(item: T
|
|
302
|
+
items: ReactiveValue<Item<T>[]>;
|
|
303
|
+
add(item: Item<T>, options?: ResourceAddOptions): Resource<T>;
|
|
304
|
+
delete(item: Item<T>): Resource<T>;
|
|
305
|
+
has(item: Item<T>): boolean;
|
|
306
|
+
use(item: Item<T>, options?: ResourceAddOptions): Resource<T>;
|
|
162
307
|
}
|
|
163
308
|
export interface PluginConstructor {
|
|
164
309
|
new (...args: any[]): Plugin$1;
|
|
@@ -307,6 +452,8 @@ export interface SignalOptions<T> {
|
|
|
307
452
|
type?: T;
|
|
308
453
|
}
|
|
309
454
|
declare function triggerSignal(signal: Signal<any>): void;
|
|
455
|
+
declare function signalRef(): Signal<HTMLElement | null>;
|
|
456
|
+
declare function signalRef<T extends Constructor<HTMLElement>>(type: T): Signal<InstanceType<T> | null>;
|
|
310
457
|
declare function signalArray<T>(initialValue: T[]): Signal<T[]>;
|
|
311
458
|
declare function signalArray<T>(initialValue: NoInfer<T>[], options: SignalOptions<T>): Signal<T[]>;
|
|
312
459
|
declare function signalObject<T extends Record<PropertyKey, any>>(initialValue: T): Signal<T>;
|
|
@@ -324,6 +471,7 @@ export declare function signal<T>(value: T): Signal<T>;
|
|
|
324
471
|
export declare function signal<T>(value: NoInfer<T>, options: SignalOptions<T>): Signal<T>;
|
|
325
472
|
export declare namespace signal {
|
|
326
473
|
var trigger: typeof triggerSignal;
|
|
474
|
+
var ref: typeof signalRef;
|
|
327
475
|
var Array: typeof signalArray;
|
|
328
476
|
var Map: typeof signalMap;
|
|
329
477
|
var Object: typeof signalObject;
|
|
@@ -359,27 +507,6 @@ export interface ValidationIssue {
|
|
|
359
507
|
}
|
|
360
508
|
export declare function assertType(value: any, validation: any, errorMessage?: string): void;
|
|
361
509
|
export declare function validateType(value: any, validation: any): ValidationIssue[];
|
|
362
|
-
export type Constructor<T = any> = {
|
|
363
|
-
new (...args: any[]): T;
|
|
364
|
-
};
|
|
365
|
-
export type GetOptionalEntries<T> = {
|
|
366
|
-
[K in keyof T as K extends `${infer P}?` ? P : never]?: T[K];
|
|
367
|
-
};
|
|
368
|
-
export type GetRequiredEntries<T> = {
|
|
369
|
-
[K in keyof T as K extends `${string}?` ? never : K]: T[K];
|
|
370
|
-
};
|
|
371
|
-
export type PrettifyShape<T> = T extends Function ? T : {
|
|
372
|
-
[K in keyof T]: T[K];
|
|
373
|
-
};
|
|
374
|
-
export type ResolveOptionalEntries<T> = PrettifyShape<GetRequiredEntries<T> & GetOptionalEntries<T>>;
|
|
375
|
-
export type KeyedObject<K extends string[]> = {
|
|
376
|
-
[P in K[number]]: any;
|
|
377
|
-
};
|
|
378
|
-
export type ResolveShapedObject<T extends {}> = PrettifyShape<ResolveOptionalEntries<T>>;
|
|
379
|
-
export type ResolveObjectType<T extends {}> = ResolveShapedObject<T extends string[] ? KeyedObject<T> : T>;
|
|
380
|
-
export type UnionToIntersection<U> = (U extends any ? (_: U) => any : never) extends (_: infer I) => void ? I : never;
|
|
381
|
-
declare function constructorType<T extends Constructor>(constructor: T): T;
|
|
382
|
-
export type LiteralTypes = number | string | boolean | null | undefined;
|
|
383
510
|
export interface RegistryOptions<T> {
|
|
384
511
|
name?: string;
|
|
385
512
|
validation?: T;
|
|
@@ -387,6 +514,7 @@ export interface RegistryOptions<T> {
|
|
|
387
514
|
export interface RegistryAddOptions extends ResourceAddOptions {
|
|
388
515
|
force?: boolean;
|
|
389
516
|
}
|
|
517
|
+
type Item$1<T> = StripBrands<T>;
|
|
390
518
|
export declare class Registry<T> {
|
|
391
519
|
private _map;
|
|
392
520
|
private _name;
|
|
@@ -394,23 +522,20 @@ export declare class Registry<T> {
|
|
|
394
522
|
constructor(options?: RegistryOptions<T>);
|
|
395
523
|
entries: ReactiveValue<[
|
|
396
524
|
string,
|
|
397
|
-
T
|
|
398
|
-
][], [
|
|
399
|
-
string,
|
|
400
|
-
T
|
|
525
|
+
Item$1<T>
|
|
401
526
|
][]>;
|
|
402
|
-
items: ReactiveValue<T[]
|
|
527
|
+
items: ReactiveValue<Item$1<T>[]>;
|
|
403
528
|
addById<U extends {
|
|
404
529
|
id: string;
|
|
405
|
-
} & T
|
|
406
|
-
add(key: string, value: T
|
|
407
|
-
get(key: string, defaultValue?: T): T
|
|
530
|
+
} & Item$1<T>>(item: U, options?: RegistryAddOptions): Registry<T>;
|
|
531
|
+
add(key: string, value: Item$1<T>, options?: RegistryAddOptions): Registry<T>;
|
|
532
|
+
get(key: string, defaultValue?: Item$1<T>): Item$1<T>;
|
|
408
533
|
delete(key: string): void;
|
|
409
534
|
has(key: string): boolean;
|
|
410
|
-
use(key: string, value: T
|
|
535
|
+
use(key: string, value: Item$1<T>, options?: RegistryAddOptions): Registry<T>;
|
|
411
536
|
useById<U extends {
|
|
412
537
|
id: string;
|
|
413
|
-
} & T
|
|
538
|
+
} & Item$1<T>>(item: U, options?: RegistryAddOptions): Registry<T>;
|
|
414
539
|
}
|
|
415
540
|
/**
|
|
416
541
|
* Creates a reactive effect bound to the surrounding component or plugin.
|
|
@@ -430,6 +555,10 @@ export declare function useEffect(fn: Parameters<typeof effect>[0]): void;
|
|
|
430
555
|
* listener is attached through a `useEffect` and re-attaches when the signal's
|
|
431
556
|
* value changes; nothing is attached while the signal is null).
|
|
432
557
|
*
|
|
558
|
+
* The handler is not bound: it is passed as-is to `addEventListener`, so inside
|
|
559
|
+
* it `this` is the event target, not the calling component. Wrap a method in an
|
|
560
|
+
* arrow function (or bind it) if it relies on `this`.
|
|
561
|
+
*
|
|
433
562
|
* Example — close a menu when the user clicks anywhere on `window`:
|
|
434
563
|
* useListener(window, "click", () => this.close());
|
|
435
564
|
*/
|
|
@@ -439,8 +568,9 @@ export declare function onWillDestroy(fn: (scope: Scope) => void | any): void;
|
|
|
439
568
|
export type PluginInstance<T extends PluginConstructor> = Omit<InstanceType<T>, "setup">;
|
|
440
569
|
export declare function plugin<T extends PluginConstructor>(pluginType: T): PluginInstance<T>;
|
|
441
570
|
export declare function config<T = any>(key: string): T;
|
|
442
|
-
export declare function config<T>(key: string, type: T): T;
|
|
443
|
-
export declare function config<T>(key: string, type: T
|
|
571
|
+
export declare function config<T>(key: string, type: WithDefault<T>): T;
|
|
572
|
+
export declare function config<T>(key: string, type: Optional<T>): T | undefined;
|
|
573
|
+
export declare function config<T>(key: string, type: T): StripBrands<T>;
|
|
444
574
|
export declare class EventBus extends EventTarget {
|
|
445
575
|
trigger(name: string, payload?: any): void;
|
|
446
576
|
}
|
|
@@ -547,28 +677,35 @@ export declare class Component {
|
|
|
547
677
|
setup(): void;
|
|
548
678
|
}
|
|
549
679
|
declare function staticProp<T = any>(key: string): T;
|
|
550
|
-
declare function staticProp<T>(key: string, type: T): T;
|
|
551
|
-
declare function staticProp<T>(key: string, type: T
|
|
680
|
+
declare function staticProp<T>(key: string, type: WithDefault<T>): T;
|
|
681
|
+
declare function staticProp<T>(key: string, type: Optional<T>): T | undefined;
|
|
682
|
+
declare function staticProp<T>(key: string, type: T): StripBrands<T>;
|
|
552
683
|
declare const isProps: unique symbol;
|
|
553
|
-
export type WithDefaults<T, D> = T & Required<D>;
|
|
554
684
|
export type Props<T extends {}> = T & {
|
|
555
|
-
[isProps]:
|
|
685
|
+
[isProps]: never;
|
|
686
|
+
};
|
|
687
|
+
export type PropsWithDefaults<T extends {}, DK extends PropertyKey> = T & {
|
|
688
|
+
[isProps]: DK;
|
|
556
689
|
};
|
|
557
|
-
export type
|
|
558
|
-
|
|
690
|
+
export type GetPropsWithOptionals<T> = T extends {
|
|
691
|
+
[isProps]: infer DK extends PropertyKey;
|
|
692
|
+
} ? Omit<T, typeof isProps | (DK & keyof T)> & Partial<Pick<T, DK & keyof T>> : never;
|
|
559
693
|
export type GetProps<T> = {
|
|
560
694
|
[K in keyof T]: T[K] extends {
|
|
561
|
-
[isProps]:
|
|
695
|
+
[isProps]: PropertyKey;
|
|
562
696
|
} ? (x: GetPropsWithOptionals<T[K]>) => void : never;
|
|
563
697
|
}[keyof T] extends (x: infer I) => void ? {
|
|
564
698
|
[K in keyof I]: I[K];
|
|
565
699
|
} : never;
|
|
700
|
+
export type ResolveProps<Shape> = [
|
|
701
|
+
GetDefaultedKeys<Shape>
|
|
702
|
+
] extends [
|
|
703
|
+
never
|
|
704
|
+
] ? Props<ResolveReaderObjectType<Shape>> : PropsWithDefaults<ResolveReaderObjectType<Shape>, GetDefaultedKeys<Shape> & PropertyKey>;
|
|
566
705
|
export interface PropsFunction {
|
|
567
706
|
(): Props<Record<string, any>>;
|
|
568
707
|
<const Keys extends string[]>(keys: Keys): Props<ResolveObjectType<Keys>>;
|
|
569
|
-
<
|
|
570
|
-
<Shape extends {}>(shape: Shape): Props<ResolveObjectType<Shape>>;
|
|
571
|
-
<Shape extends {}, Defaults>(shape: Shape, defaults: Defaults & GetPropsDefaults<Shape>): Props<WithDefaults<ResolveObjectType<Shape>, Defaults>>;
|
|
708
|
+
<Shape extends {}>(shape: Shape): ResolveProps<Shape>;
|
|
572
709
|
static: typeof staticProp;
|
|
573
710
|
}
|
|
574
711
|
export declare const props: PropsFunction;
|
|
@@ -662,11 +799,9 @@ export declare class App extends TemplateSet {
|
|
|
662
799
|
declare function mount$1<T extends ComponentConstructor>(C: T, target: MountTarget, config?: AppConfig & RootConfig<GetProps<ComponentInstance<T>>> & MountOptions): Promise<ComponentInstance<T>>;
|
|
663
800
|
export declare class ErrorBoundary extends Component {
|
|
664
801
|
static template: string;
|
|
665
|
-
props:
|
|
666
|
-
error
|
|
667
|
-
},
|
|
668
|
-
error: Signal<any>;
|
|
669
|
-
}>>;
|
|
802
|
+
props: PropsWithDefaults<{
|
|
803
|
+
error: ReactiveValue<any, any>;
|
|
804
|
+
}, "error">;
|
|
670
805
|
setup(): void;
|
|
671
806
|
}
|
|
672
807
|
export declare class Portal extends Component {
|
|
@@ -684,7 +819,7 @@ export declare class Suspense extends Component {
|
|
|
684
819
|
props: Props<{
|
|
685
820
|
slots: {
|
|
686
821
|
default: any;
|
|
687
|
-
fallback
|
|
822
|
+
fallback: any;
|
|
688
823
|
};
|
|
689
824
|
}>;
|
|
690
825
|
private prepared;
|
|
@@ -702,59 +837,8 @@ export declare function onPatched(fn: (scope: ComponentNode) => void | any): voi
|
|
|
702
837
|
export declare function onWillUnmount(fn: (scope: ComponentNode) => void | any): void;
|
|
703
838
|
export type OnErrorCallback = (error: any) => void | any;
|
|
704
839
|
export declare function onError(callback: OnErrorCallback): void;
|
|
705
|
-
declare
|
|
706
|
-
|
|
707
|
-
component: typeof componentType;
|
|
708
|
-
and: <T extends any[]>(types: T) => UnionToIntersection<T[number]>;
|
|
709
|
-
any: () => any;
|
|
710
|
-
array: {
|
|
711
|
-
(): any[];
|
|
712
|
-
<T>(): T[];
|
|
713
|
-
<T>(elementType: T): T[];
|
|
714
|
-
};
|
|
715
|
-
boolean: () => boolean;
|
|
716
|
-
constructor: typeof constructorType;
|
|
717
|
-
customValidator: <T>(type: T, validator: (value: T) => boolean, errorMessage?: string) => T;
|
|
718
|
-
function: {
|
|
719
|
-
(): (...parameters: any[]) => any;
|
|
720
|
-
<const P extends any[]>(parameters: P): (...parameters: P) => void;
|
|
721
|
-
<const P extends any[], R>(): (...parameters: P) => R;
|
|
722
|
-
<const P extends any[], R>(parameters: P, result: R): (...parameters: P) => R;
|
|
723
|
-
};
|
|
724
|
-
instanceOf: <T extends Constructor>(constructor: T) => InstanceType<T>;
|
|
725
|
-
literal: <const T extends LiteralTypes>(literal: T) => T;
|
|
726
|
-
number: <T extends number = number>() => T;
|
|
727
|
-
object: {
|
|
728
|
-
(): Record<string, any>;
|
|
729
|
-
<const Keys extends string[]>(keys: Keys): ResolveOptionalEntries<KeyedObject<Keys>>;
|
|
730
|
-
<Shape extends {}>(): ResolveOptionalEntries<Shape>;
|
|
731
|
-
<Shape extends {}>(shape: Shape): ResolveOptionalEntries<Shape>;
|
|
732
|
-
};
|
|
733
|
-
or: <T extends any[]>(types: T) => T[number];
|
|
734
|
-
promise: {
|
|
735
|
-
(): Promise<void>;
|
|
736
|
-
<T>(type: T): Promise<T>;
|
|
737
|
-
};
|
|
738
|
-
record: {
|
|
739
|
-
(): Record<PropertyKey, any>;
|
|
740
|
-
<V>(valueType: V): Record<PropertyKey, V>;
|
|
741
|
-
};
|
|
742
|
-
ref: {
|
|
743
|
-
(): HTMLElement | null;
|
|
744
|
-
<T extends Constructor<HTMLElement>>(type: T): InstanceType<T> | null;
|
|
745
|
-
};
|
|
746
|
-
selection: <const T extends LiteralTypes>(literals: T[]) => T;
|
|
747
|
-
signal: {
|
|
748
|
-
(): ReactiveValue<any>;
|
|
749
|
-
<T>(): ReactiveValue<T>;
|
|
750
|
-
<T>(type: T): ReactiveValue<T>;
|
|
751
|
-
};
|
|
752
|
-
strictObject: {
|
|
753
|
-
<const Keys extends string[]>(keys: Keys): ResolveOptionalEntries<KeyedObject<Keys>>;
|
|
754
|
-
<Shape extends {}>(shape: Shape): ResolveOptionalEntries<Shape>;
|
|
755
|
-
};
|
|
756
|
-
string: <T extends string = string>() => T;
|
|
757
|
-
tuple: <const T extends any[]>(types: T) => T;
|
|
840
|
+
declare const types$1: typeof types & {
|
|
841
|
+
component: () => Type<typeof Component>;
|
|
758
842
|
};
|
|
759
843
|
export declare function providePlugins(pluginConstructors: PluginConstructor[] | Resource<PluginConstructor>, config?: Record<string, any>): void;
|
|
760
844
|
export declare const blockDom: {
|
|
@@ -778,6 +862,8 @@ export {
|
|
|
778
862
|
Plugin$1 as Plugin,
|
|
779
863
|
mount$1 as mount,
|
|
780
864
|
status$1 as status,
|
|
865
|
+
types$1 as t,
|
|
866
|
+
types$1 as types,
|
|
781
867
|
};
|
|
782
868
|
|
|
783
869
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odoo/owl",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.36",
|
|
4
4
|
"description": "Odoo Web Library (OWL)",
|
|
5
5
|
"main": "dist/owl.cjs.js",
|
|
6
6
|
"module": "dist/owl.es.js",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/odoo/owl#readme",
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@odoo/owl-compiler": "3.0.0-alpha.
|
|
47
|
-
"@odoo/owl-core": "3.0.0-alpha.
|
|
48
|
-
"@odoo/owl-runtime": "3.0.0-alpha.
|
|
46
|
+
"@odoo/owl-compiler": "3.0.0-alpha.36",
|
|
47
|
+
"@odoo/owl-core": "3.0.0-alpha.36",
|
|
48
|
+
"@odoo/owl-runtime": "3.0.0-alpha.36",
|
|
49
49
|
"jsdom": "^25.0.1"
|
|
50
50
|
}
|
|
51
51
|
}
|