import { ApplicationModule } from './app.js';
import { addFlashField, setupFlash } from '../../plugins/flash/flash.js';
import { _ } from '../../i18n/index.js';
export const AppAPI = (editor) => ({
    type: 'module',
    name: ApplicationModule.id,
    color: '#5fc9f3',
    verbose: _('MODULE_APP', 'App'),
    symbols: [{
            type: 'function',
            name: 'onStart',
            verbose: _('WHEN_APP_STARTS', 'when app starts'),
            parameters: [{
                    type: 'parameter',
                    name: 'callback',
                    verbose: '',
                    returnType: Function,
                }],
            blockly: {
                postProcess(block) {
                    addFlashField(block);
                    block.setPreviousStatement(false);
                    block.setNextStatement(false);
                },
            },
        }],
    onInstall(editor, mod) {
        setupFlash(editor, ApplicationModule.id, mod._onDidPartCollision, 'onPartCollision', (block, collision) => {
            const aId = block.getFieldValue('A');
            const bId = block.getFieldValue('B');
            return aId === collision.a.id && bId === collision.b.id;
        });
    },
});
//# sourceMappingURL=api.js.map