Skip to content

[FEATURE]: Typed renderer options #2772

Open
@ladvoc

Description

@ladvoc

I am using QuickType programmatically in a script to generate bindings for multiple languages, and I would like to be able to specify type-safe renderer options for each language. For example:

const rendererOptions = {
  "python-version": "3.6",
  "nice-property-names": true
} satisfies RendererOptions<"python">;

const res = await quicktype({
  inputData,
  lang: "python",
  rendererOptions
});

The above example currently results in a type error:

Type 'boolean' is not assignable to type 'BooleanOption<"nice-property-names">'.ts(2322)

Is it currently possible to get the "raw" TypeScript type corresponding to the renderer options for a specific language?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions