import type { Hook, HookContext, EvaluationDetails, JsonValue } from '@openfeature/server-sdk'; import type { IEvaluator } from '../evaluator/evaluator'; import type { EventPublisher } from '../service/event-publisher'; /** * DataCollectorHook is a hook that collects data during the evaluation of feature flags. */ export declare class DataCollectorHook implements Hook { private readonly evaluator; private readonly eventPublisher; /** * DataCollectorHook is a hook that collects data during the evaluation of feature flags. * @param evaluator - service to evaluate the flag * @param eventPublisher - service to publish events * @throws Error if evaluator or eventPublisher is null */ constructor(evaluator: IEvaluator, eventPublisher: EventPublisher); /** * Called immediately after successful flag evaluation. * @param context - Provides context of innovation * @param details - Flag evaluation information * @param _hints - Caller provided data */ after(context: HookContext, details: EvaluationDetails, _hints?: Record): Promise; /** * Called immediately after an unsuccessful flag evaluation. * @param context - Provides context of innovation * @param error - Exception representing what went wrong * @param hints - Caller provided data */ error(context: HookContext, _error: Error, _hints?: Record): Promise; }