Skip to content
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

TypeScript Labeled Tuples #1357

Closed
jplante opened this issue Aug 25, 2020 · 2 comments
Closed

TypeScript Labeled Tuples #1357

jplante opened this issue Aug 25, 2020 · 2 comments
Labels
enhancement Improved functionality

Comments

@jplante
Copy link

jplante commented Aug 25, 2020

With TypeScript 4.0 they have introduced Labeled Tuples:
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#labeled-tuple-elements

The current tuple types in the JSON output from TypeDocs provides the following information about a tuple type:

elements:(2) [{…}, {…}]
  0:{
    type: 'intrinsic', 
    name: 'number'
  }
  1:{
    type: 'intrinsic', 
    name: 'number'
  },
type:'tuple'

As you can see the elements in the tuple do not include their labels.

Before in 3.x your tuple might be:

export type PointAlias = 
  | Point
  | { x: number, y: number }
  | [ number, number ]

This tuple above does not indicate the order of "x,y" or "y,x"

But with 4.x and labeled tuples you can provide:

export type PointAlias  = 
  | Point
  | { x: number, y: number }
  | [ x: number, y: number ]

However currently TypeDoc does not provide that extra meta-data about the tuple types.

@jplante jplante added the enhancement Improved functionality label Aug 25, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Aug 26, 2020

I'm somewhat surprised TypeDoc runs at all with 4.x... I worked on adding this and upgrading to 4.x last weekend but ran into issues & what I think is a bug in the latest TS. I'll hopefully have time to build this this weekend.

Gerrit0 added a commit that referenced this issue Aug 28, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Aug 28, 2020

Support has been released in 0.19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality
Projects
None yet
Development

No branches or pull requests

2 participants