import type { MemberContributionEvent } from "./index.js"; export interface NexusRewardSettings { guildId: string; dailyEnabled: boolean; dailyBaseAmount: number; dailyTimezone: string; dailyStreakEnabled: boolean; dailyStreakBonus: number; dailyMaximumAmount: number; balanceRankingEnabled: boolean; earnedRankingEnabled: boolean; spentRankingEnabled: boolean; rankingInclusion: "opt_in" | "opt_out"; achievementsEnabled: boolean; revision: number; updatedAt: Date | null; } export type NexusRewardSettingsDraft = Omit; export type NexusRewardCapWindow = "hour" | "day" | "week"; export interface NexusManagedRewardSource { groupId: string; guildId: string; sourceModuleId: string; sourceName: string; enabled: boolean; configurableRuleCount: number; totalRuleCount: number; revision: number; updatedAt: Date; } export interface NexusManagedRewardRule { ruleId: string; groupId: string; guildId: string; sourceModuleId: string; sourceName: string; eventId: string; eventLabel: string; description: string; enabled: boolean; fixedAmount: number; memberCapAmount: number | null; capWindow: NexusRewardCapWindow | null; configurable: boolean; farmingRisk: "low" | "medium" | "high"; reviewNote: string; revision: number; updatedAt: Date; } export type NexusDailyClaimOutcome = "credited" | "duplicate" | "ineligible" | "balance_capped"; export interface NexusDailyClaimResult { outcome: NexusDailyClaimOutcome; localDate: string; amount: string; balance: string | null; streak: number; nextResetAt: Date; transactionId: string | null; } export type NexusRankingType = "balance" | "earned" | "spent"; export interface NexusRankingEntry { memberId: string; value: string; } export interface NexusRewardsService { getSettings(guildId: string): Promise; updateSettings(input: { guildId: string; actorUserId: string; expectedRevision: number; settings: NexusRewardSettingsDraft; }): Promise; getRankingPreference(input: { guildId: string; memberId: string; }): Promise; setRankingPreference(input: { guildId: string; memberId: string; included: boolean; }): Promise; listRankingCandidates(input: { guildId: string; type: NexusRankingType; limit: number; }): Promise; listManagedSources(input: { guildId: string; search?: string; sourceModuleId?: string; limit: number; offset: number; }): Promise<{ items: readonly NexusManagedRewardSource[]; total: number; }>; getManagedSource(input: { guildId: string; groupId: string; }): Promise; updateManagedSource(input: { guildId: string; groupId: string; actorUserId: string; expectedRevision: number; source: { enabled: boolean; }; }): Promise; listManagedRules(input: { guildId: string; search?: string; sourceModuleId?: string; configurable?: boolean; limit: number; offset: number; }): Promise<{ items: readonly NexusManagedRewardRule[]; total: number; }>; getManagedRule(input: { guildId: string; ruleId: string; }): Promise; updateManagedRule(input: { guildId: string; ruleId: string; actorUserId: string; expectedRevision: number; rule: { enabled: boolean; fixedAmount: number; memberCapAmount: number | null; capWindow: NexusRewardCapWindow | null; }; }): Promise; canProcessContribution(event: MemberContributionEvent): Promise; claimDaily(input: { guildId: string; memberId: string; memberRoleIds: readonly string[]; occurredAt: Date; }): Promise; processContribution(input: { event: MemberContributionEvent; memberExists: boolean; memberIsBot: boolean; memberRoleIds: readonly string[]; }): Promise<{ outcome: "credited" | "duplicate" | "source_disabled" | "rule_disabled" | "ineligible" | "rate_capped" | "balance_capped" | "invalid_source"; amount: string; transactionId: string | null; }>; getAchievementAwardedAmount(input: { guildId: string; memberId: string; }): Promise; processAchievementAward(input: { guildId: string; memberId: string; definitionId: string; definitionRevision: number; awardCount: number; rewardAmount: number; occurredAt: Date; }): Promise<{ outcome: "credited" | "duplicate" | "source_disabled" | "balance_capped"; occurrenceCount: number; amount: string; transactionId: string | null; }>; } export type NexusRewardsErrorCode = "daily_disabled" | "invalid_input" | "achievement_gap" | "revision_conflict"; export declare class NexusRewardsError extends Error { readonly code: NexusRewardsErrorCode; constructor(code: NexusRewardsErrorCode, message: string); }