mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
refactor(blocks): Migrate blocks/colour.js to TypeScript (#6901)
* refactor(blocks): Auto-migration of blocks/colour.js to ts * fix(blocks): Manually migrate types & fix imports in colour.ts
This commit is contained in:
committed by
GitHub
parent
670f7da802
commit
a0b4a214a9
@@ -7,24 +7,19 @@
|
||||
/**
|
||||
* @fileoverview Colour blocks for Blockly.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.libraryBlocks.colour');
|
||||
import * as goog from '../closure/goog/goog.js';
|
||||
goog.declareModuleId('Blockly.libraryBlocks.colour');
|
||||
|
||||
// const {BlockDefinition} = goog.requireType('Blockly.blocks');
|
||||
// TODO (6248): Properly import the BlockDefinition type.
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const BlockDefinition = Object;
|
||||
const {createBlockDefinitionsFromJsonArray, defineBlocks} = goog.require('Blockly.common');
|
||||
/** @suppress {extraRequire} */
|
||||
goog.require('Blockly.FieldColour');
|
||||
import type {BlockDefinition} from '../core/blocks.js';
|
||||
import {createBlockDefinitionsFromJsonArray, defineBlocks} from '../core/common.js';
|
||||
import '../core/field_colour.js';
|
||||
|
||||
|
||||
/**
|
||||
* A dictionary of the block definitions provided by this module.
|
||||
* @type {!Object<string, !BlockDefinition>}
|
||||
*/
|
||||
const blocks = createBlockDefinitionsFromJsonArray([
|
||||
export const blocks = createBlockDefinitionsFromJsonArray([
|
||||
// Block for colour picker.
|
||||
{
|
||||
'type': 'colour_picker',
|
||||
@@ -115,7 +110,6 @@ const blocks = createBlockDefinitionsFromJsonArray([
|
||||
'tooltip': '%{BKY_COLOUR_BLEND_TOOLTIP}',
|
||||
},
|
||||
]);
|
||||
exports.blocks = blocks;
|
||||
|
||||
// Register provided blocks.
|
||||
defineBlocks(blocks);
|
||||
Reference in New Issue
Block a user