import { PathLike } from 'fs'; import { Serializable } from '../../internals/serializable.js'; import '../../internals/types.js'; import '../../internals/helpers/guards.js'; /** * Copyright 2025 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ interface PythonFile { id: string; pythonId: string; filename: string; } interface PythonUploadFile { id: string; filename: string; } interface PythonDownloadFile { id?: string; filename: string; pythonId: string; } declare abstract class PythonStorage extends Serializable { /** * List all files that code interpreter can use. */ abstract list(): Promise; /** * Prepare subset of available files to code interpreter. */ abstract upload(files: PythonUploadFile[]): Promise; /** * Process updated/modified/deleted files from code interpreter response. */ abstract download(files: PythonDownloadFile[]): Promise; } declare class TemporaryStorage extends PythonStorage { protected files: PythonFile[]; list(): Promise; upload(files: PythonUploadFile[]): Promise; download(files: PythonDownloadFile[]): Promise; createSnapshot(): { files: PythonFile[]; }; loadSnapshot(snapshot: ReturnType): void; } interface Input { localWorkingDir: PathLike; interpreterWorkingDir: PathLike; ignoredFiles?: Set; } declare class LocalPythonStorage extends PythonStorage { protected readonly input: Required; constructor(input: Input); protected init(): Promise; list(): Promise; upload(files: PythonUploadFile[]): Promise; download(files: PythonDownloadFile[]): Promise<{ id: string; filename: string; pythonId: string; }[]>; protected computeHash(file: PathLike): Promise; createSnapshot(): { input: Required; }; loadSnapshot(snapshot: ReturnType): void; } export { LocalPythonStorage, type PythonDownloadFile, type PythonFile, PythonStorage, type PythonUploadFile, TemporaryStorage };