import { ServiceSchema } from 'moleculer';
import { ICamstackAddon, AddonDeclaration } from '@camstack/types';
/**
 * Validate that every capability declared in the addon manifest has a
 * provider registered via context.registerProvider() during initialize().
 *
 * Call after addon.initialize() to catch missing registrations at boot time
 * instead of at runtime when a consumer tries to use the capability.
 */
declare function validateProviderRegistrations(addonId: string, declaration: AddonDeclaration, providers: ReadonlyMap<string, unknown>, logger?: {
    warn: (msg: string) => void;
    debug?: (msg: string) => void;
    info?: (msg: string) => void;
}): readonly string[];
/**
 * Optional resolver that returns method names for a capability.
 * Used by the hub to resolve methods from CapabilityDefinitions (*.cap.ts)
 * when the package.json declaration doesn't include explicit methods.
 */
type MethodResolver = (capabilityName: string) => readonly string[];
/**
 * Wrap an ICamstackAddon as a Moleculer ServiceSchema.
 *
 * Methods for each capability are resolved in this order:
 * 1. `declaration.capabilities[].methods` from package.json
 * 2. `methodResolver(capName)` from CapabilityRegistry definitions
 * 3. Auto-discovery: enumerate own methods on the registered provider
 *
 * Additionally, the four two-level settings methods (`getGlobalSettings`,
 * `updateGlobalSettings`, `getDeviceSettings`, `updateDeviceSettings`)
 * are auto-exposed under a
 * `settings.*` namespace if the addon implements them. This replaces the
 * former `$addonHost` Moleculer service — the hub's `addon-settings`
 * singleton provider calls `broker.call('<addonId>.settings.<method>')`.
 */
declare function createAddonService(addon: ICamstackAddon, declaration: AddonDeclaration, options?: {
    readonly methodResolver?: MethodResolver;
    /** Per-action Moleculer timeout override: (capName, methodName) → ms */
    readonly timeoutResolver?: (capName: string, methodName: string) => number | undefined;
    readonly providers?: ReadonlyMap<string, unknown>;
    /**
     * Custom action catalog declared via `onInitialize()`'s `customActions`
     * field. The service exposes them as `custom.<actionName>` moleculer
     * actions + advertises their names via metadata so the hub can proxy
     * dispatches into the worker when the addon runs forkable.
     */
    readonly customActions?: Readonly<Record<string, unknown>>;
    readonly actionHandlers?: Readonly<Record<string, (input: unknown) => unknown | Promise<unknown>>>;
}): ServiceSchema;
export { createAddonService, validateProviderRegistrations };
//# sourceMappingURL=addon-service-factory.d.ts.map