import type { Result } from '@empathyco/x-types'; import type { ArrowKey } from '../utils/types'; /** * Interface for SpatialNavigation services based on * {@link https://www.w3.org/TR/css-nav-1/ | CSSWK specification}. * * @public */ export interface SpatialNavigation { /** * Get next element to navigate to. * * @param arrowKey - The arrow key that was pressed. * * @returns The element to navigate to or null. */ navigateTo: (direction: ArrowKey) => HTMLElement; } /** * Interface representing the coordinates of a point. * * @internal */ export interface Point { x: number; y: number; } /** * Type representing two points for comparision purposes. * * @internal */ export type Points = [Point, Point]; /** * Interface representing the projected intersection values between two elements. * * @internal */ export interface Intersection { width: number; height: number; area: number; } /** * Interface representing the absolute distances between two element's points in both axis. * * @internal */ export interface AbsoluteDistances { x: number; y: number; } /** * Type for the different status of a machine, and how to transition between them. * The `SomeStatus` parameter is a union containing all the possible status the * machine can be in, and the `SomeEvent` parameter is a union containing all the * possible events that can be emitted to change from one status to another one. * * @example * ```typescript * type Status = 'initial' | 'transitioned' | 'idle'; * type Events = 'Event1' | 'Event2' * * const transition: TransitionStates = { * initial: { * Event1: 'transitioned', Event2: 'idle' * }, * transitioned: { * Event2: 'initial' * }, * idle: { * Event1: 'initial' * } * } * ``` * * * @internal */ export type TransitionStates = { [Key in SomeStatus]: Partial>; }; /** * Represents a machine state with its states and its initial state. * * @internal */ export interface Machine { initial: SomeStatus; states: TransitionStates; } /** * Service to handle the enrichment of the results. * * @public */ export interface ResultsEnrichmentService { /** * Fetches the enrichment results. * * @param results - The results to fetch the enrichment results for. */ fetchResults: (results: Result[]) => Promise; /** * Updates the results with the enrichment results. Updates via mutation. * * @param results - The results to update. * @param enrichmentResults - The enrichment results to update the results with. */ updateResults: (results: Result[], enrichmentResults: any[]) => void; } //# sourceMappingURL=services.types.d.ts.map