Mark `createFlash` as deprecated and improve documentation
-
Mark
createFlash
as@deprecated
and encourage the use of the newer, Pajama compliant,createAlert
. -
Improve the JSDoc parameter documentation:
- stricter type for
options.type
(createFlash
) andoptions.variant
(createAlert
): instead ofString
it is now a union of constants ('success'|'warning'...
) - add a missing parameter,
options.addBodyClass
, tocreateFlash
- change the way to indicate optional parameters: instead of using the
?
, use[...]
(see JSDoc).
Improved developer experience
vscode shows that the function is deprecated (crossed) and the possible values the option type
:
In vscode, if the option "checkJs": true
in jsconfig.json
it will display an error for non-valid argument types:
Edited by Eduardo Sanz García