File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ declare module '@ioc:EidelLev/Inertia' {
22 import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' ;
33 import { ResponseContract } from '@ioc:Adonis/Core/Response' ;
44
5+ type AdonisControllerMethod = ( ...args : any ) => any ;
56 export type ResponseProps = Record < string , unknown > ;
6- export type RenderResponse = Promise < Record < string , unknown > | string | ResponseContract > ;
7+ export type RenderResponse < T extends ResponseProps > = Promise < T | string | ResponseContract > ;
8+ export type InertiaPage < T extends AdonisControllerMethod > = Exclude < Awaited < ReturnType < T > > , string | ResponseContract > ;
79
810 /**
911 * Shared data types
@@ -31,7 +33,7 @@ declare module '@ioc:EidelLev/Inertia' {
3133 * @param {string } component Page component
3234 * @param {ResponseProps } responseProps Props
3335 */
34- render ( component : string , responseProps ?: ResponseProps , pageOnlyProps ?: ResponseProps ) : RenderResponse ;
36+ render < T extends ResponseProps > ( component : string , responseProps ?: T , pageOnlyProps ?: ResponseProps ) : RenderResponse < T > ;
3537
3638 /**
3739 * Redirect back with the correct HTTP status code
You can’t perform that action at this time.
0 commit comments