You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user configures AVA with JavaScript, it would be useful to have type definition. Users might consume these through JSDoc comments, or through a typed wrapper function.
Details
A wrapper function would be defined like this:
/** * * Configure AVA, with intellisense * * @param {Config} config - A configuration object * @returns {Config} */exportconstdefineConfig=(config)=>config;
We could then also export the Config type from ava/config. I think we should export it through the export map, see #3041. That makes it require TypeScript 4.7 but that's fine for a new feature.
We'd need a way to type the factory methods also.
I'm happy to start with something small and then improve it in subsequent releases.
Would config or define be slightly nicer? Sorry, just bike-shedding 😇
Continuing avajs/typescript#15 (comment)
cc @novemberborn
Summary
When a user configures AVA with JavaScript, it would be useful to have type definition. Users might consume these through JSDoc comments, or through a typed wrapper function.
Details
A wrapper function would be defined like this:
The function would be used like this:
The text was updated successfully, but these errors were encountered: