Skip to content

Interface vs Const with same name confusion #2106

Closed
@alexdonh

Description

@alexdonh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedContributions are especially encouraged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions