When modifying or extending public interfaces, ensure changes maintain backward compatibility and follow proper versioning practices. Key guidelines:
When modifying or extending public interfaces, ensure changes maintain backward compatibility and follow proper versioning practices. Key guidelines:
// Do this interface HttpServer { newMethod?(): void; }
2. Use union types for extending existing types:
```typescript
// Instead of
type Version = string;
// Do this
type Version = string | (string & {}) | ((version: string) => boolean);
@Version(‘<2.5.0’) @Get(‘:id’) legacyMethod() {} } ```
These practices ensure API consumers can upgrade safely and maintain compatibility with their existing implementations.
Enter the URL of a public GitHub repository