/** * @license * Copyright 2024 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { EditHistoryCreator, GraphDescriptor, InspectableRunObserver, Kit, MutableGraphStore } from "@google-labs/breadboard"; import type { BoardServer, BoardServerExtension, BoardServerExtensionNamespace, GraphLoader, GraphProvider } from "@breadboard-ai/types"; import { RuntimeConfigBoardServers, Tab, TabId } from "./types"; import * as BreadboardUI from "@breadboard-ai/shared-ui"; import { TokenVendor } from "@breadboard-ai/connection-client"; import { GraphIdentifier, ModuleIdentifier } from "@breadboard-ai/types"; import { GoogleDriveClient } from "@breadboard-ai/google-drive-kit/google-drive-client.js"; import { RecentBoardStore } from "../data/recent-boards"; type ValidColorStrings = `#${string}` | `--${string}`; export declare function getGlobalColor(name: ValidColorStrings, defaultValue?: ValidColorStrings): number; export declare class Board extends EventTarget { #private; /** @deprecated */ readonly providers: GraphProvider[]; readonly loader: GraphLoader; /** * Extra Kits, supplied by the board server. * */ readonly boardServerKits: Kit[]; readonly boardServers: RuntimeConfigBoardServers; readonly recentBoardStore: RecentBoardStore; protected recentBoards: BreadboardUI.Types.RecentBoard[]; readonly tokenVendor?: TokenVendor | undefined; readonly googleDriveClient?: GoogleDriveClient | undefined; constructor( /** @deprecated */ providers: GraphProvider[], loader: GraphLoader, /** * Extra Kits, supplied by the board server. * */ boardServerKits: Kit[], boardServers: RuntimeConfigBoardServers, recentBoardStore: RecentBoardStore, recentBoards: BreadboardUI.Types.RecentBoard[], tokenVendor?: TokenVendor | undefined, googleDriveClient?: GoogleDriveClient | undefined); currentURL: URL | null; getRecentBoards(): readonly BreadboardUI.Types.RecentBoard[]; connect(location?: string, apiKey?: string): Promise<{ success: boolean; error?: string; }>; disconnect(location: string): Promise<{ success: boolean; } | undefined>; getBoardServerByName(name: string): BoardServer | null; getBoardServerForURL(url: URL): BoardServer | null; getBoardServers(): BoardServer[]; /** * * @deprecated Use getBoardServers() instead. */ getProviders(): GraphProvider[]; getLoader(): GraphLoader; getGraphStore(): MutableGraphStore; get tabs(): Map<`${string}-${string}-${string}-${string}-${string}`, Tab>; get currentTab(): Tab | null; getTabById(tab: TabId): Tab | null; getTabURLs(): string[]; getBoardURL(url: URL): string | undefined; createTabsFromURL(url: URL, closeAllTabs?: boolean): Promise; createTabFromRun(descriptor: GraphDescriptor, topGraphObserver?: BreadboardUI.Utils.TopGraphObserver, runObserver?: InspectableRunObserver, readOnly?: boolean): Promise; createTabFromDescriptor(descriptor: GraphDescriptor, createNewTab?: boolean, dispatchTabChangeEvent?: boolean): Promise; createTabFromURL(boardUrl: string, currentUrl?: string | null, _createNewTab?: boolean, readOnly?: boolean, dispatchTabChangeEvent?: boolean, moduleId?: ModuleIdentifier | null, subGraphId?: GraphIdentifier | null, creator?: EditHistoryCreator | null, resultsFileId?: string): Promise; changeTab(id: TabId): void; changeWorkspaceItem(id: TabId, subGraphId: GraphIdentifier | null, moduleId: ModuleIdentifier | null): void; closeAllTabs(): void; closeTab(id: TabId): void; canSave(id: TabId | null): boolean; isMine(url: string | undefined): boolean; canPreview(id: TabId | null): boolean; saveStatus(id: TabId): BreadboardUI.Types.BOARD_SAVE_STATUS | undefined; clearSaveStatus(id: TabId): void; clearPendingBoardSave(id: TabId): void; save(id: TabId | null, timeout: number, messages: { start: string; end: string; } | null): Promise<{ result: boolean; error?: string; }>; saveAs(boardServerName: string, location: string, fileName: string, graph: GraphDescriptor, ackUser: boolean | undefined, ackUserMessage: { start: string; end: string; error: string; }): Promise<{ result: boolean; error: string; url: undefined; } | { url: URL; result: boolean; error?: string; } | null>; delete(providerName: string, url: string, messages: { start: string; end: string; error: string; }): Promise<{ result: boolean; error?: string; }>; extensionAction(id: TabId | null, namespace: T, action: keyof BoardServerExtension[T], ...args: unknown[]): Promise; } export {}; //# sourceMappingURL=board.d.ts.map