/*
 * Copyright (C) 2016-2020 Kano Computing Ltd.
 * License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 */
import { Blockly } from '@kano/kwc-blockly/blockly.js';
export const stamp = [{
        block: (part) => {
            return {
                id: 'stamp',
                lookup: 'stamp(sticker, size, rotation)',
                message0: `Draw: ${Blockly.Msg.BLOCK_CANVAS_STAMP}`,
                args0: [{
                        type: "input_value",
                        name: "STICKER",
                        check: 'Sticker',
                    }, {
                        type: "input_value",
                        name: "SIZE",
                        check: 'Number',
                        align: 'RIGHT'
                    }, {
                        type: "input_value",
                        name: "ROTATION",
                        check: 'Number',
                        align: 'RIGHT'
                    }],
                previousStatement: null,
                nextStatement: null,
            };
        },
        javascript: (part) => {
            return function (block) {
                const image = Blockly.JavaScript.valueToCode(block, 'STICKER', Blockly.JavaScript.ORDER_NONE) || 'null';
                const size = Blockly.JavaScript.valueToCode(block, 'SIZE', Blockly.JavaScript.ORDER_NONE) || 'null';
                const rotation = Blockly.JavaScript.valueToCode(block, 'ROTATION', Blockly.JavaScript.ORDER_NONE) || 'null';
                return `ctx.stamp(${image}, ${size}, ${rotation});`;
            };
        }
    }];
export default stamp;
//# sourceMappingURL=stamp.js.map