Skip to content

Commit

Permalink
fix: presets options to generic in typescript (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samridhi-98 authored Apr 11, 2022
1 parent 16a9494 commit d46c207
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/generators/typescript/TypeScriptPreset.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/* eslint-disable @typescript-eslint/ban-types */
import { Preset, ClassPreset, InterfacePreset, EnumPreset, CommonPreset } from '../../models';

import { ClassRenderer, TS_DEFAULT_CLASS_PRESET } from './renderers/ClassRenderer';
import { InterfaceRenderer, TS_DEFAULT_INTERFACE_PRESET } from './renderers/InterfaceRenderer';
import { EnumRenderer, TS_DEFAULT_ENUM_PRESET } from './renderers/EnumRenderer';
import { TypeRenderer, TS_DEFAULT_TYPE_PRESET } from './renderers/TypeRenderer';

export type TypePreset<R extends TypeRenderer = TypeRenderer> = CommonPreset<R>
export type TypePreset<R extends TypeRenderer = TypeRenderer, O extends object = any> = CommonPreset<R, O>

export type TypeScriptPreset = Preset<{
class: ClassPreset<ClassRenderer>;
interface: InterfacePreset<InterfaceRenderer>;
enum: EnumPreset<EnumRenderer>;
type: TypePreset;
export type TypeScriptPreset<O extends object = any> = Preset<{
class: ClassPreset<ClassRenderer, O>;
interface: InterfacePreset<InterfaceRenderer, O>;
enum: EnumPreset<EnumRenderer, O>;
type: TypePreset<TypeRenderer, O>;
}>;

export const TS_DEFAULT_PRESET: TypeScriptPreset = {
Expand Down

0 comments on commit d46c207

Please sign in to comment.