import type { AnalysisPayloadV1, BasicInfo, PalaceFact, ScopeType, ZiweiCalculationConfig } from '../types/analysis'; import type { ChartInput } from '../types/chart'; import type { IztroAstrolabe, IztroHoroscope } from '../types/iztro'; import { buildVerifiedDecadalTimelineOptions } from './iztro/decadal'; import { type ZiweiFortuneRangeOptions, type ZiweiFortuneTimeline } from './fortune-timeline'; /** npm 用户可直接消费的紫微完整运行结果。 */ export type ZiweiRuntime = { astrolabe: IztroAstrolabe; horoscope: IztroHoroscope; /** 本次运限计算实际采用的日期与时辰,便于缓存、审计和重放。 */ horoscopeContext: ZiweiHoroscopeContext; payloadByScope: Record; /** 年龄年独立批次使用的本命基础事实投影;不等同于 origin 完整分析。 */ natalSnapshot?: ZiweiNatalSnapshot; /** 当前运行是否为显式独立批次。 */ calculationBatch?: 'scope' | 'fortune'; decadalTimeline: Awaited>; /** 当前、全部或指定下层范围的逐阶段逐年资料;未请求范围时省略。 */ fortuneTimeline?: ZiweiFortuneTimeline; trueSolarEvidence?: ChartInput['trueSolarEvidence']; }; /** 提示词、序列化与公开分页只需要的盘面事实,不承诺附带目标时刻完整运限对象。 */ export type ZiweiRuntimeFacts = Omit; /** normal 口径的独立年龄年结果;本命、阶段与所选年龄年事实保持完整。 */ export type ZiweiFortuneBatchRuntime = ZiweiRuntimeFacts & { calculationBatch: 'fortune'; natalSnapshot: ZiweiNatalSnapshot; fortuneTimeline: ZiweiFortuneTimeline; }; export type ZiweiNatalSnapshot = { kind: 'natal-facts'; basicInfo: BasicInfo; calculationConfig: ZiweiCalculationConfig; palaces: PalaceFact[]; }; export declare const DEFAULT_ZIWEI_RUNTIME_SCOPES: ScopeType[]; export interface ZiweiHoroscopeContext { /** 运限排盘使用的公历日期,格式 YYYY-MM-DD。 */ dateStr: string; /** 运限排盘使用的时辰索引,范围 0-12。 */ hourIndex: number; } export interface ZiweiRuntimeOptions { /** 需要生成的资料范围;不传时生成全部范围。 */ scopes?: ScopeType[]; /** 是否只生成盘面结构而跳过证据和格局分析。 */ skipAnalysis?: boolean; /** 明确指定运限计算时刻,便于服务端缓存和测试复现。 */ horoscopeContext?: ZiweiHoroscopeContext; /** 未指定 horoscopeContext 时使用的当前时间。 */ now?: Date; /** 组织网页、HTTP 与 MCP 共用的紫微阶段/逐年范围资料。 */ fortuneRange?: ZiweiFortuneRangeOptions; /** 显式独立批次;scope 只计算一个资料范围,fortune 只计算年龄年与本命基础事实。 */ independentBatch?: 'scope' | 'fortune'; } /** 将一个星盘和运限对象转换为指定范围的结构化资料。 */ export declare function buildZiweiPayloadByScope(params: { astrolabe: IztroAstrolabe; horoscope: IztroHoroscope; scopes?: ScopeType[]; calculationConfig: AnalysisPayloadV1['calculation_config']; birthTime?: ChartInput['birthTime']; skipAnalysis?: boolean; currentScopeEvidenceOnly?: boolean; }): Record; /** 从星盘直接投影本命基础事实,不执行 origin 的证据池与格局分析。 */ export declare function buildZiweiNatalSnapshot(params: { astrolabe: IztroAstrolabe; calculationConfig: ZiweiCalculationConfig; birthTime?: ChartInput['birthTime']; }): ZiweiNatalSnapshot; /** * 生成紫微完整运行结果。 * * 默认使用当前时刻生成运限资料;服务端、缓存和测试建议显式传入 * `horoscopeContext`,避免同一份出生盘因运行时间不同而产生不同快照。 */ export declare function calculateZiweiChart(input: ChartInput, options?: ZiweiRuntimeOptions): Promise; /** 兼容应用层已有的“完整盘”命名。 */ export declare function calculateFullZiweiChart(input: ChartInput, skipAnalysis?: boolean): Promise; /** 兼容应用层已有的范围计算入口。 */ export declare function calculateZiweiChartForScopes(input: ChartInput, scopes?: ScopeType[], skipAnalysis?: boolean, options?: Omit): Promise; /** * 生成供提示词与公开序列化消费的紫微事实。 * normal + all 的独立年龄年无需构造不会被消费的目标时刻完整运限对象;其余路径保留 * `calculateZiweiChartForScopes` 的真实 ZiweiRuntime 行为。 */ export declare function calculateZiweiFactsForScopes(input: ChartInput, scopes?: ScopeType[], skipAnalysis?: boolean, options?: Omit): Promise; /** 面向较小接口响应的范围入口,始终保留本命资料。 */ export declare function calculatePublicZiweiChartForScopes(input: ChartInput, scopes?: ScopeType[], options?: Omit): Promise; /** 面向公开提示词与序列化的范围入口;旧非分页行为仍自动保留 origin。 */ export declare function calculatePublicZiweiFactsForScopes(input: ChartInput, scopes?: ScopeType[], options?: Omit): Promise; /** 只返回各范围结构化资料,不额外暴露完整运行时给调用方。 */ export declare function calculateZiweiPayloadByScope(input: ChartInput, options?: Omit & { scopes?: ScopeType[]; }): Promise>; /** 按指定日期和时辰生成单个紫微范围资料。 */ export declare function calculateZiweiDisplayPayload(params: { input: ChartInput; dateStr: string; hourIndex: number; scope: ScopeType; }): Promise; type ZiweiInputText = string | number; export interface ZiweiChartInputDraft { name: string; gender: 'male' | 'female'; dateType: 'solar' | 'lunar'; year: ZiweiInputText; month: ZiweiInputText; day: ZiweiInputText; timeIndex: number | ''; isLeapMonth: boolean; useTrueSolarTime?: boolean; birthHour?: ZiweiInputText; birthMinute?: ZiweiInputText; birthSecond?: ZiweiInputText; birthLongitude?: ZiweiInputText; timezone?: number; timeZoneId?: string; applyChinaDst?: boolean; algorithm?: 'default' | 'zhongzhou'; } /** 将网页表单或普通 JSON 输入转换为严格的紫微 ChartInput。 */ export declare function buildZiweiChartInput(input: ZiweiChartInputDraft): ChartInput; export {};