UNPKG

@bagaking/dayboxing

Version:

A React component library for DayBoxing time management visualization

58 lines (57 loc) 1.8 kB
import { DayData, QHAnalysis, AnalysisResult } from "../types"; /** * Analyze day data into QH segments * * QH Rules: * - A segment: First 7h, should be Sleep Full Part * - B segment: Next 7h, should be Mix Part * - C segment: Next 7h, any type except Chaos * - F segment: Remaining 0-7h, flexible end time * * @param day - Day data to analyze * @returns Array of QH segments */ export declare const analyzeQHSegments: (day: DayData) => QHAnalysis[]; /** * 格式化小时数,处理负数和超过24小时的情况 * @param hour - 小时数 * @returns 格式化后的时间字符串 */ export declare const formatHourClip24: (hour: number) => string; /** * 获取段落统计信息 * @param seg - 段落分析 * @returns 段落统计信息 */ export declare const getSegmentStats: (seg: QHAnalysis) => { duration: number; mainTypePercent: number; secondaryTypePercent: number; hasSecondary: boolean; }; /** * Analyze segment characteristics and status * * Rules based on DayBoxing theory: * - A segment should be Sleep Full Part * - B segment should be Mix Part with proper start type * - C segment can be any type except Chaos * - F segment handles flexible hours */ export declare const analyzeSegment: (seg: QHAnalysis, segments: QHAnalysis[], days?: DayData[]) => AnalysisResult; /** * 获取段落描述 * @param seg - 段落分析 * @returns 段落描述 */ export declare const getSegmentDescription: (seg: QHAnalysis) => string; /** * 获取段落类型符号 * @param seg - 段落分析 * @returns 段落类型符号 */ export declare const getSegmentTypeSymbol: (seg: QHAnalysis) => string; /** * Analyze day overall characteristics */ export declare const analyzeDayOverall: (day: DayData, historicalDays?: DayData[]) => AnalysisResult;