Skip to content

autocompletion of static methods from the model class  #36

@Harper04

Description

@Harper04

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions