2
0

variable-chain-config.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. import { FlowNodeEntity } from '@flowgram.ai/document';
  6. import { type ScopeChainNode } from './types';
  7. import { IScopeTransformer } from './services/scope-chain-transform-service';
  8. export interface VariableChainConfig {
  9. /**
  10. * The output variables of a node's children cannot be accessed by subsequent nodes.
  11. *
  12. * @param node
  13. * @returns
  14. */
  15. isNodeChildrenPrivate?: (node: ScopeChainNode) => boolean;
  16. /**
  17. * For fixed layout scenarios: there are a large number of useless nodes between parent and child (such as inlineBlocks, etc., which need to be configured to be skipped)
  18. * For free canvas scenarios: in some scenarios, the parent-child relationship between nodes is expressed through connections or other interactive forms, which needs to be configurable
  19. */
  20. getNodeChildren?: (node: FlowNodeEntity) => FlowNodeEntity[];
  21. getNodeParent?: (node: FlowNodeEntity) => FlowNodeEntity | undefined;
  22. /**
  23. * Fine-tune the dependency scope
  24. */
  25. transformDeps?: IScopeTransformer;
  26. /**
  27. * 对依赖作用域进行微调
  28. */
  29. transformCovers?: IScopeTransformer;
  30. }
  31. export const VariableChainConfig = Symbol('VariableChainConfig');