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:
17
src/types.ts
17
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 {
|
export interface Package {
|
||||||
|
/** The name of the package */
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
|
/** The version of the package */
|
||||||
version: string;
|
version: string;
|
||||||
|
|
||||||
|
/** A brief description of the package */
|
||||||
description: string;
|
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 {
|
export interface PackageResponse {
|
||||||
|
/** Array of packages */
|
||||||
packages: Package[];
|
packages: Package[];
|
||||||
|
|
||||||
|
/** Total number of packages available */
|
||||||
total: number;
|
total: number;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user