Skip to content

Commit

Permalink
chore(types): export generation options types
Browse files Browse the repository at this point in the history
In order to configure generation options in a separate file, let's export types for generation
options.
  • Loading branch information
nfroidure committed Sep 29, 2023
1 parent 6f3e3e2 commit 4697e26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const DEFAULT_JSON_SCHEMA_OPTIONS: Required<JSONSchemaOptions> = {
generateRealEnums: false,
exportNamespaces: false,
};
export const DEFAULT_OPEN_API_OPTIONS: OpenAPIOptions = {
export const DEFAULT_OPEN_API_OPTIONS: OpenAPITypesGenerationOptions = {
baseName: 'API',
filterStatuses: [],
brandedTypes: [],
Expand All @@ -98,7 +98,7 @@ export const DEFAULT_OPEN_API_OPTIONS: OpenAPIOptions = {
requireCleanAPI: false,
};

type OpenAPIOptions = {
export type OpenAPITypesGenerationOptions = {
baseName: string;
filterStatuses?: (number | 'default')[];
generateUnusedSchemas?: boolean;
Expand Down Expand Up @@ -134,9 +134,9 @@ export async function generateOpenAPITypes(
generateRealEnums = DEFAULT_OPEN_API_OPTIONS.generateRealEnums,
exportNamespaces = DEFAULT_OPEN_API_OPTIONS.exportNamespaces,
requireCleanAPI = DEFAULT_OPEN_API_OPTIONS.requireCleanAPI,
}: Omit<OpenAPIOptions, 'baseName' | 'brandedTypes'> &
}: Omit<OpenAPITypesGenerationOptions, 'baseName' | 'brandedTypes'> &
Partial<
Pick<OpenAPIOptions, 'baseName' | 'brandedTypes'>
Pick<OpenAPITypesGenerationOptions, 'baseName' | 'brandedTypes'>
> = DEFAULT_OPEN_API_OPTIONS,
): Promise<NodeArray<Statement>> {
const components: {
Expand Down

0 comments on commit 4697e26

Please sign in to comment.