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

Interface vs Const with same name confusion #2106

Closed
alexdonh opened this issue Nov 17, 2022 · 1 comment
Closed

Interface vs Const with same name confusion #2106

alexdonh opened this issue Nov 17, 2022 · 1 comment
Labels
bug Functionality does not match expectation help wanted Contributions are especially encouraged
Milestone

Comments

@alexdonh
Copy link

Search terms

same name interface const

Question

Given the below code:

index.ts

import {Coin} from "./codec/cosmos/base/v1beta1/coin";

export type {Coin};

export function balance(address: string): Promise<Coin> {
  return Promise.resolve({
    amount: "",
    denom: ""
  })
}

coin.ts

export interface Coin {
  denom: string;
  amount: string;
}

export const Coin = {
  // some methods and props
};

On the balance function, how can I tell typedoc to link to the Interface and not the Const?

image

image

Currently the Coin return type in balance() links to the Const object.

@alexdonh alexdonh added the question Question about functionality label Nov 17, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 20, 2022

This is a bug - typedoc today only tracks one symbol->reflection relationship today, so can't tell which one it ought to link to according to if the reference is in type or value space.

@Gerrit0 Gerrit0 added bug Functionality does not match expectation help wanted Contributions are especially encouraged and removed question Question about functionality labels Nov 20, 2022
@Gerrit0 Gerrit0 added this to the v0.26.0 milestone Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

2 participants