@etsoo/shared 1.0.98 → 1.0.99

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.
@@ -115,8 +115,11 @@ export declare namespace DataTypes {
115
115
  type IdType = number | string;
116
116
  /**
117
117
  * Add or edit conditional type for same data model
118
+ * Dynamic add changedFields for editing case
118
119
  */
119
- type AddOrEditType<T, Editing extends boolean> = Editing extends true ? T : Partial<T>;
120
+ type AddOrEditType<T, Editing extends boolean> = Editing extends true ? T & {
121
+ changedFields?: string[];
122
+ } : Partial<T>;
120
123
  /**
121
124
  * Enum value type
122
125
  */
@@ -115,8 +115,11 @@ export declare namespace DataTypes {
115
115
  type IdType = number | string;
116
116
  /**
117
117
  * Add or edit conditional type for same data model
118
+ * Dynamic add changedFields for editing case
118
119
  */
119
- type AddOrEditType<T, Editing extends boolean> = Editing extends true ? T : Partial<T>;
120
+ type AddOrEditType<T, Editing extends boolean> = Editing extends true ? T & {
121
+ changedFields?: string[];
122
+ } : Partial<T>;
120
123
  /**
121
124
  * Enum value type
122
125
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/shared",
3
- "version": "1.0.98",
3
+ "version": "1.0.99",
4
4
  "description": "TypeScript shared utilities and functions",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
package/src/DataTypes.ts CHANGED
@@ -149,9 +149,10 @@ export namespace DataTypes {
149
149
 
150
150
  /**
151
151
  * Add or edit conditional type for same data model
152
+ * Dynamic add changedFields for editing case
152
153
  */
153
154
  export type AddOrEditType<T, Editing extends boolean> = Editing extends true
154
- ? T
155
+ ? T & { changedFields?: string[] }
155
156
  : Partial<T>;
156
157
 
157
158
  /**