/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { ModelConfig } from "../model/ModelSchema"; import type { AiProvider } from "../provider/AiProvider"; import type { AiProviderPreviewRunFn, AiProviderRunFnRegistration } from "../provider/AiProviderRegistry"; /** * Static metadata describing a cloud-backed AI provider. * * Shared across each provider's worker- and main-thread class shells so the * declarations live in one place and only the constructor base differs. */ export interface CloudProviderMetadata { readonly name: string; readonly displayName: string; readonly isLocal?: boolean; readonly supportsBrowser?: boolean; readonly supportsServer?: boolean; } /** * Constructor signature mirroring {@link AiProvider}'s public constructor. * Declared structurally so callers can pass either the worker or main-thread * `AiProvider` import without forcing this module to import either at runtime. */ type AiProviderCtor = abstract new (promiseRunFns?: readonly AiProviderRunFnRegistration[], previewTasks?: Record>) => AiProvider; /** * Build a concrete provider class by mixing the shared declarations from * {@link CloudProviderMetadata} into a caller-supplied {@link AiProvider} base. * * Each cloud provider package keeps two thin shells (worker + main-thread) * and supplies the appropriate `AiProvider` import to this factory. The * generated class implements `name`, `displayName`, `isLocal`, and * `supportsBrowser` from the metadata literal; the constructor is inherited * unchanged from the base. */ export declare function createCloudProviderClass(Base: AiProviderCtor, meta: CloudProviderMetadata): new (promiseRunFns?: readonly AiProviderRunFnRegistration[], previewTasks?: Record>) => AiProvider & { readonly name: string; readonly displayName: string; readonly isLocal: boolean; readonly supportsBrowser: boolean; readonly supportsServer: boolean; }; export {}; //# sourceMappingURL=BaseCloudProvider.d.ts.map