import { ComKey, ItemTypeArray, LocKeyArray, PriKey } from '@fjell/types'; import { BaseEvent } from './events'; import { Subscription } from './subscription'; /** * Core subscription matching logic. * Determines whether an event should be delivered to a specific subscription. */ export declare function doesEventMatchSubscription(event: BaseEvent, subscription: Subscription): boolean; /** * Check if event scopes match subscription scope requirements. * * @param eventScopes - Scopes from the event (e.g., ["firestore"]) * @param subscriptionScopes - Optional scopes required by subscription * @returns true if scopes are compatible */ export declare function doesScopeMatch(eventScopes: string[], subscriptionScopes?: string[]): boolean; /** * Check if event type matches subscription event type requirements. * * @param eventType - Type from the event (e.g., "create", "update") * @param subscriptionEventTypes - Optional event types required by subscription * @returns true if event type is compatible */ export declare function doesEventTypeMatch(eventType: string, subscriptionEventTypes?: string[]): boolean; /** * Check if two keys are exactly equal. * Used for item-based subscriptions that want events for a specific key. */ export declare function doesKeyMatch(eventKey: PriKey | ComKey, subscriptionKey: PriKey | ComKey): boolean; /** * Check if an event key matches a location-based subscription. * This is more complex as it needs to determine if the event key is "within" the subscription location. */ export declare function doesKeyMatchLocation(eventKey: PriKey | ComKey, subscriptionKta: ItemTypeArray, subscriptionLocation: LocKeyArray): boolean; /** * Check if an event's location keys match a subscription's location requirements. * This implements the hierarchical location matching logic. */ export declare function doesLocationMatch(eventLocation: LocKeyArray, subscriptionLocation: LocKeyArray, _subscriptionKta: ItemTypeArray): boolean; /** * Find all subscriptions that match a given event. * Used by EventSubscriber implementations to determine which subscriptions should receive an event. */ export declare function findMatchingSubscriptions(event: BaseEvent, subscriptions: Subscription[]): Subscription[]; /** * Utility function to extract the location from a ComKey for comparison purposes. * Returns the location key values as strings for easier comparison. */ export declare function extractLocationValues(location: LocKeyArray): string[]; /** * Utility function to compare two location arrays by their values. * Useful for debugging and testing location matching logic. */ export declare function compareLocationValues(location1: LocKeyArray, location2: LocKeyArray): boolean;