@odoo/owl 3.0.0-alpha.33 → 3.0.0-alpha.35
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 +339 -156
- package/dist/owl.es.js +339 -156
- package/dist/owl.iife.js +339 -156
- package/dist/owl.iife.min.js +9 -9
- package/dist/types/owl.d.ts +206 -106
- package/package.json +4 -4
package/dist/types/owl.d.ts
CHANGED
|
@@ -142,6 +142,149 @@ 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
|
+
* Attaches a default value to the type. A defaulted value is implicitly
|
|
161
|
+
* optional: `undefined` passes validation (the default is meant to fill
|
|
162
|
+
* it). The default can be given as a factory (`() => value`), which is
|
|
163
|
+
* called once per consumer, so mutable defaults ([], {}) are not shared. A
|
|
164
|
+
* default for a function type must use the factory form.
|
|
165
|
+
*/
|
|
166
|
+
default(value: T extends Function ? () => T : T | (() => T)): WithDefault<T>;
|
|
167
|
+
/**
|
|
168
|
+
* Marks the type as optional: `undefined` passes validation, and an object
|
|
169
|
+
* key with an optional type may be omitted. A type with a default is
|
|
170
|
+
* already implicitly optional, so `.optional()` and `.default()` do not
|
|
171
|
+
* need to be combined (and cannot be chained).
|
|
172
|
+
*/
|
|
173
|
+
optional(): Optional<T>;
|
|
174
|
+
};
|
|
175
|
+
export type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
176
|
+
export type HasDefault<T> = IsAny<T> extends true ? false : T extends {
|
|
177
|
+
[hasDefault]: any;
|
|
178
|
+
} ? true : false;
|
|
179
|
+
export type IsOptional<T> = IsAny<T> extends true ? false : T extends {
|
|
180
|
+
[isOptional]: any;
|
|
181
|
+
} ? true : false;
|
|
182
|
+
export type StripDefault<T> = T extends {
|
|
183
|
+
[hasDefault]: infer U;
|
|
184
|
+
} ? U : T;
|
|
185
|
+
export type StripOptional<T> = T extends {
|
|
186
|
+
[isOptional]: infer U;
|
|
187
|
+
} ? U | undefined : T;
|
|
188
|
+
export type StripType<T> = T extends {
|
|
189
|
+
[typeBrand]: infer U;
|
|
190
|
+
} ? U : T;
|
|
191
|
+
export type StripBrands<T> = StripType<StripDefault<StripOptional<T>>>;
|
|
192
|
+
export type StripBrandsAll<T extends any[]> = {
|
|
193
|
+
[K in keyof T]: StripBrands<T[K]>;
|
|
194
|
+
};
|
|
195
|
+
export type GetDefaultedEntries<T> = {
|
|
196
|
+
[K in keyof T as HasDefault<T[K]> extends true ? K : never]: StripBrands<T[K]>;
|
|
197
|
+
};
|
|
198
|
+
export type GetOptionalEntries<T> = {
|
|
199
|
+
[K in keyof T as IsOptional<T[K]> extends true ? K : HasDefault<T[K]> extends true ? K : never]?: StripBrands<T[K]>;
|
|
200
|
+
};
|
|
201
|
+
export type GetRequiredEntries<T> = {
|
|
202
|
+
[K in keyof T as IsOptional<T[K]> extends true ? never : HasDefault<T[K]> extends true ? never : K]: StripBrands<T[K]>;
|
|
203
|
+
};
|
|
204
|
+
export type PrettifyShape<T> = T extends Function ? T : {
|
|
205
|
+
[K in keyof T]: T[K];
|
|
206
|
+
};
|
|
207
|
+
export type ResolveOptionalEntries<T> = PrettifyShape<GetRequiredEntries<T> & GetOptionalEntries<T>>;
|
|
208
|
+
export type KeyedObject<K extends string[]> = {
|
|
209
|
+
[P in K[number]]: any;
|
|
210
|
+
};
|
|
211
|
+
export type ResolveShapedObject<T extends {}> = PrettifyShape<ResolveOptionalEntries<T>>;
|
|
212
|
+
export type ResolveObjectType<T extends {}> = ResolveShapedObject<T extends string[] ? KeyedObject<T> : T>;
|
|
213
|
+
export type UnionToIntersection<U> = (U extends any ? (_: U) => any : never) extends (_: infer I) => void ? I : never;
|
|
214
|
+
/**
|
|
215
|
+
* Returns the default value factory attached to a type by `.default()`, if
|
|
216
|
+
* any. This is how consumers (props, config, ...) resolve defaults at
|
|
217
|
+
* runtime: validation only runs in dev mode, so defaults are metadata on the
|
|
218
|
+
* schema, not a validation side-effect.
|
|
219
|
+
*/
|
|
220
|
+
export declare function getDefault(type: any): (() => any) | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Returns `value` with defaults from the schema filled in, at any depth: a
|
|
223
|
+
* default fires when the value at its schema position is `undefined`. The
|
|
224
|
+
* input is never mutated; objects are copied along the changed paths only, so
|
|
225
|
+
* if nothing is filled in, `value` is returned as is.
|
|
226
|
+
*
|
|
227
|
+
* Note that this only recurses through object shapes, tuples and arrays
|
|
228
|
+
* (unions are ambiguous, records have no fixed keys).
|
|
229
|
+
*/
|
|
230
|
+
export declare function applyDefaults<T>(value: unknown, type: T): StripBrands<T>;
|
|
231
|
+
declare function anyType(): Type<any>;
|
|
232
|
+
declare function booleanType(): Type<boolean>;
|
|
233
|
+
declare function numberType<T extends number = number>(): Type<T>;
|
|
234
|
+
declare function stringType<T extends string = string>(): Type<T>;
|
|
235
|
+
declare function arrayType(): Type<any[]>;
|
|
236
|
+
declare function arrayType<T>(): Type<T[]>;
|
|
237
|
+
declare function arrayType<T>(elementType: T): Type<StripBrands<T>[]>;
|
|
238
|
+
declare function constructorType<T extends Constructor>(constructor: T): Type<T>;
|
|
239
|
+
declare function customValidator<T>(type: T, validator: (value: StripBrands<T>) => boolean, errorMessage?: string): Type<StripBrands<T>>;
|
|
240
|
+
declare function functionType(): Type<(...parameters: any[]) => any>;
|
|
241
|
+
declare function functionType<const P extends any[]>(parameters: P): Type<(...parameters: StripBrandsAll<P>) => void>;
|
|
242
|
+
declare function functionType<const P extends any[], R>(): Type<(...parameters: P) => R>;
|
|
243
|
+
declare function functionType<const P extends any[], R>(parameters: P, result: R): Type<(...parameters: StripBrandsAll<P>) => StripBrands<R>>;
|
|
244
|
+
declare function instanceType<T extends Constructor>(constructor: T): Type<InstanceType<T>>;
|
|
245
|
+
declare function intersection<T extends any[]>(types: T): Type<UnionToIntersection<StripBrands<T[number]>>>;
|
|
246
|
+
export type LiteralTypes = number | string | boolean | null | undefined;
|
|
247
|
+
declare function literalType<const T extends LiteralTypes>(literal: T): Type<T>;
|
|
248
|
+
declare function literalSelection<const T extends LiteralTypes>(literals: T[]): Type<T>;
|
|
249
|
+
declare function objectType(): Type<Record<string, any>>;
|
|
250
|
+
declare function objectType<const Keys extends string[]>(keys: Keys): Type<ResolveOptionalEntries<KeyedObject<Keys>>>;
|
|
251
|
+
declare function objectType<Shape extends {}>(): Type<ResolveOptionalEntries<Shape>>;
|
|
252
|
+
declare function objectType<Shape extends {}>(shape: Shape): Type<ResolveOptionalEntries<Shape>>;
|
|
253
|
+
declare function strictObjectType<const Keys extends string[]>(keys: Keys): Type<ResolveOptionalEntries<KeyedObject<Keys>>>;
|
|
254
|
+
declare function strictObjectType<Shape extends {}>(shape: Shape): Type<ResolveOptionalEntries<Shape>>;
|
|
255
|
+
declare function promiseType(): Type<Promise<void>>;
|
|
256
|
+
declare function promiseType<T>(type: T): Type<Promise<StripBrands<T>>>;
|
|
257
|
+
declare function recordType(): Type<Record<PropertyKey, any>>;
|
|
258
|
+
declare function recordType<V>(valueType: V): Type<Record<PropertyKey, StripBrands<V>>>;
|
|
259
|
+
declare function tuple<const T extends any[]>(types: T): Type<StripBrandsAll<T>>;
|
|
260
|
+
declare function union<T extends any[]>(types: T): Type<StripBrands<T[number]>>;
|
|
261
|
+
declare function reactiveValueType(): Type<ReactiveValue<any>>;
|
|
262
|
+
declare function reactiveValueType<T>(): Type<ReactiveValue<T>>;
|
|
263
|
+
declare function reactiveValueType<T>(type: T): Type<ReactiveValue<StripBrands<T>>>;
|
|
264
|
+
declare function ref(): Type<HTMLElement | null>;
|
|
265
|
+
declare function ref<T extends Constructor<HTMLElement>>(type: T): Type<InstanceType<T> | null>;
|
|
266
|
+
declare const types: {
|
|
267
|
+
and: typeof intersection;
|
|
268
|
+
any: typeof anyType;
|
|
269
|
+
array: typeof arrayType;
|
|
270
|
+
boolean: typeof booleanType;
|
|
271
|
+
constructor: typeof constructorType;
|
|
272
|
+
customValidator: typeof customValidator;
|
|
273
|
+
function: typeof functionType;
|
|
274
|
+
instanceOf: typeof instanceType;
|
|
275
|
+
literal: typeof literalType;
|
|
276
|
+
number: typeof numberType;
|
|
277
|
+
object: typeof objectType;
|
|
278
|
+
or: typeof union;
|
|
279
|
+
promise: typeof promiseType;
|
|
280
|
+
record: typeof recordType;
|
|
281
|
+
ref: typeof ref;
|
|
282
|
+
selection: typeof literalSelection;
|
|
283
|
+
signal: typeof reactiveValueType;
|
|
284
|
+
strictObject: typeof strictObjectType;
|
|
285
|
+
string: typeof stringType;
|
|
286
|
+
tuple: typeof tuple;
|
|
287
|
+
};
|
|
145
288
|
export interface ResourceOptions<T> {
|
|
146
289
|
name?: string;
|
|
147
290
|
validation?: T;
|
|
@@ -149,25 +292,28 @@ export interface ResourceOptions<T> {
|
|
|
149
292
|
export interface ResourceAddOptions {
|
|
150
293
|
sequence?: number;
|
|
151
294
|
}
|
|
295
|
+
export type Item<T> = StripBrands<T>;
|
|
152
296
|
export declare class Resource<T> {
|
|
153
297
|
private _items;
|
|
154
298
|
private _name?;
|
|
155
299
|
private _validation?;
|
|
156
300
|
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
|
|
301
|
+
items: ReactiveValue<Item<T>[]>;
|
|
302
|
+
add(item: Item<T>, options?: ResourceAddOptions): Resource<T>;
|
|
303
|
+
delete(item: Item<T>): Resource<T>;
|
|
304
|
+
has(item: Item<T>): boolean;
|
|
305
|
+
use(item: Item<T>, options?: ResourceAddOptions): Resource<T>;
|
|
162
306
|
}
|
|
163
307
|
export interface PluginConstructor {
|
|
164
308
|
new (...args: any[]): Plugin$1;
|
|
165
309
|
id: string;
|
|
310
|
+
sequence: number;
|
|
166
311
|
}
|
|
167
312
|
declare class Plugin$1 {
|
|
168
313
|
private static _shadowId;
|
|
169
314
|
static get id(): string;
|
|
170
315
|
static set id(shadowId: string);
|
|
316
|
+
static sequence: number;
|
|
171
317
|
__owl__: PluginManager;
|
|
172
318
|
constructor(manager: PluginManager);
|
|
173
319
|
setup(): void;
|
|
@@ -180,6 +326,7 @@ declare class PluginManager extends Scope {
|
|
|
180
326
|
config: Record<string, any>;
|
|
181
327
|
plugins: Record<string, Plugin$1>;
|
|
182
328
|
ready: Promise<void>;
|
|
329
|
+
private hasPendingReady;
|
|
183
330
|
constructor(app: any, options?: PluginManagerOptions);
|
|
184
331
|
destroy(): void;
|
|
185
332
|
getPluginById<T extends Plugin$1>(id: string): T | null;
|
|
@@ -304,6 +451,8 @@ export interface SignalOptions<T> {
|
|
|
304
451
|
type?: T;
|
|
305
452
|
}
|
|
306
453
|
declare function triggerSignal(signal: Signal<any>): void;
|
|
454
|
+
declare function signalRef(): Signal<HTMLElement | null>;
|
|
455
|
+
declare function signalRef<T extends Constructor<HTMLElement>>(type: T): Signal<InstanceType<T> | null>;
|
|
307
456
|
declare function signalArray<T>(initialValue: T[]): Signal<T[]>;
|
|
308
457
|
declare function signalArray<T>(initialValue: NoInfer<T>[], options: SignalOptions<T>): Signal<T[]>;
|
|
309
458
|
declare function signalObject<T extends Record<PropertyKey, any>>(initialValue: T): Signal<T>;
|
|
@@ -321,6 +470,7 @@ export declare function signal<T>(value: T): Signal<T>;
|
|
|
321
470
|
export declare function signal<T>(value: NoInfer<T>, options: SignalOptions<T>): Signal<T>;
|
|
322
471
|
export declare namespace signal {
|
|
323
472
|
var trigger: typeof triggerSignal;
|
|
473
|
+
var ref: typeof signalRef;
|
|
324
474
|
var Array: typeof signalArray;
|
|
325
475
|
var Map: typeof signalMap;
|
|
326
476
|
var Object: typeof signalObject;
|
|
@@ -350,33 +500,12 @@ export interface AsyncComputed<T> {
|
|
|
350
500
|
export declare function asyncComputed<T>(fetcher: (ctx: AsyncComputedContext) => Promise<T>, options?: AsyncComputedOptions<T>): AsyncComputed<T>;
|
|
351
501
|
export interface ValidationIssue {
|
|
352
502
|
message: string;
|
|
353
|
-
path?:
|
|
503
|
+
path?: string;
|
|
354
504
|
received?: any;
|
|
355
505
|
[K: string]: any;
|
|
356
506
|
}
|
|
357
507
|
export declare function assertType(value: any, validation: any, errorMessage?: string): void;
|
|
358
508
|
export declare function validateType(value: any, validation: any): ValidationIssue[];
|
|
359
|
-
export type Constructor<T = any> = {
|
|
360
|
-
new (...args: any[]): T;
|
|
361
|
-
};
|
|
362
|
-
export type GetOptionalEntries<T> = {
|
|
363
|
-
[K in keyof T as K extends `${infer P}?` ? P : never]?: T[K];
|
|
364
|
-
};
|
|
365
|
-
export type GetRequiredEntries<T> = {
|
|
366
|
-
[K in keyof T as K extends `${string}?` ? never : K]: T[K];
|
|
367
|
-
};
|
|
368
|
-
export type PrettifyShape<T> = T extends Function ? T : {
|
|
369
|
-
[K in keyof T]: T[K];
|
|
370
|
-
};
|
|
371
|
-
export type ResolveOptionalEntries<T> = PrettifyShape<GetRequiredEntries<T> & GetOptionalEntries<T>>;
|
|
372
|
-
export type KeyedObject<K extends string[]> = {
|
|
373
|
-
[P in K[number]]: any;
|
|
374
|
-
};
|
|
375
|
-
export type ResolveShapedObject<T extends {}> = PrettifyShape<ResolveOptionalEntries<T>>;
|
|
376
|
-
export type ResolveObjectType<T extends {}> = ResolveShapedObject<T extends string[] ? KeyedObject<T> : T>;
|
|
377
|
-
export type UnionToIntersection<U> = (U extends any ? (_: U) => any : never) extends (_: infer I) => void ? I : never;
|
|
378
|
-
declare function constructorType<T extends Constructor>(constructor: T): T;
|
|
379
|
-
export type LiteralTypes = number | string | boolean | null | undefined;
|
|
380
509
|
export interface RegistryOptions<T> {
|
|
381
510
|
name?: string;
|
|
382
511
|
validation?: T;
|
|
@@ -384,6 +513,7 @@ export interface RegistryOptions<T> {
|
|
|
384
513
|
export interface RegistryAddOptions extends ResourceAddOptions {
|
|
385
514
|
force?: boolean;
|
|
386
515
|
}
|
|
516
|
+
type Item$1<T> = StripBrands<T>;
|
|
387
517
|
export declare class Registry<T> {
|
|
388
518
|
private _map;
|
|
389
519
|
private _name;
|
|
@@ -391,23 +521,20 @@ export declare class Registry<T> {
|
|
|
391
521
|
constructor(options?: RegistryOptions<T>);
|
|
392
522
|
entries: ReactiveValue<[
|
|
393
523
|
string,
|
|
394
|
-
T
|
|
395
|
-
][], [
|
|
396
|
-
string,
|
|
397
|
-
T
|
|
524
|
+
Item$1<T>
|
|
398
525
|
][]>;
|
|
399
|
-
items: ReactiveValue<T[]
|
|
526
|
+
items: ReactiveValue<Item$1<T>[]>;
|
|
400
527
|
addById<U extends {
|
|
401
528
|
id: string;
|
|
402
|
-
} & T
|
|
403
|
-
add(key: string, value: T
|
|
404
|
-
get(key: string, defaultValue?: T): T
|
|
529
|
+
} & Item$1<T>>(item: U, options?: RegistryAddOptions): Registry<T>;
|
|
530
|
+
add(key: string, value: Item$1<T>, options?: RegistryAddOptions): Registry<T>;
|
|
531
|
+
get(key: string, defaultValue?: Item$1<T>): Item$1<T>;
|
|
405
532
|
delete(key: string): void;
|
|
406
533
|
has(key: string): boolean;
|
|
407
|
-
use(key: string, value: T
|
|
534
|
+
use(key: string, value: Item$1<T>, options?: RegistryAddOptions): Registry<T>;
|
|
408
535
|
useById<U extends {
|
|
409
536
|
id: string;
|
|
410
|
-
} & T
|
|
537
|
+
} & Item$1<T>>(item: U, options?: RegistryAddOptions): Registry<T>;
|
|
411
538
|
}
|
|
412
539
|
/**
|
|
413
540
|
* Creates a reactive effect bound to the surrounding component or plugin.
|
|
@@ -427,6 +554,10 @@ export declare function useEffect(fn: Parameters<typeof effect>[0]): void;
|
|
|
427
554
|
* listener is attached through a `useEffect` and re-attaches when the signal's
|
|
428
555
|
* value changes; nothing is attached while the signal is null).
|
|
429
556
|
*
|
|
557
|
+
* The handler is not bound: it is passed as-is to `addEventListener`, so inside
|
|
558
|
+
* it `this` is the event target, not the calling component. Wrap a method in an
|
|
559
|
+
* arrow function (or bind it) if it relies on `this`.
|
|
560
|
+
*
|
|
430
561
|
* Example — close a menu when the user clicks anywhere on `window`:
|
|
431
562
|
* useListener(window, "click", () => this.close());
|
|
432
563
|
*/
|
|
@@ -436,8 +567,9 @@ export declare function onWillDestroy(fn: (scope: Scope) => void | any): void;
|
|
|
436
567
|
export type PluginInstance<T extends PluginConstructor> = Omit<InstanceType<T>, "setup">;
|
|
437
568
|
export declare function plugin<T extends PluginConstructor>(pluginType: T): PluginInstance<T>;
|
|
438
569
|
export declare function config<T = any>(key: string): T;
|
|
439
|
-
export declare function config<T>(key: string, type: T): T;
|
|
440
|
-
export declare function config<T>(key: string, type: T
|
|
570
|
+
export declare function config<T>(key: string, type: WithDefault<T>): T;
|
|
571
|
+
export declare function config<T>(key: string, type: Optional<T>): T | undefined;
|
|
572
|
+
export declare function config<T>(key: string, type: T): StripBrands<T>;
|
|
441
573
|
export declare class EventBus extends EventTarget {
|
|
442
574
|
trigger(name: string, payload?: any): void;
|
|
443
575
|
}
|
|
@@ -499,6 +631,7 @@ declare class ComponentNode extends Scope implements VNode<ComponentNode> {
|
|
|
499
631
|
[key: string]: ComponentNode;
|
|
500
632
|
};
|
|
501
633
|
willUpdateProps: LifecycleHook[];
|
|
634
|
+
propsUpdated: LifecycleHook[];
|
|
502
635
|
willUnmount: LifecycleHook[];
|
|
503
636
|
mounted: LifecycleHook[];
|
|
504
637
|
willPatch: LifecycleHook[];
|
|
@@ -542,12 +675,15 @@ export declare class Component {
|
|
|
542
675
|
constructor(node: ComponentNode);
|
|
543
676
|
setup(): void;
|
|
544
677
|
}
|
|
678
|
+
declare function staticProp<T = any>(key: string): T;
|
|
679
|
+
declare function staticProp<T>(key: string, type: WithDefault<T>): T;
|
|
680
|
+
declare function staticProp<T>(key: string, type: Optional<T>): T | undefined;
|
|
681
|
+
declare function staticProp<T>(key: string, type: T): StripBrands<T>;
|
|
545
682
|
declare const isProps: unique symbol;
|
|
546
683
|
export type WithDefaults<T, D> = T & Required<D>;
|
|
547
684
|
export type Props<T extends {}> = T & {
|
|
548
685
|
[isProps]: true;
|
|
549
686
|
};
|
|
550
|
-
export type GetPropsDefaults<T extends object> = PrettifyShape<GetOptionalEntries<T>>;
|
|
551
687
|
export type GetPropsWithOptionals<T> = T extends Props<infer P> ? (P extends WithDefaults<infer R, any> ? R : P) : never;
|
|
552
688
|
export type GetProps<T> = {
|
|
553
689
|
[K in keyof T]: T[K] extends {
|
|
@@ -556,11 +692,13 @@ export type GetProps<T> = {
|
|
|
556
692
|
}[keyof T] extends (x: infer I) => void ? {
|
|
557
693
|
[K in keyof I]: I[K];
|
|
558
694
|
} : never;
|
|
559
|
-
export
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
695
|
+
export interface PropsFunction {
|
|
696
|
+
(): Props<Record<string, any>>;
|
|
697
|
+
<const Keys extends string[]>(keys: Keys): Props<ResolveObjectType<Keys>>;
|
|
698
|
+
<Shape extends {}>(shape: Shape): Props<WithDefaults<ResolveObjectType<Shape>, GetDefaultedEntries<Shape>>>;
|
|
699
|
+
static: typeof staticProp;
|
|
700
|
+
}
|
|
701
|
+
export declare const props: PropsFunction;
|
|
564
702
|
declare class Scheduler {
|
|
565
703
|
static requestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
566
704
|
tasks: Set<RootFiber>;
|
|
@@ -653,37 +791,44 @@ export declare class ErrorBoundary extends Component {
|
|
|
653
791
|
static template: string;
|
|
654
792
|
props: Props<WithDefaults<{
|
|
655
793
|
error?: ReactiveValue<any, any> | undefined;
|
|
656
|
-
}, {
|
|
657
|
-
error:
|
|
658
|
-
}
|
|
794
|
+
}, GetDefaultedEntries<{
|
|
795
|
+
error: WithDefault<ReactiveValue<any, any>>;
|
|
796
|
+
}>>>;
|
|
659
797
|
setup(): void;
|
|
660
798
|
}
|
|
661
799
|
export declare class Portal extends Component {
|
|
662
800
|
static template: string;
|
|
663
|
-
props: Props<{
|
|
801
|
+
props: Props<WithDefaults<{
|
|
664
802
|
slots: {
|
|
665
803
|
default: any;
|
|
666
804
|
};
|
|
667
|
-
target:
|
|
668
|
-
}
|
|
805
|
+
target: any;
|
|
806
|
+
}, GetDefaultedEntries<{
|
|
807
|
+
slots: Type<{
|
|
808
|
+
default: any;
|
|
809
|
+
}>;
|
|
810
|
+
target: any;
|
|
811
|
+
}>>>;
|
|
669
812
|
setup(): void;
|
|
670
813
|
}
|
|
671
814
|
export declare class Suspense extends Component {
|
|
672
815
|
static template: string;
|
|
673
|
-
props: Props<{
|
|
816
|
+
props: Props<WithDefaults<{
|
|
674
817
|
slots: {
|
|
675
818
|
default: any;
|
|
676
|
-
fallback
|
|
819
|
+
fallback: any;
|
|
677
820
|
};
|
|
678
|
-
}
|
|
821
|
+
}, GetDefaultedEntries<{
|
|
822
|
+
slots: Type<{
|
|
823
|
+
default: any;
|
|
824
|
+
fallback: any;
|
|
825
|
+
}>;
|
|
826
|
+
}>>>;
|
|
679
827
|
private prepared;
|
|
680
828
|
private mounted;
|
|
681
829
|
private subRootMounted;
|
|
682
830
|
setup(): void;
|
|
683
831
|
}
|
|
684
|
-
export declare function prop<T = any>(key: string): T;
|
|
685
|
-
export declare function prop<T>(key: string, type: T): T;
|
|
686
|
-
export declare function prop<T>(key: string, type: T, defaultValue: T): T;
|
|
687
832
|
export type STATUS_DESCR = "new" | "started" | "mounted" | "cancelled" | "destroyed";
|
|
688
833
|
declare function status$1(entity: Component | Plugin$1): STATUS_DESCR;
|
|
689
834
|
export declare const useApp: () => App;
|
|
@@ -694,55 +839,8 @@ export declare function onPatched(fn: (scope: ComponentNode) => void | any): voi
|
|
|
694
839
|
export declare function onWillUnmount(fn: (scope: ComponentNode) => void | any): void;
|
|
695
840
|
export type OnErrorCallback = (error: any) => void | any;
|
|
696
841
|
export declare function onError(callback: OnErrorCallback): void;
|
|
697
|
-
declare
|
|
698
|
-
|
|
699
|
-
component: typeof componentType;
|
|
700
|
-
and: <T extends any[]>(types: T) => UnionToIntersection<T[number]>;
|
|
701
|
-
any: () => any;
|
|
702
|
-
array: {
|
|
703
|
-
(): any[];
|
|
704
|
-
<T>(elementType: T): T[];
|
|
705
|
-
};
|
|
706
|
-
boolean: () => boolean;
|
|
707
|
-
constructor: typeof constructorType;
|
|
708
|
-
customValidator: <T>(type: T, validator: (value: T) => boolean, errorMessage?: string) => T;
|
|
709
|
-
function: {
|
|
710
|
-
(): (...parameters: any[]) => any;
|
|
711
|
-
<const P extends any[]>(parameters: P): (...parameters: P) => void;
|
|
712
|
-
<const P extends any[], R>(parameters: P, result: R): (...parameters: P) => R;
|
|
713
|
-
};
|
|
714
|
-
instanceOf: <T extends Constructor>(constructor: T) => InstanceType<T>;
|
|
715
|
-
literal: <const T extends LiteralTypes>(literal: T) => T;
|
|
716
|
-
number: () => number;
|
|
717
|
-
object: {
|
|
718
|
-
(): Record<string, any>;
|
|
719
|
-
<const Keys extends string[]>(keys: Keys): ResolveOptionalEntries<KeyedObject<Keys>>;
|
|
720
|
-
<Shape extends {}>(shape: Shape): ResolveOptionalEntries<Shape>;
|
|
721
|
-
};
|
|
722
|
-
or: <T extends any[]>(types: T) => T[number];
|
|
723
|
-
promise: {
|
|
724
|
-
(): Promise<void>;
|
|
725
|
-
<T>(type: T): Promise<T>;
|
|
726
|
-
};
|
|
727
|
-
record: {
|
|
728
|
-
(): Record<PropertyKey, any>;
|
|
729
|
-
<V>(valueType: V): Record<PropertyKey, V>;
|
|
730
|
-
};
|
|
731
|
-
ref: {
|
|
732
|
-
(): HTMLElement | null;
|
|
733
|
-
<T extends Constructor<HTMLElement>>(type: T): InstanceType<T> | null;
|
|
734
|
-
};
|
|
735
|
-
selection: <const T extends LiteralTypes>(literals: T[]) => T;
|
|
736
|
-
signal: {
|
|
737
|
-
(): ReactiveValue<any>;
|
|
738
|
-
<T>(type: T): ReactiveValue<T>;
|
|
739
|
-
};
|
|
740
|
-
strictObject: {
|
|
741
|
-
<const Keys extends string[]>(keys: Keys): ResolveOptionalEntries<KeyedObject<Keys>>;
|
|
742
|
-
<Shape extends {}>(shape: Shape): ResolveOptionalEntries<Shape>;
|
|
743
|
-
};
|
|
744
|
-
string: () => string;
|
|
745
|
-
tuple: <const T extends any[]>(types: T) => T;
|
|
842
|
+
declare const types$1: typeof types & {
|
|
843
|
+
component: () => Type<typeof Component>;
|
|
746
844
|
};
|
|
747
845
|
export declare function providePlugins(pluginConstructors: PluginConstructor[] | Resource<PluginConstructor>, config?: Record<string, any>): void;
|
|
748
846
|
export declare const blockDom: {
|
|
@@ -766,6 +864,8 @@ export {
|
|
|
766
864
|
Plugin$1 as Plugin,
|
|
767
865
|
mount$1 as mount,
|
|
768
866
|
status$1 as status,
|
|
867
|
+
types$1 as t,
|
|
868
|
+
types$1 as types,
|
|
769
869
|
};
|
|
770
870
|
|
|
771
871
|
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.35",
|
|
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.35",
|
|
47
|
+
"@odoo/owl-core": "3.0.0-alpha.35",
|
|
48
|
+
"@odoo/owl-runtime": "3.0.0-alpha.35",
|
|
49
49
|
"jsdom": "^25.0.1"
|
|
50
50
|
}
|
|
51
51
|
}
|