import { GrantSummary, NullableReputationGrantTargetFilter, ReputationGrant } from "../../interfaces/models/ReputationGrant"; import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation"; interface UseFetchManyReputationGrantsWrapperBaseProps extends SpaceReputationContextParams { limit?: number; /** What this user received. */ recipientId?: string | null; /** What this user sent. */ senderId?: string | null; include?: string | string[]; } /** * The third filter shape — "who rewarded this item" — is the * {@link NullableReputationGrantTargetFilter} pair: both fields or neither, * with `null` accepted for "neither" because these are React props rather than * a wire body. The hook's `canFetch` gate repeats the rule at runtime for * plain-JS callers. */ export type UseFetchManyReputationGrantsWrapperProps = UseFetchManyReputationGrantsWrapperBaseProps & NullableReputationGrantTargetFilter; export interface UseFetchManyReputationGrantsWrapperValues { grants: ReputationGrant[]; /** Only returned by the target filter shape; null otherwise. */ summary: GrantSummary | null; loading: boolean; hasMore: boolean; loadMore: () => void; /** Re-run the query from page 1 (e.g. after issuing a grant). */ refresh: () => void; } /** * Stateful, paginated list of reputation grants. * * Modelled on `useFetchManyEventsWrapper`: one `buildParams` memo feeds BOTH * the reset path and the load-more path, so a filter can never be applied to * page 1 and silently dropped from page 2. * * The server requires exactly one filter shape, and requires `targetType` and * `targetId` to arrive together. With no filter supplied — or with a half-filled * target — the hook stays idle rather than issuing a request it knows will 400. */ declare function useFetchManyReputationGrantsWrapper(props?: UseFetchManyReputationGrantsWrapperProps): UseFetchManyReputationGrantsWrapperValues; export default useFetchManyReputationGrantsWrapper;