Skip to content

Question/Feature Request: Generating array types to use generic syntax #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SarahFowler73 opened this issue Sep 23, 2022 · 1 comment
Closed

Comments

@SarahFowler73
Copy link

I have read through docs and issues, and haven't been able to find out if there's a way to do this.

Current behavior

The tool currently generates array types in data-contracts.ts using the following syntax:

export interface ModuleListResponse {
  modules: {
    description: string;
    title: string;
    version: number;
  }[];
}

Desired behavior

For the purposes of readability and consistency in our codebase, I'd like to generate the type using the generic syntax:

export interface ModuleListResponse {
  modules: Array<{
    description: string;
    title: string;
    version: number;
  }>;
}

Is there a way to accomplish this in the current implementation?

@js2me js2me mentioned this issue Oct 24, 2022
@js2me
Copy link
Member

js2me commented Nov 18, 2022

Added support of this feature in 11.0.0
--another-array-type option

@js2me js2me closed this as completed Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants