mirror of
https://github.com/Snigdha-OS/package-browser.git
synced 2025-12-06 16:13:52 +01:00
🧹 chore: separating the repository into a type alias makes the code more modular
This commit is contained in:
19
src/types.ts
19
src/types.ts
@@ -1,11 +1,26 @@
|
||||
// Type alias for repository categories
|
||||
export type Repository = 'core' | 'extra' | 'community' | 'multilib';
|
||||
|
||||
// Interface representing a single package
|
||||
export interface Package {
|
||||
/** The name of the package */
|
||||
name: string;
|
||||
|
||||
/** The version of the package */
|
||||
version: string;
|
||||
|
||||
/** A brief description of the package */
|
||||
description: string;
|
||||
repository: 'core' | 'extra' | 'community' | 'multilib';
|
||||
|
||||
/** The repository where the package is located */
|
||||
repository: Repository;
|
||||
}
|
||||
|
||||
// Interface representing the response containing a list of packages
|
||||
export interface PackageResponse {
|
||||
/** Array of packages */
|
||||
packages: Package[];
|
||||
|
||||
/** Total number of packages available */
|
||||
total: number;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user