/** * @license * Copyright 2024 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { EditableGraph, EditHistoryCreator, EditSpec, GraphDescriptor, Kit, MutableGraphStore, NodeConfiguration, NodeDescriptor, NodeIdentifier, Outcome, PortIdentifier } from "@google-labs/breadboard"; import { GraphLoader } from "@breadboard-ai/types"; import { EnhanceSideboard, Tab, WorkspaceSelectionState, WorkspaceVisualChangeId, WorkspaceVisualState } from "./types"; import { CommentNode, Edge, GraphIdentifier, GraphMetadata, GraphTheme, Module, ModuleCode, ModuleIdentifier, ModuleLanguage, ModuleMetadata, NodeMetadata, NodeValue } from "@breadboard-ai/types"; import { Sandbox } from "@breadboard-ai/jsandbox"; import * as BreadboardUI from "@breadboard-ai/shared-ui"; import { AppTheme, AssetEdge, EdgeAttachmentPoint } from "@breadboard-ai/shared-ui/types/types.js"; import { SideBoardRuntime } from "@breadboard-ai/shared-ui/sideboards/types.js"; import { StateManager } from "./state"; import { GoogleDriveClient } from "@breadboard-ai/google-drive-kit/google-drive-client.js"; export declare class Edit extends EventTarget { #private; readonly state: StateManager; readonly loader: GraphLoader; readonly kits: Kit[]; readonly sandbox: Sandbox; readonly graphStore: MutableGraphStore; readonly sideboards: SideBoardRuntime; readonly settings: BreadboardUI.Types.SettingsStore | null; constructor(state: StateManager, loader: GraphLoader, kits: Kit[], sandbox: Sandbox, graphStore: MutableGraphStore, sideboards: SideBoardRuntime, settings: BreadboardUI.Types.SettingsStore | null); getEditor(tab: Tab | null): EditableGraph | null; getHistory(tab: Tab | null): import("@breadboard-ai/types").EditHistory | null; getGraphComment(tab: Tab | null, id: string, subGraphId?: string | null): CommentNode | null; getNodeTitle(tab: Tab | null, id: string, subGraphId?: string | null): string | null; getNodeCurrentMetadata(tab: Tab | null, id: string, subGraphId?: string | null): import("@breadboard-ai/types").NodeHandlerMetadata | null; getNodeType(tab: Tab | null, id: string, subGraphId?: string | null): string | null; getNodeMetadata(tab: Tab | null, id: string, subGraphId?: string | null): NodeMetadata | null; getNodeConfiguration(tab: Tab | null, id: string, subGraphId?: string | null): NodeConfiguration | null; getNodePorts(tab: Tab | null, id: string, subGraphId?: string | null): Promise | null; canUndo(tab: Tab | null): boolean; undo(tab: Tab | null): void | null; canRedo(tab: Tab | null): boolean; redo(tab: Tab | null): void | null; createTheme(tab: Tab | null, appTheme: AppTheme): Promise; changeTheme(tab: Tab | null, theme: string): Promise; deleteTheme(tab: Tab | null, theme: string): Promise; updateTheme(tab: Tab | null, themeId: string, theme: GraphTheme): Promise; applyTheme(tab: Tab | null, theme: AppTheme, appTitle: string | null, appDescription: string | null, template: string | null, templateAdditionalOptionsChosen: Record | null): Promise; updateSubBoardInfo(tab: Tab | null, subGraphId: string, title: string, version: string, description: string, status: "published" | "draft" | null, isTool: boolean | null, isComponent: boolean | null): Promise; updateModuleInfo(tab: Tab | null, moduleId: string, title: string, description: string): Promise; deleteComment(tab: Tab | null, id: string): null | undefined; createWorkspaceItem(tab: Tab | null, type: "declarative" | "imperative", title: string | null, settings: BreadboardUI.Types.SettingsStore | null): Promise; createModule(tab: Tab | null, moduleId: ModuleIdentifier, module?: Module, switchToCreatedModule?: boolean): Promise; deleteModule(tab: Tab | null, moduleId: ModuleIdentifier): Promise<({ log: import("@breadboard-ai/types").EditResultLogEntry[]; } & { success: true; }) | null | undefined>; changeModuleLanguage(tab: Tab | null, moduleId: ModuleIdentifier, language: ModuleLanguage): null | undefined; editModule(tab: Tab | null, moduleId: ModuleIdentifier, moduleCode: ModuleCode, moduleMetadata: ModuleMetadata): Promise; toggleExport(tab: Tab, id: ModuleIdentifier | GraphIdentifier, exportType: "imperative" | "declarative"): Promise; /** * Finds all assets in the graph, checks if their sharing permissions match * that of the main graph, and prompts the user to fix them if needed. */ checkGoogleDriveAssetShareStatus(tab: Tab, googleDriveClient: GoogleDriveClient): Promise; updateBoardInfo(tab: Tab | null, title: string, version: string, description: string, status: "published" | "draft" | "private" | null, isTool: boolean | null, isComponent: boolean | null): null | undefined; updateBoardTitleAndDescription(tab: Tab | null, title: string | null, description: string | null): Promise; createSubGraph(tab: Tab | null, subGraphTitle: string, id?: GraphIdentifier, board?: GraphDescriptor): Promise; deleteSubGraph(tab: Tab | null, subGraphId: string): Promise; createReference(tab: Tab | null, graphId: GraphIdentifier, nodeId: NodeIdentifier, portId: PortIdentifier, value: NodeValue): Promise>; processVisualChange(tab: Tab | null, visualChangeId: WorkspaceVisualChangeId, graphId: GraphIdentifier, visual: GraphMetadata["visual"]): Promise; processVisualChanges(tab: Tab | null, visualChangeId: WorkspaceVisualChangeId, visualState: WorkspaceVisualState): Promise; addNodeWithEdge(tab: Tab | null, node: NodeDescriptor, edge: Edge, subGraphId?: string | null): Promise; changeEdge(tab: Tab | null, changeType: "add" | "remove" | "move", from: Edge, to?: Edge, subGraphId?: string | null): Promise; changeAssetEdge(tab: Tab | null, changeType: "add" | "remove", edge: AssetEdge, subGraphId?: string | null): Promise; changeEdgeAttachmentPoint(tab: Tab | null, graphId: GraphIdentifier, edge: Edge, which: "from" | "to", attachmentPoint: EdgeAttachmentPoint): Promise; createNode(tab: Tab | null, id: string, nodeType: string, configuration?: NodeConfiguration | null, metadata?: NodeMetadata | null, subGraphId?: string | null, options?: { sourceId: NodeIdentifier; portId: PortIdentifier; } | null): Promise; updateNodeMetadata(tab: Tab | null, id: NodeIdentifier, metadata: NodeDescriptor["metadata"], subGraphId?: string | null): Promise; multiEdit(tab: Tab | null, edits: EditSpec[], description: string): Promise; changeComment(tab: Tab | null, id: string, text: string, subGraphId?: string | null): void; changeNodeConfiguration(tab: Tab | null, id: string, configuration: NodeConfiguration, subGraphId?: string | null): void; enhanceNodeConfiguration(tab: Tab | null, subGraphId: string | null, id: string, sideboard: EnhanceSideboard, property?: string, value?: NodeValue): Promise; /** * Use this function to trigger autoname on a node. It will force over * `userModified` and disregard any settings. */ autonameNode(tab: Tab | null, id: string, subGraphId?: string | null): Promise>; changeNodeConfigurationPart(tab: Tab | null, id: string, configurationPart: NodeConfiguration, subGraphId?: string | null, metadata?: NodeMetadata | null, ins?: { path: string; title: string; }[] | null): Promise>; moveNodesToGraph(tab: Tab | null, ids: NodeIdentifier[], sourceGraphId: GraphIdentifier, destinationGraphId?: GraphIdentifier | null, positionDelta?: DOMPoint | null): Promise; createParam(tab: Tab | null, graphId: GraphIdentifier, path: string, title: string, description?: string): Promise; deleteParam(tab: Tab | null, graphId: GraphIdentifier, path: string): Promise; /** * * @deprecated */ moveToNewGraph(tab: Tab | null, selectionState: WorkspaceSelectionState, targetGraphId: GraphIdentifier | null, delta: { x: number; y: number; }): Promise; deleteNode(tab: Tab | null, id: string, subGraphId?: string | null): void; replaceGraph(tab: Tab | null, replacement: GraphDescriptor, creator: EditHistoryCreator): Promise | undefined; } //# sourceMappingURL=edit.d.ts.map