File tree Expand file tree Collapse file tree
libs/ts-rest/core/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @ts-rest/core ' : patch
3+ ---
4+
5+ Remove unnecessary recursion
Original file line number Diff line number Diff line change @@ -66,17 +66,17 @@ type ContractInstance = {
6666 /**
6767 * A collection of routes or routers
6868 */
69- router : < T extends AppRouter > ( endpoints : Narrow < T > ) => Narrow < T > ;
69+ router : < T extends AppRouter > ( endpoints : Narrow < T > ) => T ;
7070 /**
7171 * A single query route, should exist within
7272 * a {@link AppRouter}
7373 */
74- query : < T extends AppRouteQuery > ( query : Narrow < T > ) => Narrow < T > ;
74+ query : < T extends AppRouteQuery > ( query : Narrow < T > ) => T ;
7575 /**
7676 * A single mutation route, should exist within
7777 * a {@link AppRouter}
7878 */
79- mutation : < T extends AppRouteMutation > ( mutation : Narrow < T > ) => Narrow < T > ;
79+ mutation : < T extends AppRouteMutation > ( mutation : Narrow < T > ) => T ;
8080 /**
8181 * Exists to allow storing a Type in the contract (at compile time only)
8282 */
@@ -100,8 +100,11 @@ export const initTsRest = (): ContractInstance => initContract();
100100 */
101101export const initContract = ( ) : ContractInstance => {
102102 return {
103+ // @ts -expect-error - this is a type error, but it's not clear how to fix it
103104 router : ( args ) => args ,
105+ // @ts -expect-error - this is a type error, but it's not clear how to fix it
104106 query : ( args ) => args ,
107+ // @ts -expect-error - this is a type error, but it's not clear how to fix it
105108 mutation : ( args ) => args ,
106109 response : < T > ( ) => undefined as unknown as T ,
107110 body : < T > ( ) => undefined as unknown as T ,
You can’t perform that action at this time.
0 commit comments