import { GrantSummary, ReputationGrant, ReputationGrantTargetFilter } from "../../interfaces/models/ReputationGrant"; import { PaginatedResponse } from "../../interfaces/PaginatedResponse"; import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation"; interface FetchManyReputationGrantsBaseProps extends SpaceReputationContextParams { page?: number; limit?: number; /** What this user received. */ recipientId?: string; /** What this user sent. */ senderId?: string; /** Associations to expand. Only `"user"` is supported (hydrates both parties). */ include?: string | string[]; } /** * The third filter shape — "who rewarded this item" — is the * {@link ReputationGrantTargetFilter} pair, so a half-filled target is a * compile error rather than a `400 reputation-grant/invalid-filter`. The * runtime check inside the hook stays as the defense for plain-JS callers. * * Mutual exclusivity between the three shapes is NOT expressed in the type: a * three-way exclusive union would multiply out across every pagination and * space-reputation field and make the props unreadable, for a rule the hook * already reports at runtime. Only the both-or-neither pairing is typed. */ export type FetchManyReputationGrantsProps = FetchManyReputationGrantsBaseProps & ReputationGrantTargetFilter; /** * The `summary` block rides alongside the page envelope, and only on the * target filter shape — a "who rewarded this" view would otherwise have to * fetch the parent entity/comment/message just to learn the totals. */ export interface FetchManyReputationGrantsResponse extends PaginatedResponse { summary?: GrantSummary; } /** * Lists reputation grants. * * Exactly one filter shape per request — `recipientId`, `senderId`, or * `targetType` + `targetId`. Combining two is rejected rather than AND-ed, * which is what keeps the `summary` block honest. * * Only positive grants are ever returned, for every caller: negative grants are * app moderation deductions and are unreadable from this surface. */ declare function useFetchManyReputationGrants(): (props?: FetchManyReputationGrantsProps) => Promise; export default useFetchManyReputationGrants;