/** * Copyright (c) 2018-2025 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal * @author Alexander Rose * @author Adam Midlik * * Adapted from LiteMol */ import { StringLike } from '../mol-io/common/string-like.js'; import { RuntimeContext, Task } from '../mol-task/index.js'; import { Asset, AssetManager } from './assets.js'; export declare enum DataCompressionMethod { None = 0, Gzip = 1, Zip = 2 } export type DataType = 'json' | 'xml' | 'string' | 'binary' | 'zip'; export type DataValue = 'string' | any | XMLDocument | Uint8Array; export type DataResponse = T extends 'json' ? any : T extends 'xml' ? XMLDocument : T extends 'string' ? StringLike : T extends 'binary' ? Uint8Array : T extends 'zip' ? { [k: string]: Uint8Array; } : never; export interface AjaxGetParams { url: string; type?: T; title?: string; headers?: [string, string][]; body?: string; } export declare function readStringFromFile(file: File): Task; export declare function readUint8ArrayFromFile(file: File): Task>; export declare function readFromFile(file: File, type: T): Task>; export declare function ajaxGet(url: string): Task; export declare function ajaxGet(params: AjaxGetParams): Task>; export type AjaxTask = typeof ajaxGet; export declare function setFSModule(fs: typeof import('fs')): void; export type AjaxGetManyEntry = { kind: 'ok'; id: string; result: Asset.Wrapper<'string' | 'binary'>; } | { kind: 'error'; id: string; error: any; }; export declare function ajaxGetMany(ctx: RuntimeContext, assetManager: AssetManager, sources: { id: string; url: Asset.Url | string; isBinary?: boolean; canFail?: boolean; }[], maxConcurrency: number): Promise;