/** * 太乙三门、五将与阴阳和条件。 * * 这些条件只描述盘面中可以由现有宫位、算数和积数直接复算的关系, * 不把条件命中数转换成分数、概率或现实成败。 */ declare const CANONICAL_TAIYI_GATE_ORDER: readonly ["开门", "休门", "生门", "伤门", "杜门", "景门", "死门", "惊门"]; export declare const TAIYI_GATE_ORDER: typeof CANONICAL_TAIYI_GATE_ORDER; export type TaiyiGateName = (typeof TAIYI_GATE_ORDER)[number]; /** 太乙八宫左行顺序:乾一、坎八、艮三、震四、巽九、离二、坤七、兑六。 */ declare const CANONICAL_TAIYI_GATE_PALACE_ORDER: readonly [1, 8, 3, 4, 9, 2, 7, 6]; export declare const TAIYI_GATE_PALACE_ORDER: typeof CANONICAL_TAIYI_GATE_PALACE_ORDER; export type TaiyiPalaceRelation = '同宫' | '击' | '迫' | '格'; export type TaiyiPolarity = '阳' | '阴'; export type TaiyiWuxing = '木' | '火' | '土' | '金' | '水'; /** 十六神所在神名的五行,取《古今图书集成·太乙淘金歌·定胜负》所列二目五行。 */ declare const CANONICAL_TAIYI_POINT_WUXING: Readonly>>; export declare const TAIYI_POINT_WUXING: typeof CANONICAL_TAIYI_POINT_WUXING; export type TaiyiHostGuestElementRelation = '客关主' | '主关客' | '同类' | '未形成五行相制' | '未判定'; export interface TaiyiGateRoleFact { role: '太乙' | '文昌(主目)' | '始击(客目)'; position: string; palace: number; gate?: TaiyiGateName; /** 始击的门位保留展示,但不并入当前“太乙、文昌主目”三门具判定。 */ usedForThreeGate: boolean; } export interface TaiyiThreeGateCondition { directGate: TaiyiGateName; /** 240 周期余数,余 0 以 240 表示。 */ directGateRemainder: number; /** 直门在开、休、生、伤、杜、景、死、惊中的序号,1-8。 */ directGateNumber: number; gateByPalace: Record; roles: TaiyiGateRoleFact[]; /** 当前三门具判定采用主门口径:太乙与文昌(主目)。 */ gateScope: '太乙、文昌(主目)'; complete: boolean; status: '三门具' | '两门不具' | '三门不具'; missingGateCount: 0 | 2 | 3; blockedRoles: string[]; basis: string; } export interface TaiyiFiveGeneralsRelation { relation: TaiyiPalaceRelation; left: string; leftPalace: number; right: string; rightPalace: number; kind: '始击掩/击' | '文昌囚/迫' | '主客同宫关' | '客目/客将格' | '文昌对'; } /** 卷四“推主客相关法”的二目五行事实;不冒充卷三同宫关。 */ export interface TaiyiHostGuestElementFact { hostPosition: string; hostElement?: TaiyiWuxing; guestPosition: string; guestElement?: TaiyiWuxing; relation: TaiyiHostGuestElementRelation; /** 卷四另称以日计纳音决之;当前接口只具备二目所在十六神,故不宣称完整日计纳音判层。 */ complete: boolean; usedForFiveGeneralsLaunch: false; basis: string; } export interface TaiyiFiveGeneralsCondition { shiJiNoCoverOrHit: boolean; shiJiRelationToTaiyi?: TaiyiPalaceRelation; wenChangNoImprisonOrPressure: boolean; wenChangRelationToTaiyi?: TaiyiPalaceRelation; /** 卷三“推关法”同宫关;中宫同宫也计入,只有邻/对关系跳过中宫。 */ hostGuestNoSamePalaceRelation: boolean; /** 卷三格、对另列:客目/客将对太乙为格,文昌对太乙为对。 */ noGuestOppositionOrWenChangOpposition: boolean; hostGuestElementRelation: TaiyiHostGuestElementFact; relations: TaiyiFiveGeneralsRelation[]; launched: boolean; launchRule: string; basis: string; } export interface TaiyiYinYangPairFact { role: '太乙-主算' | '太乙-客算' | '文昌-主算' | '始击-客算'; position?: string; palace: number; polarity: TaiyiPolarity; count: number; countPolarity: TaiyiPolarity; matched: boolean; basis: string; } export interface TaiyiYinYangCondition { matched: boolean; pairFacts: TaiyiYinYangPairFact[]; basis: string; } export interface TaiyiRuleConditions { threeGates: TaiyiThreeGateCondition; fiveGenerals: TaiyiFiveGeneralsCondition; yinYangHarmony: TaiyiYinYangCondition; } export interface TaiyiConditionInput { accumulatedValue: number; taiyiPosition: string; taiyiPalace: number; wenChangPosition: string; wenChangPalace: number; shiJiPosition: string; shiJiPalace: number; lordCount: number; guestCount: number; lordGeneral: number; lordAssistant: number; guestGeneral: number; guestAssistant: number; } export declare function evaluateTaiyiConditions(data: TaiyiConditionInput): TaiyiRuleConditions; export {};