Directus / @directus/sdk / types / MapFlatFields
Type Alias: MapFlatFields<Item, Fields, FunctionMap> ​
MapFlatFields<
Item
,Fields
,FunctionMap
>: { [F in Fields as F extends keyof FunctionMap ? FunctionMap[F] : F]: F extends keyof FunctionMap ? FunctionOutputType : Extract<Item[F], keyof FieldOutputMap> extends infer A ? A[] extends never[] ? Item[F] : A extends keyof FieldOutputMap ? FieldOutputMap[A] | Exclude<Item[F], A> : Item[F] : Item[F] }
Map literal types to actual output types
Type Parameters ​
• Item extends object
• Fields extends keyof Item
• FunctionMap extends Record
<string
, string
>