/*
 * Copyright (C) 2016-2020 Kano Computing Ltd.
 * License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 */
import { addFlashField, setupFlash } from '../../../plugins/flash/flash.js';
import { _ } from '../../../i18n/index.js';
export const DataAPI = [{
        type: 'function',
        name: 'refresh',
        verbose: _('PART_DATA_REFRESH', 'refresh'),
    }, {
        type: 'function',
        name: 'onUpdate',
        verbose: _('PART_DATA_WHEN_UDPATED', 'when updated'),
        parameters: [{
                type: 'parameter',
                name: 'callback',
                verbose: '',
                returnType: Function,
            }],
        blockly: {
            postProcess(block) {
                addFlashField(block);
                block.setPreviousStatement(false);
                block.setNextStatement(false);
            },
        },
    }];
export function onInstall(editor, part) {
    if (!part.id) {
        return;
    }
    setupFlash(editor, part.id, part.data.updated, 'onUpdate');
}
//# sourceMappingURL=api.js.map