when studying Mini Program, I found that webstorm has no relevant code hint plug-ins, only an old code snippet plug-in, so I want to write a d.ts
by myself. The problem now is that there can be hints, but if the parameter is a function, it cannot complete the function body, for example:
index.d.ts
interface AppObj {
onLaunch?(): void;
onShow?(): void;
onHide?(): void;
onError?(): void;
onPageNotFound?(): void;
globalData?: Object;
}
declare function App(obj: AppObj):void;
index.js
App({
onLa
})
if you enter onLa
in js and press tab
, you can complete it to onLaunch
, but I want to complete it into the form of onLaunch () {}
or onLaunch: function () {}
or onLaunch: () = > {}
, how to edit d.ts