diff --git a/src/types/model/sharedSliceVariation.ts b/src/types/model/sharedSliceVariation.ts index ef856a12..760145cb 100644 --- a/src/types/model/sharedSliceVariation.ts +++ b/src/types/model/sharedSliceVariation.ts @@ -1,4 +1,7 @@ -import type { CustomTypeModelFieldForGroup } from "./types"; +import type { + CustomTypeModelFieldForGroup, + CustomTypeModelFieldForSlice, +} from "./types"; /** * A shared Slice variation. @@ -10,6 +13,10 @@ import type { CustomTypeModelFieldForGroup } from "./types"; */ export interface SharedSliceModelVariation< ID extends string = string, + Fields extends Record = Record< + string, + CustomTypeModelFieldForSlice + >, PrimaryFields extends Record = Record< string, CustomTypeModelFieldForGroup @@ -24,6 +31,7 @@ export interface SharedSliceModelVariation< docURL: string; version: string; description: string; + fields?: Fields; primary?: PrimaryFields; items?: ItemFields; imageUrl: string; diff --git a/src/types/model/types.ts b/src/types/model/types.ts index 1ac2840c..dfddc75d 100644 --- a/src/types/model/types.ts +++ b/src/types/model/types.ts @@ -89,3 +89,13 @@ export type CustomTypeModelFieldForGroup = | CustomTypeModelKeyTextField | CustomTypeModelTimestampField | CustomTypeModelSeparatorField; + +/** + * Any custom type field that is valid for a slice. + * + * **Note**: This type is only valid for a slice's `fields` property. It cannot + * be used for the deprecated `primary` or `items` properties. + */ +export type CustomTypeModelFieldForSlice = + | CustomTypeModelGroupField + | CustomTypeModelFieldForGroup;