{"path":"functions/api/types.ts","name":"types.ts","size":2170,"sha":"38337c4c64453127a33c86b9530f42005fb6773d","encoding":"utf-8","content":"export interface GitHubRepo {\n  owner: {\n    login: string;\n  };\n  name: string;\n  description: string | null;\n  stargazers_count: number;\n  forks_count: number;\n  subscribers_count: number; // watchers\n  language: string | null;\n  default_branch: string;\n  html_url: string;\n  updated_at: string;\n  homepage: string | null;\n  topics: string[];\n  license: { key: string; name: string; spdx_id: string; url: string } | null;\n}\n\nexport interface GitHubTreeItem {\n  path: string;\n  mode: string;\n  type: \"blob\" | \"tree\";\n  sha: string;\n  size?: number;\n  url: string;\n}\n\nexport interface GitHubTree {\n  sha: string;\n  url: string;\n  tree: GitHubTreeItem[];\n  truncated: boolean;\n}\n\nexport interface GitHubReadme {\n  content: string;\n  encoding: string;\n}\n\nexport interface GitHubContentFile {\n  type: \"file\";\n  encoding: string;\n  size: number;\n  name: string;\n  path: string;\n  content?: string;\n  sha: string;\n  url: string;\n  html_url: string;\n  download_url: string | null;\n}\n\nexport interface RepositoryMetadata {\n  owner: string;\n  name: string;\n  description: string | null;\n  stars: number;\n  forks: number;\n  watchers: number;\n  language: string | null;\n  default_branch: string;\n  html_url: string;\n  updated_at: string;\n  homepage: string | null;\n  topics: string[];\n  license: string | null;  // Just the license name\n  readme: string | null;   // Decoded content\n}\n\nexport interface ApiResponse {\n  repository: RepositoryMetadata;\n  tree: string;\n  files: string[];\n  stats: TreeStats;\n  meta: {\n    cached: boolean;\n    generated_at: string;\n    truncated: boolean;\n    params?: QueryParams;\n  };\n}\n\nexport interface GitHubError {\n  message: string;\n}\n\nexport interface TreeStats {\n  total_files: number;\n  total_size: number;\n  by_extension: Record<string, number>;\n}\n\nexport interface QueryParams {\n  depth?: number;\n  format?: \"tree\" | \"plain\";\n  filter?: string;\n}\n\nexport interface FileContentResponse {\n  path: string;\n  name: string;\n  size: number;\n  sha: string;\n  encoding: string;\n  content: string;\n  url: string;\n  html_url: string;\n  download_url: string | null;\n  meta: {\n    cached: boolean;\n    generated_at: string;\n    ref?: string;\n  };\n}\n","url":"https://api.github.com/repos/iamkaf/gh-tree/contents/functions/api/types.ts?ref=main","html_url":"https://github.com/iamkaf/gh-tree/blob/main/functions/api/types.ts","download_url":"https://raw.githubusercontent.com/iamkaf/gh-tree/main/functions/api/types.ts","meta":{"cached":false,"generated_at":"2026-05-09T02:36:40.107Z"}}