deno_doc
deno_doc copied to clipboard
Render properties of interface-like type aliases to be like the interface
Summary
deno doc does not take JSDoc into account when it encounters interface-like type alias. using type alias for documenting can be beneficial when the library owner does not intend to 'patch' interface globally.
Steps to reproduce
- create interface and type.
// example.ts
export interface Foo {
/**
* @param x - The number to do something with
* @returns The number after doing something
*/
foo: (x: number) => number
}
export type Bar = {
/**
* @param x - The number to do something with
* @returns The number after doing something
*/
bar: (x: number) => number
}
- run
deno doc.
$ deno doc example.ts
Defined in file:///home/scarf/repo/etc/typed_regex/example.ts:1:1
interface Foo
foo: (x: number) => number
@param x
- The number to do something with
@return
The number after doing something
Defined in file:///home/scarf/repo/etc/typed_regex/example.ts:9:1
type Bar = { bar: (x: number) => number; }
Expected Outcome
type Bar
bar: (x: number) => number
@param x
- The number to do something with
@return
The number after doing something
Others
i thought #302 was already opened, but was confirmed at discord that they weren't the same
The topic on discord was slightly different: the topic was about rendering of individual properties of interface-like type aliases to be like the interface view