@xaendar/types 1.0.6 → 1.0.7

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.
@@ -13,16 +13,18 @@ export declare type AbstractConstructor<T extends object = object, Statics exten
13
13
  * @template Class - The class that owns the decorated accessor.
14
14
  * @template Value - The type of the accessor's value, the same for the original accessor and its replacement.
15
15
  * @template Metadata - The shape of the metadata of the class (see {@link DecoratorMetadataContext}).
16
+ * @template SetValue - The type accepted by the replacement setter. It must include `Value`, or TypeScript rejects the
17
+ * decorator on the accessor.
16
18
  */
17
- export declare type AccessorDecorator<Class extends object, Value = unknown, Metadata extends object = DecoratorMetadataObject> = (value: ClassAccessorDecoratorValue<Value>, context: DecoratorMetadataContext<ClassAccessorDecoratorContext<Class, Value>, Metadata>) => {
19
+ export declare type AccessorDecorator<Class extends object, Value = unknown, Metadata extends object = DecoratorMetadataObject, SetValue = Value> = (value: ClassAccessorDecoratorValue<Value>, context: DecoratorMetadataContext<ClassAccessorDecoratorContext<Class, Value>, Metadata>) => {
18
20
  /**
19
21
  * Replacement getter returning a value of `Value`.
20
22
  */
21
23
  get?(this: Class): Value;
22
24
  /**
23
- * Replacement setter accepting a value of `Value`.
25
+ * Replacement setter accepting a value of `SetValue`.
24
26
  */
25
- set?(this: Class, value: Value): void;
27
+ set?(this: Class, value: SetValue): void;
26
28
  /**
27
29
  * Initializer called with the original field value; should return a `Value`.
28
30
  */
@@ -154,7 +156,7 @@ export declare type Dictionary<Key extends string | number | symbol, Value = str
154
156
  * @template ReturnType - The type the initializer transforms the value into. Defaults to `Field`.
155
157
  * @template Metadata - The shape of the metadata of the class (see {@link DecoratorMetadataContext}).
156
158
  */
157
- export declare type FieldDecorator<Class extends Object, Field, ReturnType = Field, Metadata extends object = DecoratorMetadataObject> = (field: undefined, context: DecoratorMetadataContext<ClassFieldDecoratorContext<Class, Field>, Metadata>) => ((value: Field) => ReturnType) | void;
159
+ export declare type FieldDecorator<Class extends object = object, Field = unknown, ReturnType = Field, Metadata extends object = DecoratorMetadataObject> = (field: undefined, context: DecoratorMetadataContext<ClassFieldDecoratorContext<Class, Field>, Metadata>) => ((value: Field) => ReturnType) | void;
158
160
 
159
161
  /**
160
162
  * A function type that can accept any number of arguments and return any type.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaendar/types",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "A library containing common types shared across packages and consumers",
5
5
  "sideEffects": false,
6
6
  "type": "module",