import type { Attributes, RemoteSavedGroup, SavedGroupResolver, SavedGroupsPayload } from "./types/growthbook"; /** * The attribute evaluation reads a user's remote saved groups from. Internal * attributes start with `__gb_`, matching GrowthBook's back end. */ export declare const REMOTE_GROUP_IDS_ATTRIBUTE = "__gb_remoteGroupIds"; /** Only v2 payloads include the remote group metadata this helper reads. */ export declare function getRemoteSavedGroups(savedGroups?: SavedGroupsPayload): RemoteSavedGroup[]; /** * Asks `resolver` which of the payload's remote groups the user is in. Only * the attributes those groups use are passed. Throws what the resolver * throws. * * Returns [] when the payload lists no remote groups. Don't set that as * `__gb_remoteGroupIds`: the payload may still check it directly, and [] makes * "not in group" rules match. Check `getRemoteSavedGroups` first. */ export declare function resolveRemoteGroupIds(attributes: Attributes, savedGroups: SavedGroupsPayload | undefined, resolver: SavedGroupResolver): Promise; /** A Redis client with the one command `redisResolver` needs. */ export type RedisSetClient = { sMembers(key: string): Promise; }; /** * A resolver for remote groups loaded into Redis by GrowthBook's loader: one * `SMEMBERS gb:member::` per attribute value. Works with a * node-redis v4 client; wrap others, e.g. `{ sMembers: (k) => redis.smembers(k) }`. * * A derived group checks its own attribute's value in its source group's * sets: `grp_vip:parent_id` looks up `gb:member::` * and matches when `grp_vip` comes back. */ export declare function redisResolver(redis: RedisSetClient): SavedGroupResolver; /** * Whether the payload has remote groups but the user has no remote group IDs, * so every rule using them will fail. */ export declare function isMissingRemoteGroupIds(user: { attributes?: Attributes; remoteGroupIds?: string[]; }, savedGroups: SavedGroupsPayload | undefined): boolean; //# sourceMappingURL=remoteSavedGroups.d.ts.map