/** * React Component Type Definitions * * Types for LearnGraph React components and hooks. * * @packageDocumentation */ import type { SkillNode, PrerequisiteEdge, BloomLevel } from '../types/index.js'; /** * Node data for graph visualization */ export interface GraphNode { /** Unique node ID */ id: string; /** Display label */ label: string; /** Skill data */ skill: SkillNode; /** Node position */ position: { x: number; y: number; }; /** Node type for styling */ type: 'skill' | 'mastered' | 'available' | 'locked' | 'target'; /** Whether the node is selected */ selected?: boolean; /** Custom metadata */ data?: Record; } /** * Edge data for graph visualization */ export interface GraphEdge { /** Unique edge ID */ id: string; /** Source node ID */ source: string; /** Target node ID */ target: string; /** Edge data from storage */ edge: PrerequisiteEdge; /** Edge type for styling */ type: 'required' | 'recommended' | 'optional'; /** Whether the edge is animated */ animated?: boolean; /** Custom label */ label?: string; } /** * Graph layout algorithm options */ export type GraphLayout = 'dagre' | 'hierarchical' | 'force' | 'circular' | 'radial'; /** * SkillGraph component props */ export interface SkillGraphProps { /** Skills to display */ skills: SkillNode[]; /** Edges between skills */ edges: PrerequisiteEdge[]; /** IDs of mastered skills */ masteredSkillIds?: string[]; /** Target skill ID (for highlighting path) */ targetSkillId?: string; /** Layout algorithm */ layout?: GraphLayout; /** Node click handler */ onNodeClick?: (node: GraphNode) => void; /** Edge click handler */ onEdgeClick?: (edge: GraphEdge) => void; /** Whether graph is interactive */ interactive?: boolean; /** Whether to show minimap */ showMinimap?: boolean; /** Whether to show controls */ showControls?: boolean; /** Custom node colors by Bloom level */ bloomColors?: Partial>; /** Container width */ width?: number | string; /** Container height */ height?: number | string; /** Custom CSS class */ className?: string; /** Custom styles */ style?: React.CSSProperties; } /** * Graph viewport state */ export interface GraphViewport { x: number; y: number; zoom: number; } /** * Mastery state for display */ export interface MasteryState { /** Mastery probability (0-1) */ probability: number; /** Confidence level */ confidence: 'low' | 'medium' | 'high'; /** Number of attempts */ attempts: number; /** Last activity date */ lastActivity?: Date; /** Time to next review */ nextReview?: Date; } /** * SkillCard component props */ export interface SkillCardProps { /** Skill to display */ skill: SkillNode; /** Mastery state (if known) */ mastery?: MasteryState; /** Prerequisite skills */ prerequisites?: SkillNode[]; /** Dependent skills */ dependents?: SkillNode[]; /** Whether the skill is available to learn */ isAvailable?: boolean; /** Whether the skill is mastered */ isMastered?: boolean; /** Card variant */ variant?: 'compact' | 'detailed' | 'full'; /** Click handler */ onClick?: () => void; /** Start learning handler */ onStartLearning?: () => void; /** Practice handler */ onPractice?: () => void; /** Custom CSS class */ className?: string; /** Custom styles */ style?: React.CSSProperties; } /** * Path step with progress info */ export interface PathStep { /** Skill in this step */ skill: SkillNode; /** Step number (1-indexed) */ stepNumber: number; /** Completion status */ status: 'completed' | 'current' | 'upcoming' | 'locked'; /** Mastery state */ mastery?: MasteryState; /** Whether this is a prerequisite */ isPrerequisite: boolean; /** Estimated time to complete */ estimatedMinutes: number; } /** * LearningPathView component props */ export interface LearningPathViewProps { /** Path steps to display */ steps: PathStep[]; /** Target skill name */ targetSkillName: string; /** Current step index */ currentStepIndex?: number; /** View mode */ viewMode?: 'list' | 'timeline' | 'cards'; /** Step click handler */ onStepClick?: (step: PathStep) => void; /** Start step handler */ onStartStep?: (step: PathStep) => void; /** Show time estimates */ showTimeEstimates?: boolean; /** Show progress bar */ showProgress?: boolean; /** Custom CSS class */ className?: string; /** Custom styles */ style?: React.CSSProperties; } /** * Learning statistics */ export interface LearningStats { /** Total skills in curriculum */ totalSkills: number; /** Skills mastered */ masteredSkills: number; /** Skills in progress */ inProgressSkills: number; /** Skills available to learn */ availableSkills: number; /** Total learning time (minutes) */ totalLearningTime: number; /** Average mastery probability */ averageMastery: number; /** Streak days */ streakDays: number; /** Skills mastered this week */ weeklyProgress: number; } /** * Bloom level progress */ export interface BloomProgress { level: BloomLevel; total: number; mastered: number; percentage: number; } /** * Recent activity item */ export interface ActivityItem { /** Activity type */ type: 'mastered' | 'practiced' | 'started' | 'reviewed'; /** Skill involved */ skill: SkillNode; /** Activity timestamp */ timestamp: Date; /** Duration in minutes */ duration?: number; /** Result (for practice) */ result?: { correct: number; total: number; }; } /** * ProgressDashboard component props */ export interface ProgressDashboardProps { /** Learning statistics */ stats: LearningStats; /** Progress by Bloom level */ bloomProgress: BloomProgress[]; /** Recent activities */ recentActivity: ActivityItem[]; /** Skills due for review */ dueForReview?: SkillNode[]; /** Recommended next skills */ recommendations?: SkillNode[]; /** Learning goals */ goals?: Array<{ name: string; targetSkillId: string; progress: number; deadline?: Date; }>; /** Show detailed stats */ showDetailedStats?: boolean; /** Show activity feed */ showActivityFeed?: boolean; /** Skill click handler */ onSkillClick?: (skill: SkillNode) => void; /** Start review handler */ onStartReview?: () => void; /** Custom CSS class */ className?: string; /** Custom styles */ style?: React.CSSProperties; } /** * Filter options for skill explorer */ export interface SkillFilters { /** Search query */ query?: string; /** Bloom levels to include */ bloomLevels?: BloomLevel[]; /** Tags to include */ tags?: string[]; /** Mastery status filter */ masteryStatus?: 'all' | 'mastered' | 'available' | 'locked'; /** Sort field */ sortBy?: 'name' | 'bloomLevel' | 'estimatedMinutes' | 'mastery'; /** Sort direction */ sortDirection?: 'asc' | 'desc'; } /** * SkillExplorer component props */ export interface SkillExplorerProps { /** Skills to explore */ skills: SkillNode[]; /** Edges between skills */ edges: PrerequisiteEdge[]; /** IDs of mastered skills */ masteredSkillIds?: string[]; /** Available tags for filtering */ availableTags?: string[]; /** Initial filters */ initialFilters?: SkillFilters; /** View mode */ viewMode?: 'grid' | 'list' | 'graph'; /** Filter change handler */ onFiltersChange?: (filters: SkillFilters) => void; /** Skill selection handler */ onSkillSelect?: (skill: SkillNode) => void; /** Set goal handler */ onSetGoal?: (skill: SkillNode) => void; /** Enable search */ enableSearch?: boolean; /** Enable filters */ enableFilters?: boolean; /** Enable view toggle */ enableViewToggle?: boolean; /** Custom CSS class */ className?: string; /** Custom styles */ style?: React.CSSProperties; } /** * Graph context value */ export interface LearnGraphContextValue { /** All skills */ skills: SkillNode[]; /** All edges */ edges: PrerequisiteEdge[]; /** Mastered skill IDs */ masteredSkillIds: Set; /** Loading state */ isLoading: boolean; /** Error state */ error: Error | null; /** Refresh data */ refresh: () => Promise; /** Get skill by ID */ getSkill: (id: string) => SkillNode | undefined; /** Get prerequisites of a skill */ getPrerequisites: (skillId: string) => SkillNode[]; /** Get dependents of a skill */ getDependents: (skillId: string) => SkillNode[]; /** Check if skill is available */ isSkillAvailable: (skillId: string) => boolean; /** Mark skill as mastered */ markMastered: (skillId: string) => Promise; } /** * Use learning path hook options */ export interface UseLearningPathOptions { /** Target skill ID */ targetSkillId: string; /** Mastered skill IDs */ masteredSkillIds?: string[]; /** Whether to auto-refresh */ autoRefresh?: boolean; } /** * Use learning path hook result */ export interface UseLearningPathResult { /** Path steps */ steps: PathStep[]; /** Loading state */ isLoading: boolean; /** Error state */ error: Error | null; /** Total estimated minutes */ totalMinutes: number; /** Number of prerequisites */ prerequisiteCount: number; /** Refresh path */ refresh: () => Promise; } /** * Use ZPD hook options */ export interface UseZPDOptions { /** Mastered skill IDs */ masteredSkillIds?: string[]; /** Maximum skills to return */ limit?: number; } /** * Use ZPD hook result */ export interface UseZPDResult { /** Skills ready to learn */ readyToLearn: SkillNode[]; /** Skills almost ready */ almostReady: Array<{ skill: SkillNode; missingPrerequisites: SkillNode[]; }>; /** Loading state */ isLoading: boolean; /** Error state */ error: Error | null; /** Refresh ZPD */ refresh: () => Promise; } /** * Default Bloom level colors */ export declare const DEFAULT_BLOOM_COLORS: Record; /** * Status colors for mastery */ export declare const STATUS_COLORS: { readonly mastered: "#22c55e"; readonly available: "#3b82f6"; readonly inProgress: "#f59e0b"; readonly locked: "#9ca3af"; }; //# sourceMappingURL=types.d.ts.map