import { WeavyType } from '../client/weavy'; /** * The entity kinds that can be reported, matching the API route segment. * * Reporting is entity-agnostic on the server, so widening this is a matter of adding the route there and the string here. */ export type ReportEntityType = "messages" | "posts" | "comments" | "users"; export type MutateReportProps = { entityType: ReportEntityType; entityId: number | string; /** * App the message or post belongs to. Only used to find the entity in the cache, so it can be marked as reported. * Not needed for users, whose profiles are refetched, nor for comments, which are cached under their parent. */ appId?: number; /** Where the comment list lives (`posts`, `files` or `apps`), the first segment of the comments query key. */ parentType?: "posts" | "files" | "apps"; /** The entity the comment belongs to, the last segment of the comments query key. */ parentId?: number; }; /** * Mutation options for reporting a message, post, comment or user. * * The server sends `is_reported` on reportable content, so the flag survives a refetch on its own. The cache is patched * here as well, so the flag turns red the moment the report succeeds rather than waiting for the next fetch. * User profiles are invalidated so their caller-relative reported flag is refreshed. * * Each content type is cached under a different key shape, so the patch is matched on `entityType`. Posts live in both * the per-app list and the cross-app feed, and either may be on screen, so both are patched. Lists carry filter * suffixes on their keys, which is why the list patches match on a key prefix rather than exactly. */ export declare function getReportMutationOptions(weavy: WeavyType): { mutationKey: string[]; mutationFn: ({ entityType, entityId }: MutateReportProps) => Promise; onSuccess: (_data: void, { entityType, entityId, appId, parentType, parentId }: MutateReportProps) => Promise; }; //# sourceMappingURL=reports.d.ts.map