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

autocompletion of static methods from the model class #36

Open
Harper04 opened this issue Mar 17, 2018 · 1 comment
Open

autocompletion of static methods from the model class #36

Harper04 opened this issue Mar 17, 2018 · 1 comment

Comments

@Harper04
Copy link
Contributor

The types definition seems to be correct:

export default class Model {
    static readsPerSecond: number;
    static writesPerSecond: number;
    static all<T extends Model>(this: {
        new (): T;
    }): Promise<T[]>;
    static clear<T extends Model>(): Promise<number>;
    static create<T extends Model>(this: {
        new (): T;
    }, data: any): Promise<T>;
    static find<T extends Model>(this: {
        new (): T;
    }, id: string): Promise<T>;
    static remove<T extends Model>(id: string): Promise<boolean>;
...
}

But for a simple class:

export default class Measurement extends Model {
  @field channel: string
  @field timestamp: number = new Date().getTime()
  @field temperature: number
}

i only get the static variables...
image

@Harper04
Copy link
Contributor Author

Harper04 commented Mar 17, 2018

maybe just a typescript bug after all; if you type it typescript is able to identify the method
bildschirmfoto 2018-03-17 um 08 10 49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant