Skip to content

Commit

Permalink
improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
mathysth committed Jun 17, 2024
1 parent ff50df1 commit 7a8461f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/hono-openapi-adapter/src/start/hono-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class HonoAdapter extends HttpAdapter {
bindToContainers(container);
}

public listen(config: FactoryConfig<string>): IHttpServe {
public listen(config: FactoryConfig): IHttpServe {
const app = IocContainer.container.get(Server);
const configService = IocContainer.container.get(ConfigService);
defineReflection(app);
Expand Down
12 changes: 6 additions & 6 deletions packages/hono-openapi-adapter/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import type { RouteConfig } from './hono-zod.type';

export type RouteParameters = RouteConfig;
export type GuardsType<T extends GuardAbstract = any> = new (...args: any) => T;
export type FactoryConfig<T extends string> = FactoryBaseConfig & FactoryOAS<T>;
export type FactoryOAS<T extends string> = {
metadata?: FactoryOASMetadatas<T>;
export type FactoryConfig = FactoryBaseConfig & FactoryOAS;
export type FactoryOAS = {
metadata?: FactoryOASMetadatas;
};
export type FactoryOASMetadatas<T extends string = ''> = {
export type FactoryOASMetadatas = {
/** default: false */
enableSwaggerInProd?: boolean;
/** default: /swagger */
Expand All @@ -18,7 +18,7 @@ export type FactoryOASMetadatas<T extends string = ''> = {
/** Url of OAP */
url: string;
/** OAP configuration */
config: OASType<T>;
config: OASType;
};
};
type OASType<T extends string> = OpenAPIObjectConfigure<any, T>;
type OASType = OpenAPIObjectConfigure<any, string>;

0 comments on commit 7a8461f

Please sign in to comment.