flowGraphExecutionBlock.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import type { IFlowGraphBlockConfiguration } from "./flowGraphBlock";
  2. import { FlowGraphBlock } from "./flowGraphBlock";
  3. import type { FlowGraphContext } from "./flowGraphContext";
  4. import { FlowGraphSignalConnection } from "./flowGraphSignalConnection";
  5. /**
  6. * @experimental
  7. * A block that executes some action. Always has an input signal (which is not used by event blocks).
  8. * Can have one or more output signals.
  9. */
  10. export declare abstract class FlowGraphExecutionBlock extends FlowGraphBlock {
  11. /**
  12. * Input connection: The input signal of the block.
  13. */
  14. readonly in: FlowGraphSignalConnection;
  15. /**
  16. * Input connections that activate the block.
  17. */
  18. signalInputs: FlowGraphSignalConnection[];
  19. /**
  20. * Output connections that can activate downstream blocks.
  21. */
  22. signalOutputs: FlowGraphSignalConnection[];
  23. protected constructor(config?: IFlowGraphBlockConfiguration);
  24. /**
  25. * @internal
  26. * Executes the flow graph execution block.
  27. */
  28. abstract _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
  29. protected _registerSignalInput(name: string): FlowGraphSignalConnection;
  30. protected _registerSignalOutput(name: string): FlowGraphSignalConnection;
  31. /**
  32. * Given a name of a signal input, return that input if it exists
  33. * @param name the name of the input
  34. * @returns if the input exists, the input. Otherwise, undefined.
  35. */
  36. getSignalInput(name: string): FlowGraphSignalConnection | undefined;
  37. /**
  38. * Given a name of a signal output, return that input if it exists
  39. * @param name the name of the input
  40. * @returns if the input exists, the input. Otherwise, undefined.
  41. */
  42. getSignalOutput(name: string): FlowGraphSignalConnection | undefined;
  43. /**
  44. * Serializes this block
  45. * @param serializationObject the object to serialize in
  46. */
  47. serialize(serializationObject?: any): void;
  48. /**
  49. * Deserializes from an object
  50. * @param serializationObject the object to deserialize from
  51. */
  52. deserialize(serializationObject: any): void;
  53. /**
  54. * @returns the class name
  55. */
  56. getClassName(): string;
  57. }