import { type QizhengInput, type QizhengResult } from '../qi_zheng'; import { type BirthProfile, type NormalizedBirthProfile } from '../profile'; import { type BirthProfileTimeRange } from '../profile/time-range'; import { type ZiweiRuntime, type ZiweiRuntimeOptions } from '../ziwei/runtime'; import type { AstrolabeBirthInput, AstrolabeData } from '../types/divination'; import type { BaziChartResult, Person } from '../bazi/baziTypes'; import type { ChartInput } from '../types/chart'; export type { BirthProfile } from '../profile'; export type BirthChartSystem = 'bazi' | 'ziwei' | 'astrolabe' | 'qizheng'; export interface BirthChartBundleInputs { bazi?: Person; ziwei?: ChartInput; astrolabe?: AstrolabeBirthInput; qizheng?: QizhengInput; } /** 一个明确出生时刻按所选系统生成的完整结果集合。 */ export interface BirthChartPointBundle { profile: BirthProfile; normalized: NormalizedBirthProfile; systems: BirthChartSystem[]; inputs: BirthChartBundleInputs; bazi?: BaziChartResult; ziwei?: ZiweiRuntime; astrolabe?: AstrolabeData; qizheng?: QizhengResult; range?: never; } /** 区间内本批实际计算的整秒点;各秒保留完整输入、盘面和时间证据。 */ export interface BirthChartRangeSample { index: number; timestamp: number; bundle: BirthChartPointBundle; } export interface BirthChartRangeBundle { profile: BirthProfile; systems: BirthChartSystem[]; range: { source: BirthProfileTimeRange; resolutionSeconds: 1; totalSamples: number; startIndex: number; endIndexExclusive: number; /** 后续批次起点;null 只表示本批到达区间末尾,不表示调用方已读取此前各批。 */ nextIndex: number | null; samples: BirthChartRangeSample[]; }; normalized?: never; inputs?: never; bazi?: never; ziwei?: never; astrolabe?: never; qizheng?: never; } export type BirthChartBundle = BirthChartPointBundle | BirthChartRangeBundle; export interface BirthChartBundleOptions { /** 默认只计算八字;紫微需要调用方安装可选 peerDependency iztro。 */ systems?: BirthChartSystem[]; /** 八字规则偏好,与客观出生档案分开保存。 */ baziRules?: Pick; /** 紫微排盘口径;省略的字段沿用统一档案转换的默认值。 */ ziweiRules?: Pick; ziwei?: ZiweiRuntimeOptions; /** 区间输入每次默认计算一个整秒点,按返回的 nextIndex 继续。 */ rangeBatch?: { startIndex?: number; limit?: number; }; signal?: AbortSignal; } /** 同一入口按出生日期输入模式生成单点结果或有界的完整整秒资料。 */ export declare function calculateBirthChartBundle(profile: BirthProfile, options?: BirthChartBundleOptions): Promise;