feat: add TypeScript types, API client, and TanStack Query hooks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
71
TaskTracker.Web/src/types/index.ts
Normal file
71
TaskTracker.Web/src/types/index.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
export const WorkTaskStatus = {
|
||||
Pending: 0,
|
||||
Active: 1,
|
||||
Paused: 2,
|
||||
Completed: 3,
|
||||
Abandoned: 4,
|
||||
} as const
|
||||
export type WorkTaskStatus = (typeof WorkTaskStatus)[keyof typeof WorkTaskStatus]
|
||||
|
||||
export const NoteType = {
|
||||
PauseNote: 0,
|
||||
ResumeNote: 1,
|
||||
General: 2,
|
||||
} as const
|
||||
export type NoteType = (typeof NoteType)[keyof typeof NoteType]
|
||||
|
||||
export interface WorkTask {
|
||||
id: number
|
||||
title: string
|
||||
description: string | null
|
||||
status: WorkTaskStatus
|
||||
category: string | null
|
||||
createdAt: string
|
||||
startedAt: string | null
|
||||
completedAt: string | null
|
||||
estimatedMinutes: number | null
|
||||
parentTaskId: number | null
|
||||
subTasks: WorkTask[]
|
||||
notes: TaskNote[]
|
||||
contextEvents: ContextEvent[]
|
||||
}
|
||||
|
||||
export interface TaskNote {
|
||||
id: number
|
||||
workTaskId: number
|
||||
content: string
|
||||
type: NoteType
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface ContextEvent {
|
||||
id: number
|
||||
workTaskId: number | null
|
||||
source: string
|
||||
appName: string
|
||||
windowTitle: string
|
||||
url: string | null
|
||||
timestamp: string
|
||||
}
|
||||
|
||||
export interface AppMapping {
|
||||
id: number
|
||||
pattern: string
|
||||
matchType: string
|
||||
category: string
|
||||
friendlyName: string | null
|
||||
}
|
||||
|
||||
export interface ContextSummaryItem {
|
||||
appName: string
|
||||
category: string
|
||||
eventCount: number
|
||||
firstSeen: string
|
||||
lastSeen: string
|
||||
}
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
success: boolean
|
||||
data: T
|
||||
error: string | null
|
||||
}
|
||||
Reference in New Issue
Block a user