import type { Creatable, CreatableInstance, CreatableParams, EventData, Labels, WithOptionalLabels } from '@ariestools/sdk';
import type { Provider, ProviderMoniker } from '@xyo-network/xl1-protocol/protocol-lib';
import type { Surface } from '../capabilities/Backing.js';
import type { ConnectionKind } from '../config/connections/Connection.js';
import type { CreatableProviderContext } from '../model/index.js';
/** Connection kinds declared on creatable provider statics (connections plus wallet). */
export type CreatableProviderConnectionType = ConnectionKind | 'wallet';
import type { GetInstanceOptions } from './GetInstanceOptions.js';
import type { LabeledCreatableProviderFactory } from './LabeledCreatableProviderFactory.js';
/** Parameters for CreatableProvider. */
export interface CreatableProviderParams<TContext extends CreatableProviderContext = CreatableProviderContext> extends CreatableParams {
    context: TContext;
}
/** CreatableProviderEventData interface. */
export interface CreatableProviderEventData extends EventData {
}
/** CreatableProviderInstance type. */
export type CreatableProviderInstance<TProvider extends Provider<ProviderMoniker> = Provider<ProviderMoniker>, TDependencies extends ProviderMoniker[] = ProviderMoniker[], TParams extends CreatableProviderParams = CreatableProviderParams, TEventData extends CreatableProviderEventData = CreatableProviderEventData> = CreatableInstance<TParams, TEventData> & TProvider & {
    dependencies: ProviderMap<TDependencies[number]>;
};
/** ProviderFactoryScope type. */
export type ProviderFactoryScope = 'global' | 'context' | 'local';
/** CreatableProviderFactory interface. */
export interface CreatableProviderFactory<T extends CreatableProviderInstance = CreatableProviderInstance, TDependencies extends ProviderMoniker[] = ProviderMoniker[]> extends Omit<CreatableProvider<T>, 'create' | 'createHandler' | 'paramsHandler'> {
    readonly connectionTypes?: readonly CreatableProviderConnectionType[];
    creatableProvider: CreatableProvider<T>;
    /** @deprecated params are being removed — providers self-resolve from context.config / context runtime homes */
    defaultParams: Partial<Omit<T['params'], 'context'>>;
    readonly dependencies: TDependencies;
    labels?: Labels;
    providerName: string;
    resolvedMoniker: string;
    scope: ProviderFactoryScope;
    readonly surface?: Surface;
    uniqueId: symbol;
    getInstance(this: CreatableProviderFactory<T>, params: T['params'], options?: GetInstanceOptions): Promise<T>;
    tryGetInstance(this: CreatableProviderFactory<T>, params: T['params'], options?: GetInstanceOptions): Promise<T | undefined>;
}
/** LabeledCreatableProvider interface. */
export interface LabeledCreatableProvider<T extends CreatableProviderInstance = CreatableProviderInstance, TDependencies extends ProviderMoniker[] = ProviderMoniker[]> extends CreatableProvider<T>, WithOptionalLabels {
    factory(dependencies: TDependencies, params?: Partial<Omit<T['params'], 'context'>>): LabeledCreatableProviderFactory<T>;
}
/** ProviderMap type. */
export type ProviderMap<T extends ProviderMoniker = ProviderMoniker> = Partial<Record<T, CreatableProviderInstance<Provider<T>>>>;
/** CreatableProvider interface. */
export interface CreatableProvider<T extends CreatableProviderInstance = CreatableProviderInstance, TDependencies extends ProviderMoniker[] = ProviderMoniker[]> extends Creatable<T> {
    readonly connectionTypes?: readonly CreatableProviderConnectionType[];
    readonly defaultMoniker: ProviderMoniker;
    readonly dependencies: TDependencies;
    readonly monikers: ProviderMoniker[];
    readonly surface?: Surface;
    factory(dependencies: TDependencies, params?: Partial<Omit<T['params'], 'context'>>): CreatableProviderFactory<T>;
}
/**
 * Class annotation to be used to decorate Providers which support
 * an asynchronous creation pattern
 * @returns The decorated Provider requiring it implement the members
 * of the CreatableProvider as statics properties/methods
 */
export declare function creatableProvider<TProvider extends CreatableProviderInstance = CreatableProviderInstance>(): <U extends CreatableProvider<TProvider>>(constructor: U) => void;
/**
 * Class annotation to be used to decorate Providers which support
 * an asynchronous creation pattern
 * @returns The decorated Provider requiring it implement the members
 * of the CreatableProvider as statics properties/methods
 */
export declare function labeledCreatableProvider<TProvider extends CreatableProviderInstance = CreatableProviderInstance>(): <U extends LabeledCreatableProvider<TProvider>>(constructor: U) => void;
//# sourceMappingURL=CreatableProvider.d.ts.map