/** * Internal resource-loading dependency. Shallow-copies the environment, with * any session overrides from `options.env` applied, at the loading boundary; * public pretrained options stay intact. * @private */ export class AssetLoadingContext { /** @param {import('../hub.js').PretrainedOptions} [options] */ constructor(options?: import("../hub.js").PretrainedOptions); /** @type {import('../../env.js').TransformersEnvironment} */ settings: import("../../env.js").TransformersEnvironment; options: { revision: string; cache_dir: string; local_files_only: boolean; }; userAgent: string; token: string; tokenFingerprint: number; tokenOrigin: string; /** @type {Promise|undefined} */ cache: Promise | undefined; getCache(): Promise; /** @param {URL|string} urlOrPath */ getHeaders(urlOrPath: URL | string): Headers; /** * A custom Hub endpoint must match by origin, so the token isn't sent over a * downgraded protocol or to another port. * @param {URL|string} urlOrPath */ isHubURL(urlOrPath: URL | string): boolean; /** * @param {URL|string} urlOrPath * @param {RequestInit} [init] * @returns {Promise} */ read(urlOrPath: URL | string, init?: RequestInit): Promise; /** * @param {string} path_or_repo_id * @param {string} filename * @param {import('../cache.js').CacheInterface|null} [cache] */ resolve(path_or_repo_id: string, filename: string, cache?: import("../cache.js").CacheInterface | null): { requestURL: string; localPath: string; remoteURL: string; validModelId: boolean; localCacheKey: string; proposedCacheKey: string; cacheKeys: string[]; obsoleteCacheKeys: string[]; }; /** * Return the matching key too: a local cache hit must not be mistaken for a * remote-key hit when returning a filesystem path or removing an entry. * @param {import('../cache.js').CacheInterface|null} cache * @param {string[]} keys The resource's `cacheKeys`, or its `obsoleteCacheKeys` to find an outdated copy. */ match(cache: import("../cache.js").CacheInterface | null, keys: string[]): Promise<{ key: string; response: string | FileResponse | Response; }>; /** * Best-effort cleanup only after a replacement was successfully stored. * Custom caches need not implement deletion or enumerate their entries. * @param {import('../cache.js').CacheInterface} cache * @param {ReturnType} resource * @param {string} storedKey */ cleanup(cache: import("../cache.js").CacheInterface, resource: ReturnType, storedKey: string): Promise; /** @param {string} modelId @param {...unknown} parts */ key(modelId: string, ...parts: unknown[]): string; } import { FileResponse } from './FileResponse.js'; //# sourceMappingURL=AssetLoadingContext.d.ts.map