@xaendar/types 0.3.38 → 0.4.0
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/package.json +1 -1
- package/xaendar-types.es.d.ts +37 -6
package/package.json
CHANGED
package/xaendar-types.es.d.ts
CHANGED
|
@@ -4,10 +4,29 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare type AbstractConstructor<T extends object = object, Statics extends Record<string, unknown> | undefined = undefined> = (abstract new (...args: any[]) => T) & (Statics extends undefined ? object : Statics);
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Represents a class accessor decorator function.
|
|
9
|
+
*
|
|
10
|
+
* Note: the `context` parameter uses `Field` (not `ReturnTypeField`) because
|
|
11
|
+
* `ClassAccessorDecoratorContext` is tied to the original field type.
|
|
12
|
+
*
|
|
13
|
+
* @template Class - The class that owns the decorated accessor.
|
|
14
|
+
* @template Value - The original type of the accessor's value.
|
|
15
|
+
* @template ActualValue - The type returned/set by the replacement accessor (defaults to `InitialValue`).
|
|
16
|
+
*/
|
|
17
|
+
export declare type AccessorDecorator<Class extends object, Value = unknown> = (value: ClassAccessorDecoratorValue<Value>, context: ClassAccessorDecoratorContext<Class, Value>) => {
|
|
18
|
+
/**
|
|
19
|
+
* Replacement getter returning a value of `Value`.
|
|
20
|
+
*/
|
|
21
|
+
get?(this: Class): Value;
|
|
22
|
+
/**
|
|
23
|
+
* Replacement setter accepting a value of `Value`.
|
|
24
|
+
*/
|
|
25
|
+
set?(this: Class, value: Value): void;
|
|
26
|
+
/**
|
|
27
|
+
* Initializer called with the original field value; should return a `Value`.
|
|
28
|
+
*/
|
|
29
|
+
init?(this: Class, initialValue: Value): Value;
|
|
11
30
|
} | void;
|
|
12
31
|
|
|
13
32
|
/**
|
|
@@ -19,9 +38,21 @@ export declare type Beautify<T extends Object> = {
|
|
|
19
38
|
[K in keyof T]: T[K];
|
|
20
39
|
} & {};
|
|
21
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Represents the accessor descriptor passed to a class accessor decorator,
|
|
43
|
+
* containing the original `get` and `set` methods of the decorated accessor.
|
|
44
|
+
*
|
|
45
|
+
* @template Field - The type of the accessor's value.
|
|
46
|
+
*/
|
|
22
47
|
export declare type ClassAccessorDecoratorValue<Field = unknown> = {
|
|
23
|
-
|
|
24
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Returns the current value of the accessor.
|
|
50
|
+
*/
|
|
51
|
+
get(this: unknown): Field;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the value of the accessor.
|
|
54
|
+
*/
|
|
55
|
+
set(this: unknown, value: Field): void;
|
|
25
56
|
};
|
|
26
57
|
|
|
27
58
|
declare type ClassDecorator_2<T extends Object, Statics extends {
|