@rdlabo/ionic-angular-kit 21.4.1 → 21.4.2
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
CHANGED
|
@@ -83,12 +83,14 @@ interface OfflineReplicaIgnoredDef {
|
|
|
83
83
|
readonly reason: string;
|
|
84
84
|
}
|
|
85
85
|
type StripNullish<T> = Exclude<T, null | undefined>;
|
|
86
|
+
type NormalizeReplicaColumnValue<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends Date ? string | Date : T;
|
|
86
87
|
type IsNullableSelectValue<T> = null extends T ? true : undefined extends T ? true : false;
|
|
87
|
-
type
|
|
88
|
+
type OfflineReplicaColumnDefForValue<T> = IsNullableSelectValue<T> extends true ? OfflineReplicaColumnDef<NormalizeReplicaColumnValue<StripNullish<T>>, {
|
|
88
89
|
readonly [replicaNullableBrand]: 'nullable';
|
|
89
|
-
}> : OfflineReplicaColumnDef<
|
|
90
|
+
}> : OfflineReplicaColumnDef<NormalizeReplicaColumnValue<T>, {
|
|
90
91
|
readonly [replicaNullableBrand]: 'required';
|
|
91
|
-
}
|
|
92
|
+
}>;
|
|
93
|
+
type OfflineReplicaFieldDefForKey<TSelect extends Record<string, unknown>, K extends keyof TSelect> = (StripNullish<TSelect[K]> extends number ? OfflineReplicaServerIdDef : never) | OfflineReplicaIgnoredDef | OfflineReplicaColumnDefForValue<TSelect[K]>;
|
|
92
94
|
type ExactSelectKeys<TSelect extends Record<string, unknown>, TFields> = Exclude<keyof TFields, keyof TSelect> extends never ? (Exclude<keyof TSelect, keyof TFields> extends never ? TFields : never) : never;
|
|
93
95
|
/** Configuration accepted by {@link defineReplicaEntity}. */
|
|
94
96
|
interface OfflineReplicaEntityDefinition<TSelect extends Record<string, unknown>, TFields extends {
|
|
@@ -592,6 +594,8 @@ interface EnqueueOfflineCommand<T = unknown> {
|
|
|
592
594
|
aggregateType: string;
|
|
593
595
|
/** Stable UUID generated by the client before the entity is first written. */
|
|
594
596
|
aggregateLocalId: string;
|
|
597
|
+
/** Known immutable server identity when adopting an entity before its first replica pull. */
|
|
598
|
+
serverId?: number | null;
|
|
595
599
|
operation: string;
|
|
596
600
|
payload: T;
|
|
597
601
|
/** Full local entity value committed to the replica before the command is exposed to the UI. */
|