@coast/core-api-types 1.2.105 → 1.2.106
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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type ValueOf<Obj> = Obj[keyof Obj];
|
|
2
|
+
type OneOnly<Obj, Key extends keyof Obj> = {
|
|
3
|
+
[key in Exclude<keyof Obj, Key>]?: never;
|
|
4
|
+
} & Pick<Obj, Key>;
|
|
5
|
+
type OneOfByKey<Obj> = {
|
|
6
|
+
[key in keyof Obj]: OneOnly<Obj, key>;
|
|
7
|
+
};
|
|
8
|
+
export type OneOf<Obj> = ValueOf<OneOfByKey<Obj>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OneOf.js","sourceRoot":"","sources":["../../../src/models/utils/OneOf.ts"],"names":[],"mappings":""}
|