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

Reference to type of property #1226

Closed
1 task done
crowlKats opened this issue Mar 10, 2020 · 1 comment
Closed
1 task done

Reference to type of property #1226

crowlKats opened this issue Mar 10, 2020 · 1 comment
Labels
enhancement Improved functionality

Comments

@crowlKats
Copy link

Problem

let's take this example:

export interface y {
	id: z["id"],
	hello: string,
	bar: boolean
}

export interface z {
	id: string,
	world: string,
	foo: any
}

when generating documentation for this code, this is the result for y:
Screenshot 2020-03-10 at 00 57 44

Suggested Solution

Either set the type of y's id to be the value of z["id"] (so string), or make it a link to the id of the z interface.

@Gerrit0 Gerrit0 added the enhancement Improved functionality label Mar 15, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 15, 2020

I think it would be best to create links in this case, pulling all the indexed access types in directly could cause problems.

There are a couple changes required here.

  1. Fix indexed access types - apparently they aren't storing the ID of their object type if it is a reference (or maybe reference types are broken, not sure)
    image
  2. Update the themes so if the objectType of an indexed access type is a reference and the index type is a string literal, the string literal is linked to the member of the reference type of that name.

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

No branches or pull requests

2 participants