/** * Overlap aggregation for {@link AreaMembership} lists: when several area sources cover the same * receiver, a policy decides which memberships actually apply. Genre-agnostic and pure — policies * are `(memberships) => memberships` reducers over one receiver's memberships, so the caller stays * in control of magnitude and meaning. Pair with `createAreaEffectField().membershipsOf(receiverId)`. */ import type { AreaMembership } from "./areaEffectField.js"; /** Reduce one receiver's overlapping memberships to the subset that applies under a stacking rule. */ export type AreaStackPolicy

= (memberships: readonly AreaMembership

[]) => AreaMembership

[]; /** Read a comparable magnitude from a membership (e.g. buff strength, damage per tick). */ export type MagnitudeOf

= (membership: AreaMembership

) => number; /** * Every overlapping membership applies independently (no deduplication) — the default for hazards, * fields, and lights where two sources genuinely stack. * * @capability area-stack-independent apply every overlapping area membership independently */ export declare function independentStacks

(): AreaStackPolicy

; /** * Keep at most one membership per `stackKey`. With `magnitudeOf` the strongest per key wins (ties * broken by `sourceId` for determinism); without it the first-seen per key wins. Use for * unique-by-key buffs where reapplying the same aura should not stack. * * @capability area-stack-unique keep one area membership per stack key, strongest wins */ export declare function uniqueByStackKey

(magnitudeOf?: MagnitudeOf

): AreaStackPolicy

; /** * Keep at most `limit` memberships per `stackKey` (the highest-magnitude ones when `magnitudeOf` is * given, else the first-seen). Models capped stacks — e.g. a poison that stacks up to 5 times. * * @capability area-stack-capped cap area memberships per stack key at a maximum count */ export declare function cappedStacks

(limit: number, magnitudeOf?: MagnitudeOf

): AreaStackPolicy

; /** * Reduce to the single strongest membership overall (`weakest = false` picks the weakest); ties broken * by `sourceId`. Use when only the best or worst overlapping source should apply. * * @capability area-stack-extremum keep only the strongest or weakest overlapping area membership */ export declare function extremumStack

(magnitudeOf: MagnitudeOf

, weakest?: boolean): AreaStackPolicy

; /** * Sum a numeric magnitude across memberships — additive aggregation for a total field strength * (total damage per tick, total slow). A terminal reducer, not a filter, so it returns the number. * * @capability area-stack-additive sum a magnitude across overlapping area memberships */ export declare function sumMagnitude

(memberships: readonly AreaMembership

[], magnitudeOf: MagnitudeOf

): number;