Action

Type

Resolved On

Create types directory with proper TypeScript interfaces feature - - -

Create types directory with proper TypeScript interfaces

Description

Many functions return any[] instead of proper types. Create a src/types/ directory with TypeScript interfaces for all domain entities.

Current Issues

Functions use any[] return types:

export async function ideas(...): Promise<any[]>
export async function backlog(...): Promise<any[]>
export async function completedTasks(...): Promise<any[]>

Proposed Types

Create src/types/index.ts:

export interface Idea {
  name: string;
  project: string;
  completed: boolean;
  link?: string;
  description?: string;
  color?: string;
  side?: string;
}

export interface BacklogItem {
  name: string;
  progress: number;
  link?: string;
  level: number;
  box?: string;
  hover?: string;
  line?: string;
}

export interface Task {
  id?: string;
  task: string;
  parent: string;
  completed_on?: string | null;
}

export interface Goal {
  goal: string;
  completed?: boolean;
  due?: string;
  owner?: string;
  monthly?: boolean;
}

export interface Level {
  project: string;
  name: string;
  story: string;
  todo: string[];
  completed: string[];
}

export interface Action {
  action: string;
  type: string;
  project: string;
  reported_on: string;
  resolved: boolean;
  slug: string;
}

Benefits

  • Type safety and IDE autocomplete
  • Better documentation
  • Easier refactoring

Affected Files

  • src/lib/monthly.ts
  • src/lib/yearly.ts
  • src/lib/weekly.ts
  • New file: src/types/index.ts