I am building a rest api using loopback.js I recenntly discovered this npm resource. So I went ahead and installed these types in my project.
But either I am missing something or these types have problems. My intellisense does not show me everything. Let me illustrate with an example.
First here is a sample definition of the PersistedModel from the index.d.ts:
class PersistedModel extends Model {
static count(where?: any, callback?: (err: Error, count: number) => void): void;
static find(
filter?: {fields?: string|any|any[];
include?: string|any|any[]; limit?: number; order?: string;
skip?: number; where?: any; },
callback?: (err: Error, models: any[]) => void): void;
}
Now let say I define a variable myModel of type PersistedModel
var myModel:PersistedModel = some_value;
(some_value is also of type PersistedModel)
When I write myModel., I would expect visual studio code to display the available list of all methods and properties of PersistedModel
Instead there are some methods although clearly defined in the index.d.ts file which do not appear in the dropdown list from intellisense. In the above example, the find method is missing from the intellisense dropdown list
Is this a bug in vscode? a poorly generated typings from the loopback or am I doing something wrong with my setup (typescript, vscode).
Has any body being able to write loopback application with typescript? Is there any documentation with best practices?
Thank you for your attention and your help