@@ -913,38 +913,54 @@ export type EndpointDefinition<
913
913
ResultType ,
914
914
ReducerPath extends string = string ,
915
915
PageParam = any ,
916
+ RawResultType extends BaseQueryResult < BaseQuery > = BaseQueryResult < BaseQuery > ,
916
917
> =
917
- | QueryDefinition < QueryArg , BaseQuery , TagTypes , ResultType , ReducerPath >
918
- | MutationDefinition < QueryArg , BaseQuery , TagTypes , ResultType , ReducerPath >
918
+ | QueryDefinition <
919
+ QueryArg ,
920
+ BaseQuery ,
921
+ TagTypes ,
922
+ ResultType ,
923
+ ReducerPath ,
924
+ RawResultType
925
+ >
926
+ | MutationDefinition <
927
+ QueryArg ,
928
+ BaseQuery ,
929
+ TagTypes ,
930
+ ResultType ,
931
+ ReducerPath ,
932
+ RawResultType
933
+ >
919
934
| InfiniteQueryDefinition <
920
935
QueryArg ,
921
936
PageParam ,
922
937
BaseQuery ,
923
938
TagTypes ,
924
939
ResultType ,
925
- ReducerPath
940
+ ReducerPath ,
941
+ RawResultType
926
942
>
927
943
928
944
export type EndpointDefinitions = Record <
929
945
string ,
930
- EndpointDefinition < any , any , any , any >
946
+ EndpointDefinition < any , any , any , any , any , any , any >
931
947
>
932
948
933
949
export function isQueryDefinition (
934
- e : EndpointDefinition < any , any , any , any > ,
935
- ) : e is QueryDefinition < any , any , any , any > {
950
+ e : EndpointDefinition < any , any , any , any , any , any , any > ,
951
+ ) : e is QueryDefinition < any , any , any , any , any , any > {
936
952
return e . type === DefinitionType . query
937
953
}
938
954
939
955
export function isMutationDefinition (
940
- e : EndpointDefinition < any , any , any , any > ,
941
- ) : e is MutationDefinition < any , any , any , any > {
956
+ e : EndpointDefinition < any , any , any , any , any , any , any > ,
957
+ ) : e is MutationDefinition < any , any , any , any , any , any > {
942
958
return e . type === DefinitionType . mutation
943
959
}
944
960
945
961
export function isInfiniteQueryDefinition (
946
- e : EndpointDefinition < any , any , any , any > ,
947
- ) : e is InfiniteQueryDefinition < any , any , any , any , any > {
962
+ e : EndpointDefinition < any , any , any , any , any , any , any > ,
963
+ ) : e is InfiniteQueryDefinition < any , any , any , any , any , any , any > {
948
964
return e . type === DefinitionType . infinitequery
949
965
}
950
966
@@ -996,7 +1012,15 @@ export type EndpointBuilder<
996
1012
> ,
997
1013
'type'
998
1014
> ,
999
- ) : QueryDefinition < QueryArg , BaseQuery , TagTypes , ResultType , ReducerPath >
1015
+ ) : QueryDefinition <
1016
+ QueryArg ,
1017
+ BaseQuery ,
1018
+ TagTypes ,
1019
+ ResultType ,
1020
+ ReducerPath ,
1021
+ RawResultType
1022
+ >
1023
+
1000
1024
/**
1001
1025
* An endpoint definition that alters data on the server or will possibly invalidate the cache.
1002
1026
*
@@ -1040,17 +1064,31 @@ export type EndpointBuilder<
1040
1064
> ,
1041
1065
'type'
1042
1066
> ,
1043
- ) : MutationDefinition < QueryArg , BaseQuery , TagTypes , ResultType , ReducerPath >
1067
+ ) : MutationDefinition <
1068
+ QueryArg ,
1069
+ BaseQuery ,
1070
+ TagTypes ,
1071
+ ResultType ,
1072
+ ReducerPath ,
1073
+ RawResultType
1074
+ >
1044
1075
1045
- infiniteQuery < ResultType , QueryArg , PageParam > (
1076
+ infiniteQuery <
1077
+ ResultType ,
1078
+ QueryArg ,
1079
+ PageParam ,
1080
+ RawResultType extends
1081
+ BaseQueryResult < BaseQuery > = BaseQueryResult < BaseQuery > ,
1082
+ > (
1046
1083
definition : OmitFromUnion <
1047
1084
InfiniteQueryDefinition <
1048
1085
QueryArg ,
1049
1086
PageParam ,
1050
1087
BaseQuery ,
1051
1088
TagTypes ,
1052
1089
ResultType ,
1053
- ReducerPath
1090
+ ReducerPath ,
1091
+ RawResultType
1054
1092
> ,
1055
1093
'type'
1056
1094
> ,
@@ -1060,7 +1098,8 @@ export type EndpointBuilder<
1060
1098
BaseQuery ,
1061
1099
TagTypes ,
1062
1100
ResultType ,
1063
- ReducerPath
1101
+ ReducerPath ,
1102
+ RawResultType
1064
1103
>
1065
1104
}
1066
1105
@@ -1112,16 +1151,16 @@ export type QueryArgFrom<D extends BaseEndpointDefinition<any, any, any, any>> =
1112
1151
export type InfiniteQueryArgFrom <
1113
1152
D extends BaseEndpointDefinition < any , any , any , any > ,
1114
1153
> =
1115
- D extends InfiniteQueryDefinition < infer QA , any , any , any , any , any >
1154
+ D extends InfiniteQueryDefinition < infer QA , any , any , any , any , any , any >
1116
1155
? QA
1117
1156
: never
1118
1157
1119
1158
export type QueryArgFromAnyQuery <
1120
1159
D extends BaseEndpointDefinition < any , any , any , any > ,
1121
1160
> =
1122
- D extends InfiniteQueryDefinition < any , any , any , any , any , any >
1161
+ D extends InfiniteQueryDefinition < any , any , any , any , any , any , any >
1123
1162
? InfiniteQueryArgFrom < D >
1124
- : D extends QueryDefinition < any , any , any , any >
1163
+ : D extends QueryDefinition < any , any , any , any , any , any >
1125
1164
? QueryArgFrom < D >
1126
1165
: never
1127
1166
@@ -1130,16 +1169,23 @@ export type ResultTypeFrom<
1130
1169
> = D extends BaseEndpointDefinition < any , any , infer RT , any > ? RT : unknown
1131
1170
1132
1171
export type ReducerPathFrom <
1133
- D extends EndpointDefinition < any , any , any , any , any > ,
1134
- > = D extends EndpointDefinition < any , any , any , any , infer RP > ? RP : unknown
1172
+ D extends EndpointDefinition < any , any , any , any , any , any , any > ,
1173
+ > =
1174
+ D extends EndpointDefinition < any , any , any , any , infer RP , any , any >
1175
+ ? RP
1176
+ : unknown
1135
1177
1136
- export type TagTypesFrom < D extends EndpointDefinition < any , any , any , any > > =
1137
- D extends EndpointDefinition < any , any , infer RP , any > ? RP : unknown
1178
+ export type TagTypesFrom <
1179
+ D extends EndpointDefinition < any , any , any , any , any , any , any > ,
1180
+ > =
1181
+ D extends EndpointDefinition < any , any , infer TT , any , any , any , any >
1182
+ ? TT
1183
+ : unknown
1138
1184
1139
1185
export type PageParamFrom <
1140
- D extends InfiniteQueryDefinition < any , any , any , any , any , any > ,
1186
+ D extends InfiniteQueryDefinition < any , any , any , any , any , any , any > ,
1141
1187
> =
1142
- D extends InfiniteQueryDefinition < any , infer PP , any , any , any , any >
1188
+ D extends InfiniteQueryDefinition < any , infer PP , any , any , any , any , any >
1143
1189
? PP
1144
1190
: unknown
1145
1191
0 commit comments