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' {
3
3
import { ResponseContract } from '@ioc:Adonis/Core/Response' ;
4
4
5
5
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 > ;
7
8
8
9
/**
9
10
* Shared data types
@@ -31,7 +32,7 @@ declare module '@ioc:EidelLev/Inertia' {
31
32
* @param {string } component Page component
32
33
* @param {ResponseProps } responseProps Props
33
34
*/
34
- render ( component : string , responseProps ?: ResponseProps , pageOnlyProps ?: ResponseProps ) : RenderResponse ;
35
+ render < T extends ResponseProps > ( component : string , responseProps ?: T , pageOnlyProps ?: ResponseProps ) : RenderResponse < T > ;
35
36
36
37
/**
37
38
* Redirect back with the correct HTTP status code
You can’t perform that action at this time.
0 commit comments