

export const createRendererRuntime = (config: {
  instance: any;
  syncDrawingZoneVisuals?: (...args: any[]) => any;
  clipPathsRuntime: any;
  snapLinesRuntime: any;
  curvedGuideRuntime: any;
  selectionOutlineRuntime: any;
  runtimeObjectIndex: any;
  fixedSlots?: any;
  textEditing?: any;
  objectModified?: any;
  objectCollection?: any;
  drawingAreas?: any;
  drawingAreasInteraction?: any;
  lifecycle?: any;
}) => {
  const {
    instance,
    syncDrawingZoneVisuals,
    clipPathsRuntime,
    snapLinesRuntime,
    curvedGuideRuntime,
    selectionOutlineRuntime,
    runtimeObjectIndex,
    fixedSlots,
    textEditing,
    objectModified,
    objectCollection,
    drawingAreas,
    drawingAreasInteraction,
    lifecycle,
  } = config;

  return {
    refreshAfterViewLoad: (...args: any[]) => instance?.refreshAfterViewLoad?.(...args),
    syncDrawingZoneVisuals: (...args: any[]) => syncDrawingZoneVisuals?.(...args),
    clipPaths: clipPathsRuntime,
    snapLines: snapLinesRuntime,
    curvedGuides: curvedGuideRuntime,
    selectionOutline: selectionOutlineRuntime,
    runtimeObjectIndex,
    fixedSlots,
    textEditing,
    objectModified,
    objectCollection,
    drawingAreas,
    drawingAreasInteraction,
    lifecycle,
  };
};
