ts-typed-api 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,4 +32,4 @@ export type HonoTypedContext<TDef extends ApiDefinitionSchema, TDomain extends k
32
32
  };
33
33
  export declare function registerHonoRouteHandlers<TDef extends ApiDefinitionSchema, TBindings extends Env = Env, TVariables extends Record<string, never> = Record<string, never>, TPath extends string = "/">(app: Hono<TBindings, TVariables, TPath>, apiDefinition: TDef, routeHandlers: Array<SpecificRouteHandler<TDef>>, middlewares?: EndpointMiddleware<TDef>[]): void;
34
34
  export declare function RegisterHonoHandlers<TDef extends ApiDefinitionSchema, Ctx extends Record<string, any> = Record<string, any>, TBindings extends Env = Env, TVariables extends Record<string, never> = Record<string, never>, TPath extends string = "/">(app: Hono<TBindings, TVariables, TPath>, apiDefinition: TDef, objectHandlers: ObjectHandlers<TDef, Ctx>, middlewares?: AnyMiddleware<TDef>[]): void;
35
- export declare function CreateTypedHonoHandlerWithContext<Ctx extends Record<string, any>>(): <TDef extends ApiDefinitionSchema>(app: Hono, apiDefinition: TDef, objectHandlers: ObjectHandlers<TDef, Ctx>, middlewares?: AnyMiddleware<TDef>[]) => void;
35
+ export declare function CreateTypedHonoHandlerWithContext<Ctx extends Record<string, any>>(): <TDef extends ApiDefinitionSchema, TBindings extends Env = Env, TVariables extends Record<string, never> = Record<string, never>, TPath extends string = "/">(app: Hono<TBindings, TVariables, TPath>, apiDefinition: TDef, objectHandlers: ObjectHandlers<TDef, Ctx>, middlewares?: AnyMiddleware<TDef>[]) => void;
@@ -1,6 +1,6 @@
1
1
  export { CreateApiDefinition, CreateResponses } from './definition';
2
2
  export { z as ZodSchema } from 'zod';
3
- export { EndpointMiddleware } from './object-handlers';
3
+ export { EndpointMiddleware, EndpointMiddlewareCtx } from './object-handlers';
4
4
  export { RegisterHonoHandlers, CreateTypedHonoHandlerWithContext } from './hono-cloudflare-workers';
5
5
  export type { ApiDefinitionSchema, RouteSchema, UnifiedError, FileUploadConfig, HttpSuccessStatusCode, HttpClientErrorStatusCode, HttpServerErrorStatusCode, AllowedInputStatusCode, AllowedResponseStatusCode } from './definition';
6
6
  export type { HonoFile, HonoFileType, HonoTypedContext } from './hono-cloudflare-workers';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-typed-api",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "A lightweight, type-safe RPC library for TypeScript with Zod validation",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -588,8 +588,13 @@ export function RegisterHonoHandlers<
588
588
  }
589
589
 
590
590
  export function CreateTypedHonoHandlerWithContext<Ctx extends Record<string, any>>() {
591
- return function <TDef extends ApiDefinitionSchema>(
592
- app: Hono,
591
+ return function <
592
+ TDef extends ApiDefinitionSchema,
593
+ TBindings extends Env = Env,
594
+ TVariables extends Record<string, never> = Record<string, never>,
595
+ TPath extends string = "/"
596
+ >(
597
+ app: Hono<TBindings, TVariables, TPath>,
593
598
  apiDefinition: TDef,
594
599
  objectHandlers: ObjectHandlers<TDef, Ctx>,
595
600
  middlewares?: AnyMiddleware<TDef>[]
package/src/hono-only.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // Excludes Express dependencies like multer, busboy, etc.
3
3
  export { CreateApiDefinition, CreateResponses } from './definition';
4
4
  export { z as ZodSchema } from 'zod';
5
- export { EndpointMiddleware } from './object-handlers'
5
+ export { EndpointMiddleware, EndpointMiddlewareCtx } from './object-handlers'
6
6
 
7
7
  // Hono adapter for Cloudflare Workers
8
8
  export { RegisterHonoHandlers, CreateTypedHonoHandlerWithContext } from './hono-cloudflare-workers';