@@ -24,11 +24,14 @@ import {
2424 SpecValidatorGeneratorInput ,
2525 SpecValidatorGeneratorRawInput ,
2626} from "./request" ;
27- import type { StandardSchemaV1 as SS } from "@standard-schema/spec" ;
27+ import type {
28+ StandardSchemaV1 as SS ,
29+ StandardSchemaV1 ,
30+ } from "@standard-schema/spec" ;
2831import {
2932 listDefinedResponseApiSpecKeys ,
3033 ResponseSpecValidator ,
31- ResponseSpecValidatorGeneratorRawInput ,
34+ ResponseSpecValidatorGeneratorInput ,
3235} from "./response" ;
3336import { StatusCode } from "../hono-types" ;
3437export type SSResult < Data > = SS . Result < Data > | Promise < SS . Result < Data > > ;
@@ -137,19 +140,21 @@ export type ValidatorInputError =
137140 | ValidatorInputMethodNotFoundError
138141 | ValidatorInputPathNotFoundError ;
139142
140- export const newValidatorMethodNotFoundError = ( method : string ) => ( {
141- target : "method" as const ,
142- actual : method ,
143- message : `method does not exist in endpoint` as const ,
144- } ) ;
143+ export const newValidatorMethodNotFoundError = ( method : string ) =>
144+ ( {
145+ target : "method" as const ,
146+ actual : method ,
147+ message : `method does not exist in endpoint` as const ,
148+ } ) satisfies StandardSchemaV1 . Issue & Record < string , unknown > ;
145149type ValidatorInputMethodNotFoundError = ReturnType <
146150 typeof newValidatorMethodNotFoundError
147151> ;
148- export const newValidatorPathNotFoundError = ( path : string ) => ( {
149- target : "path" as const ,
150- actual : path ,
151- message : `path does not exist in endpoints` as const ,
152- } ) ;
152+ export const newValidatorPathNotFoundError = ( path : string ) =>
153+ ( {
154+ target : "path" as const ,
155+ actual : path ,
156+ message : `path does not exist in endpoints` as const ,
157+ } ) satisfies StandardSchemaV1 . Issue & Record < string , unknown > ;
153158type ValidatorInputPathNotFoundError = ReturnType <
154159 typeof newValidatorPathNotFoundError
155160> ;
@@ -179,7 +184,7 @@ export const newValidator = <E extends ApiEndpointsSchema>(endpoints: E) => {
179184 return Result . data ( validators as ToValidators < E , Path , M > ) ;
180185 } ;
181186 const res = < Path extends string , M extends string , SC extends number > (
182- input : ResponseSpecValidatorGeneratorRawInput < Path , M , SC > ,
187+ input : ResponseSpecValidatorGeneratorInput < Path , M , SC > ,
183188 ) : Result <
184189 ToSSResponseValidators < ApiResponses < E , Path , M > , SC > ,
185190 ValidatorInputError
0 commit comments