import type { ChallengeVerificationMessageType, DecryptedChallengeAnswer, DecryptedChallengeRequestMessageTypeWithCommunityAuthor } from "../../../../pubsub-messages/types.js";
import type { Challenge, ChallengeFileFactoryInput, ChallengeResult, CommunityChallenge, CommunityChallengeSetting } from "../../../../community/types.js";
import { LocalCommunity } from "../local-community.js";
type PendingChallenge = Challenge & {
    index: number;
};
type DeferredChallenge = {
    index: number;
    communityChallenge: CommunityChallenge;
};
export type GetChallengeAnswers = (challenges: Omit<Challenge, "verify">[]) => Promise<DecryptedChallengeAnswer["challengeAnswers"]>;
export type ChallengeResultAggregate = {
    aggregatedComment?: Record<string, unknown>;
    aggregatedCommentUpdate?: Record<string, unknown>;
    aggregatedReason?: string;
};
type ChallengeVerificationSuccess = {
    challengeSuccess: true;
    pendingApprovalSuccess: boolean;
} & Omit<ChallengeResultAggregate, "aggregatedReason">;
type ChallengeVerificationPending = {
    pendingChallenges: PendingChallenge[];
    pendingApprovalSuccess: boolean;
    deferredChallenges?: DeferredChallenge[];
    partialResults?: (Challenge | ChallengeResult | undefined)[];
    communityChallenges?: CommunityChallenge[];
};
type ChallengeVerificationFailure = {
    challengeSuccess: false;
    challengeErrors: NonNullable<ChallengeVerificationMessageType["challengeErrors"]>;
} & Pick<ChallengeResultAggregate, "aggregatedReason">;
type PKCWithSettingsChallenges = {
    settings?: {
        challenges?: Record<string, ChallengeFileFactoryInput>;
    };
};
declare const pkcJsChallenges: Record<string, ChallengeFileFactoryInput>;
declare const getPendingChallengesOrChallengeVerification: ({ challengeRequestMessage, community }: {
    challengeRequestMessage: DecryptedChallengeRequestMessageTypeWithCommunityAuthor;
    community: LocalCommunity;
}) => Promise<ChallengeVerificationSuccess | ChallengeVerificationPending | ChallengeVerificationFailure>;
declare const getChallengeVerificationFromChallengeAnswers: ({ pendingChallenges, challengeAnswers, community, challengeRequestMessage, deferredChallenges, partialResults, communityChallenges }: {
    pendingChallenges: PendingChallenge[];
    challengeAnswers: DecryptedChallengeAnswer["challengeAnswers"];
    community: LocalCommunity;
    challengeRequestMessage?: DecryptedChallengeRequestMessageTypeWithCommunityAuthor;
    deferredChallenges?: DeferredChallenge[];
    partialResults?: (Challenge | ChallengeResult | undefined)[];
    communityChallenges?: CommunityChallenge[];
}) => Promise<ChallengeVerificationSuccess | ChallengeVerificationFailure>;
export type GetChallengeVerificationResult = Pick<ChallengeVerificationMessageType, "challengeErrors" | "challengeSuccess"> & {
    pendingApproval?: boolean;
} & ChallengeResultAggregate;
declare const getChallengeVerification: ({ challengeRequestMessage, community, getChallengeAnswers }: {
    challengeRequestMessage: DecryptedChallengeRequestMessageTypeWithCommunityAuthor;
    community: LocalCommunity;
    getChallengeAnswers: GetChallengeAnswers;
}) => Promise<GetChallengeVerificationResult>;
declare const getCommunityChallengeFromCommunityChallengeSettings: ({ communityChallengeSettings, pkc }: {
    communityChallengeSettings: CommunityChallengeSetting;
    pkc?: PKCWithSettingsChallenges;
}) => Promise<{
    communityChallenge: CommunityChallenge;
}>;
export { pkcJsChallenges, getPendingChallengesOrChallengeVerification, getChallengeVerificationFromChallengeAnswers, getChallengeVerification, getCommunityChallengeFromCommunityChallengeSettings };
