mirror of https://github.com/buster-so/buster.git
55 lines
1.4 KiB
Plaintext
55 lines
1.4 KiB
Plaintext
---
|
|
description: This will be used whenever we need a type for a request either from rest or web socket
|
|
globs: src/api/request_interfaces/**/*
|
|
alwaysApply: false
|
|
---
|
|
# 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`
|
|
- 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.
|
|
- 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.
|
|
|