# Node SDK: TypeScript Types

The SDK exports full TypeScript types for all API objects.

## Importing Types

```typescript
import type {
  TimeEntry,
  CreateTimeEntryInput,
  UpdateTimeEntryInput,
  Expense,
  CreateExpenseInput,
  Project,
  User,
  PaginatedResponse,
  ListTimeEntriesParams,
  ListExpensesParams,
} from '@keito/sdk';
```

## TimeEntry

```typescript
interface TimeEntry {
  id: string;
  project_id: string;
  task_id: string | null;
  user_id: string;
  spent_date: string;
  hours: number;
  notes: string | null;
  is_running: boolean;
  is_billable: boolean;
  source: 'web' | 'cli' | 'api' | 'agent';
  metadata: Record<string, unknown> | null;
  created_at: string;
  updated_at: string;
}
```

## CreateTimeEntryInput

```typescript
interface CreateTimeEntryInput {
  project_id: string;
  spent_date: string;
  hours?: number;
  task_id?: string;
  notes?: string;
  is_running?: boolean;
  is_billable?: boolean;
  source?: 'web' | 'cli' | 'api' | 'agent';
  metadata?: Record<string, unknown>;
}
```

## Expense

```typescript
interface Expense {
  id: string;
  project_id: string;
  expense_category_id: string;
  spent_date: string;
  units: number | null;
  unit_price: number | null;
  total_cost: number;
  notes: string | null;
  source: 'web' | 'cli' | 'api' | 'agent';
  metadata: Record<string, unknown> | null;
  created_at: string;
}
```

## Project

```typescript
interface Project {
  id: string;
  name: string;
  client_id: string;
  billing_type: 'time_and_materials' | 'fixed_fee' | 'non_billable';
  is_billable: boolean;
  budget_hours: number | null;
  budget_amount: number | null;
  is_active: boolean;
  created_at: string;
}
```

## User

```typescript
interface User {
  id: string;
  name: string;
  email: string;
  user_type: 'human' | 'agent';
  is_active: boolean;
  billable_rate: number;
  cost_rate: number;
  created_at: string;
}
```

## PaginatedResponse

```typescript
interface PaginatedResponse<T> {
  data: T[];
  next_cursor: string | null;
  has_more: boolean;
}
```

## Source Type

```typescript
type Source = 'web' | 'cli' | 'api' | 'agent';
```