refactor(types): add unified API response types and error helpers

This commit is contained in:
DrSmoothl
2026-03-01 16:53:34 +08:00
parent 416bf36f1a
commit f9dd197f53
2 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
/**
* Unified API response type definition
* Discriminated union for type-safe error handling
*/
export type ApiResponse<T> =
| { success: true; data: T }
| { success: false; error: string }