File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ declare module '@ioc:EidelLev/Inertia' {
33 import { ResponseContract } from '@ioc:Adonis/Core/Response' ;
44
55 export type ResponseProps = Record < string , unknown > ;
6- export type RenderResponse = Promise < Record < string , unknown > | string | ResponseContract > ;
6+ export type RenderResponse < T extends ResponseProps > = Promise < T | string | ResponseContract > ;
7+ export type InertiaPage < T extends ( ...args : any ) => any > = Exclude < Awaited < ReturnType < T > > , string | ResponseContract > ;
78
89 /**
910 * Shared data types
@@ -31,7 +32,7 @@ declare module '@ioc:EidelLev/Inertia' {
3132 * @param {string } component Page component
3233 * @param {ResponseProps } responseProps Props
3334 */
34- render ( component : string , responseProps ?: ResponseProps , pageOnlyProps ?: ResponseProps ) : RenderResponse ;
35+ render < T extends ResponseProps > ( component : string , responseProps ?: T , pageOnlyProps ?: ResponseProps ) : RenderResponse < T > ;
3536
3637 /**
3738 * Redirect back with the correct HTTP status code
You can’t perform that action at this time.
0 commit comments