Search code examples
typescriptautocompletephpstormwebstorm

How to autocomplete TypeScript interface with JetBrains WebStorm


I have a Job interface in a separate file:

export interface Job {
    id: string;
    title: string;
    description: string;
    employerId: string;
    location: {
        address: string;
        city: string;
        state: string;
        zip: string;
    };
    createdAt: string;
}

and when I want to use it..

const mockJob: Job = {}

Is there a quick way of having all the properties be displayed for me ready to type in the values in WebStorm?

Any help here would be greatly appreciated, getting annoying typing them all out.


Solution

  • Would you like properties stubs being auto-generated? No, there is no such possibility now, this feature will only be available in 2018.1 (see WEB-29614 and linked tickets). But you can hit Ctrl+Space within braces and choose properties from completion