Skip to content

Commit 46c621e

Browse files
committed
Provide a proper type for CACHE_OPTIONS
1 parent 061f5c0 commit 46c621e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/templates/core/OpenAPI.hbs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import type { ApiRequestOptions } from './ApiRequestOptions';
55
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
66
type Headers = Record<string, string>;
77

8+
export type ApiCacheOptions = {
9+
enabled: boolean;
10+
ttl?: number;
11+
key?: string;
12+
};
13+
814
export type OpenAPIConfig = {
915
BASE: string;
1016
VERSION: string;
@@ -15,7 +21,7 @@ export type OpenAPIConfig = {
1521
PASSWORD?: string | Resolver<string> | undefined;
1622
HEADERS?: Headers | Resolver<Headers> | undefined;
1723
ENCODE_PATH?: ((path: string) => string) | undefined;
18-
CACHE_OPTIONS?: Record<string, any> | undefined;
24+
CACHE_OPTIONS?: ApiCacheOptions | undefined;
1925
};
2026

2127
export const OpenAPI: OpenAPIConfig = {

0 commit comments

Comments
 (0)