import type { CollectionKeyBase, CollectionKey, OnyxKey } from './types'; /** * Initializes the collection key set. Called once during Onyx.init(). */ declare function setCollectionKeys(keys: Set): void; /** * Returns the set of all registered collection keys. */ declare function getCollectionKeys(): Set; /** * Checks if the given key is a registered collection key (e.g. "report_"). */ declare function isCollectionKey(key: OnyxKey): key is CollectionKeyBase; /** * Checks if the given key is a member of the specified collection key. * e.g. isCollectionMemberKey("report_", "report_123") → true */ declare function isCollectionMemberKey(collectionKey: TCollectionKey, key: string): key is `${TCollectionKey}${string}`; /** * Checks if a given key is a collection member key (not just a collection key). */ declare function isCollectionMember(key: OnyxKey): boolean; /** * Checks if the provided key matches the config key — either an exact match * or a collection prefix match. */ declare function isKeyMatch(configKey: OnyxKey, key: OnyxKey): boolean; /** * Extracts the collection key from a collection member key. * * Uses a pre-computed Map for O(1) lookup. Falls back to string parsing * for keys not yet in the map (e.g. before they're cached). * * Examples: * - getCollectionKey("report_123") → "report_" * - getCollectionKey("report_") → "report_" * - getCollectionKey("sharedNVP_user_-1_something") → "sharedNVP_user_" */ declare function getCollectionKey(key: CollectionKey | OnyxKey): string | undefined; /** * Pre-computes and caches the member → collection key mapping for a given key. * Called from OnyxCache.addKey() to ensure the Map stays populated. */ declare function registerMemberKey(key: OnyxKey): void; /** * Removes a member key from the reverse lookup map. * Called when a key is dropped from cache. */ declare function deregisterMemberKey(key: OnyxKey): void; /** * Returns the set of member keys for a given collection key. * O(1) lookup using the forward index. */ declare function getMembersOfCollection(collectionKey: OnyxKey): Set | undefined; /** * Splits a collection member key into the collection key part and the ID part. * * @param key - The collection member key to split * @param collectionKey - Optional pre-resolved collection key for optimization * @returns A tuple of [collectionKey, memberId] * @throws If the key is not a valid collection member key */ declare function splitCollectionMemberKey(key: TKey, collectionKey?: string): [CollectionKeyType, string]; /** * Initializes the RAM-only key set. Called once during Onyx.init(). */ declare function setRamOnlyKeys(keys: Set): void; /** * Checks if a given key is a RAM-only key, RAM-only collection key, or a RAM-only collection member. * * For example, given ramOnlyKeys: ["ramOnlyKey", "ramOnlyCollection_"]: * - isRamOnlyKey("ramOnlyKey") → true * - isRamOnlyKey("ramOnlyCollection_") → true * - isRamOnlyKey("ramOnlyCollection_1") → true * - isRamOnlyKey("someOtherKey") → false */ declare function isRamOnlyKey(key: OnyxKey): boolean; declare const _default: { setCollectionKeys: typeof setCollectionKeys; getCollectionKeys: typeof getCollectionKeys; isCollectionKey: typeof isCollectionKey; isCollectionMemberKey: typeof isCollectionMemberKey; isCollectionMember: typeof isCollectionMember; isKeyMatch: typeof isKeyMatch; getCollectionKey: typeof getCollectionKey; registerMemberKey: typeof registerMemberKey; deregisterMemberKey: typeof deregisterMemberKey; getMembersOfCollection: typeof getMembersOfCollection; splitCollectionMemberKey: typeof splitCollectionMemberKey; setRamOnlyKeys: typeof setRamOnlyKeys; isRamOnlyKey: typeof isRamOnlyKey; }; export default _default;