import { FIND, MATCH } from '../../findBlock'; import type { NodeDef } from '../../NodeRegistry'; import { asList } from '../../values'; import { any, exec, list, num } from '../shared'; export const Find: NodeDef = { type: FIND, label: 'Find', category: 'flow', description: 'Opens a search block, closed by a Match. "item" and "index" go through one element after the ' + 'other; whatever is built from them into the Match\'s "match" is the test. The first element it ' + 'is true for continues at "found" of the Match, none at "not found".', inputs: [exec(), list('list')], outputs: [any('item'), num('index')], params: [], opens: { type: MATCH, dx: 480 }, run: (_ctx, inputs) => ({ outputs: { item: null, index: -1 }, find: asList(inputs.list) }), };