@@ -35,6 +35,7 @@ import type { AnyWSLocalHook } from './ws/types'
3535import type { WebSocketHandler } from './ws/bun'
3636
3737import type { Instruction as ExactMirrorInstruction } from 'exact-mirror'
38+ import { BunHTMLBundlelike } from './universal/types'
3839
3940export type IsNever < T > = [ T ] extends [ never ] ? true : false
4041
@@ -1063,7 +1064,8 @@ export type MacroToContext<
10631064 // @ts -expect-error type is checked in key mapping
10641065 Value [ 'resolve' ]
10651066 >
1066- > & MacroToContext <
1067+ > &
1068+ MacroToContext <
10671069 MacroFn ,
10681070 // @ts -ignore trust me bro
10691071 Pick <
@@ -1143,6 +1145,24 @@ type InlineResponse =
11431145 | AnyElysiaCustomStatusResponse
11441146 | ElysiaFile
11451147 | Record < any , unknown >
1148+ | BunHTMLBundlelike
1149+
1150+ type LastOf < T > =
1151+ UnionToIntersect < T extends any ? ( ) => T : never > extends ( ) => infer R
1152+ ? R
1153+ : never ;
1154+
1155+ type Push < T extends any [ ] , V > = [ ...T , V ] ;
1156+
1157+ type TuplifyUnion < T , L = LastOf < T > , N = [ T ] extends [ never ] ? true : false > =
1158+ true extends N
1159+ ? [ ]
1160+ : Push < TuplifyUnion < Exclude < T , L > > , L > ;
1161+
1162+ export type Tuple < T , A extends T [ ] = [ ] > =
1163+ TuplifyUnion < T > [ 'length' ] extends A [ 'length' ]
1164+ ? [ ...A ]
1165+ : Tuple < T , [ T , ...A ] > ;
11461166
11471167export type InlineHandler <
11481168 Route extends RouteSchema = { } ,
@@ -1177,7 +1197,13 @@ export type InlineHandler<
11771197 | ( Route [ 'response' ] extends {
11781198 200 : any
11791199 }
1180- ? Route [ 'response' ] [ 200 ]
1200+ ?
1201+ | Route [ 'response' ] [ 200 ]
1202+ | ElysiaCustomStatusResponse <
1203+ 200 ,
1204+ Route [ 'response' ] [ 200 ] ,
1205+ 200
1206+ >
11811207 : unknown )
11821208 // This could be possible because of set.status
11831209 | Route [ 'response' ] [ keyof Route [ 'response' ] ]
@@ -1732,7 +1758,7 @@ export type GuardLocalHook<
17321758 AfterHandle extends MaybeArray < AfterHandler < any , any > > ,
17331759 ErrorHandle extends MaybeArray < ErrorHandler < any , any , any > > ,
17341760 GuardType extends GuardSchemaType = 'standalone' ,
1735- AsType extends LifeCycleType = 'local' ,
1761+ AsType extends LifeCycleType = 'local'
17361762> = ( Input extends any ? Input : Prettify < Input > ) & {
17371763 /**
17381764 * @default 'override'
0 commit comments