buster/web/.cursor/rules/api_buster_request_interfac...

55 lines
1.4 KiB
Plaintext
Raw Normal View History

2025-02-14 04:09:38 +08:00
---
description: This will be used whenever we need a type for a request either from rest or web socket
globs: src/api/request_interfaces/**/*
2025-03-20 13:16:42 +08:00
alwaysApply: false
2025-02-14 04:09:38 +08:00
---
# Cursor Rules
## Directory Structure
This directory contains all the namespaces, each organized into separate folders. Every namespace follows this structure:
```
/namespaces/
├── namespace1/
│ ├── index.ts
│ ├── interfaces.ts
├── namespace2/
│ ├── index.ts
│ ├── interfaces.ts
...
```
### File Descriptions
#### `index.ts`
- This file serves as the entry point for the namespace, exporting all relevant types and utilities.
#### `interfaces.ts`
2025-03-20 13:16:42 +08:00
- This file defines the TypeScript interfaces for the namespace. This is mostly just the response interfaces. The request interfaces should be defined as a param on the request itself.
2025-02-14 04:09:38 +08:00
- All interfaces must be documented using **TSDoc** to ensure clarity and maintainability.
Example:
```ts
/**
* Represents a user profile in the system.
*/
export interface UserProfile {
/** The unique identifier for the user */
id: string;
/** The user's display name */
name: string;
}
```
## Usage
These namespace types will be imported into the following locations:
- `/src/api/buster_rest/*`
- `/src/api/buster_socket/*`
- `/src/api/buster_socket_query/*`
Ensure that all types are properly imported and used to maintain consistency across the codebase.