denoland / doc_components

A set of components for rendering deno_doc doc nodes
https://deno-doc-components.deno.dev
MIT License
21 stars 13 forks source link

Inferring public properties from a class's constructor is not supported. #33

Open masx200 opened 1 year ago

masx200 commented 1 year ago

Inferring public properties from a class's constructor is not supported. input :

export class TrieNode {
    constructor(
        public wordCount: number = 0,
        public prefixCount: number = 0,
        public readonly children = new Map<string, TrieNode>(),
    ) {}
}

https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBAYwDYEMDOa4BUoEtgByEAJsHAN4CwAUHHYhAHZoxQCuCM0AFDff3DBsARklwI4Ad2jEAwhDaMYALjiM2AW2HAocALxwADABo+AukNHjBUYADNcIeYpVrN23QZNnzlsRNsUYiYkAE9EAAtcJGJbRn01YEk4AFkUMAAeFjxGAHNjbDxCEmAAPm4ASlNaegqKAF8aRuogA

output:

export declare class TrieNode {
    wordCount: number;
    prefixCount: number;
    readonly children: Map<string, TrieNode>;
    constructor(wordCount?: number, prefixCount?: number, children?: Map<string, TrieNode>);
}

https://doc.deno.land/https://deno.land/x/masx200_leetcode_test@10.3.0/implement-trie-ii-prefix-tree/TrieNode.ts/~/TrieNode

https://deno.land/x/masx200_leetcode_test@10.3.0/implement-trie-ii-prefix-tree/TrieNode.ts?source

image
kitsonk commented 1 year ago

I believe the accessor information is in the constructor params, it is a matter though of pulling that out and displaying it.

deno.land/x view: https://deno.land/x/masx200_leetcode_test@10.3.0/implement-trie-ii-prefix-tree/TrieNode.ts?s=TrieNode