joarwilk / flowgen

Generate flowtype definition files from TypeScript
Other
658 stars 78 forks source link

"static get" or static getters, being remove from classes #170

Closed yradchen closed 2 years ago

yradchen commented 2 years ago

Noticed that classes that have 'static get' in them have the 'static get' part removed, resulting in in flow not being able to read the getter. For example, take this class in typescript

export default class Test {
    static get hello(): string;
    static logSomething(): void;
}

results in the following flow

declare export default class Test {
  hello: string;
  static logSomething(): void;
}

Attempting to call Test.hello in flow results in the error Cannot get "Test.hello" because property "hello" is missing in statics of "Test" [1] . Attempting to access logSomething works perfectly fine.

This was created and tested using;