import { Comment, Post, User, UserSocialLink } from "@devvit/web/server"; import { OnCommentCreateRequest, OnCommentUpdateRequest } from "@devvit/web/shared"; import { UserEvaluatorBase } from "./UserEvaluatorBase.js"; import { EvaluatorRegex, ValidationIssue } from "@fsvreddit/bot-bouncer-types"; interface AgeRange { dateFrom: string; dateTo?: string; } interface AgeInDays { maxAgeInDays?: number; minAgeInDays?: number; maxAgeInMinutes?: number; minAgeInMinutes?: number; } type AgeCriteria = AgeRange | AgeInDays; interface NotCondition { not: CriteriaGroup; } interface EveryCondition { every: CriteriaGroup[]; } interface SomeCondition { some: CriteriaGroup[]; } interface BaseItemCondition { matchesNeeded?: number; distinctSubsNeeded?: number; age?: AgeCriteria; edited?: boolean; subredditName?: string[]; notSubredditName?: string[]; bodyRegex?: string[]; minBodyLength?: number; maxBodyLength?: number; minParaCount?: number; maxParaCount?: number; minKarma?: number; maxKarma?: number; subIsNsfw?: boolean; } interface PostCondition extends BaseItemCondition { type: "post"; pinned?: boolean; titleRegex?: string[]; nsfw?: boolean; urlRegex?: string[]; domain?: string[]; isCrossPost?: boolean; } interface CommentCondition extends BaseItemCondition { type: "comment"; postId?: string[]; isTopLevel?: boolean; isCommentOnOwnPost?: boolean; postAuthorNameRegex?: string[]; postTitleRegex?: string[]; postBodyRegex?: string[]; postUrlRegex?: string[]; postCreatedAtAge?: AgeCriteria; } type CriteriaGroup = NotCondition | EveryCondition | SomeCondition | PostCondition | CommentCondition; interface BotGroup { name: string; submitterName?: string | string[]; descriptionForAI?: string; usernameRegex?: string[]; matchesDefaultUsernameRegex?: boolean; maxCommentKarma?: number; maxLinkKarma?: number; minCommentKarma?: number; minLinkKarma?: number; age?: AgeCriteria; nsfw?: boolean; bioRegex?: string[]; displayNameRegex?: string[]; socialLinkRegex?: string[]; socialLinkTitleRegex?: string[]; hasNoSocialLinks?: boolean; hasVerifiedEmail?: boolean; hasRedditPremium?: boolean; isSubredditModerator?: boolean; hasMoreThanOneCommentOnPosts?: boolean; criteria?: CriteriaGroup; } export declare class EvaluateBotGroupAdvanced extends UserEvaluatorBase { name: string; shortname: string; banContentThreshold: number; private redis; allowNewFeatures: boolean; private evaluationError; constructor(history: (Post | Comment)[], socialLinks: UserSocialLink[] | undefined, variables: Record); private compiledRegexes; private getCompiledRegex; private anyRegexMatches; getBotGroups(): BotGroup[]; validateVariables(): ValidationIssue[]; private uniqueMatchReasons; private getCriteriaGroupRegexes; private getBotGroupRegexes; gatherRegexes(): EvaluatorRegex[]; getSubGroups(): string[] | undefined; private matchesAgeCriteria; private anySubredditMatches; private postOrCommentMatchesCondition; collectCommentConditionsForPreEvalation(criteria: CriteriaGroup): CommentCondition[]; collectNegatedCommentConditionsForPreEvaluation(criteria: CriteriaGroup): CommentCondition[]; preEvaluateComment(comment: OnCommentCreateRequest | OnCommentUpdateRequest): Promise; private subNsfwCache; private isSubNsfw; private postMatchesCondition; private cachedPostProperties; private postPropertiesStatistics; private getPostProperties; private commentMatchesCondition; private collectPostConditionsForPreEvalation; private collectNegatedPostConditionsForPreEvaluation; preEvaluatePost(post: Post): Promise; private accountMatchesSocialLinkCriteria; private accountMatchesGroup; preEvaluateUser(user: User): Promise; private historyMatchesCriteriaGroup; private logEvaluationTime; private submitterName; setSubmitterName(submitterName: string): void; evaluate(user: User): Promise; } export {};