Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): Support TypeScript in core/ #6220

Merged
merged 8 commits into from
Jun 16, 2022
19 changes: 9 additions & 10 deletions core/utils/deprecation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,21 @@ goog.declareModuleId('Blockly.utils.deprecation');

/**
* Warn developers that a function or property is deprecated.
* @param {string} name The name of the function or property.
* @param {string} deprecationDate The date of deprecation.
* @param name The name of the function or property.
* @param deprecationDate The date of deprecation.
* Prefer 'month yyyy' or 'quarter yyyy' format.
* @param {string} deletionDate The date of deletion, in the same format as the
* @param deletionDate The date of deletion, in the same format as the
* deprecation date.
* @param {string=} opt_use The name of a function or property to use instead,
* if any.
* @param opt_use The name of a function or property to use instead, if any.
* @alias Blockly.utils.deprecation.warn
* @package
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace package with internal rather than deleting it: https://api-extractor.com/pages/tsdoc/tag_internal/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Done.
  2. Turns out this involves suppressing nonStandardJsDocs. But no problem.
  3. Note that the @package annotation was deleted by the tooling that converted this file to TS, not by me. This will be a headache…

*/
const warn = function(name: string, deprecationDate: string, deletionDate: string, opt_use?: string) {
export function warn(
name: string, deprecationDate: string, deletionDate: string,
opt_use?: string) {
let msg = name + ' was deprecated on ' + deprecationDate +
' and will be deleted on ' + deletionDate + '.';
' and will be deleted on ' + deletionDate + '.';
if (opt_use) {
msg += '\nUse ' + opt_use + ' instead.';
}
console.warn(msg);
};
export {warn};
}