Skip to content

Commit

Permalink
refactor(utils): Convert utils/deprecation.js to TypeScript
Browse files Browse the repository at this point in the history
This was done manually for test/proving purposes and might need to
be corrected based on what MigranTS generated.
  • Loading branch information
cpcallen committed Jun 16, 2022
1 parent 5c3d72b commit 70516d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions core/utils/deprecation.js → core/utils/deprecation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
* This method is not specific to Blockly.
* @namespace Blockly.utils.deprecation
*/
goog.module('Blockly.utils.deprecation');
import * as goog from '../../closure/goog/goog.js';

goog.declareModuleId('Blockly.utils.deprecation');


/**
Expand All @@ -30,12 +32,12 @@ goog.module('Blockly.utils.deprecation');
* @alias Blockly.utils.deprecation.warn
* @package
*/
const warn = function(name, deprecationDate, deletionDate, opt_use) {
const warn = function(name: string, deprecationDate: string, deletionDate: string, opt_use?: string) {
let msg = name + ' was deprecated on ' + deprecationDate +
' and will be deleted on ' + deletionDate + '.';
if (opt_use) {
msg += '\nUse ' + opt_use + ' instead.';
}
console.warn(msg);
};
exports.warn = warn;
export {warn};
3 changes: 2 additions & 1 deletion scripts/gulpfiles/chunks.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunk": [
"blockly:259",
"blockly:260",
"blocks:10:blockly",
"all:11:blockly",
"all1:11:blockly",
Expand Down Expand Up @@ -250,6 +250,7 @@
"./build/src/core/utils/parsing.js",
"./build/src/core/extensions.js",
"./build/src/core/block.js",
"./build/src/closure/goog/goog.js",
"./build/src/core/utils/deprecation.js",
"./build/src/core/utils/string.js",
"./build/src/core/dialog.js",
Expand Down

0 comments on commit 70516d5

Please sign in to comment.