Scope Example - JSDoc @scope Feature
Project Structure
Section titled “Project Structure”scope-example/├── README.md├── ioc.config.json├── demo.ts├── container.gen.ts└── services/ ├── ISingletonService.ts ├── SingletonService.ts ├── ITransientService.ts ├── TransientService.ts └── MixedService.ts
Singleton Service (Default)
Section titled “Singleton Service (Default)”/** * @scope singleton */export class SingletonService implements ISingletonService { // Implementation}
Transient Service
Section titled “Transient Service”/** * @scope transient */export class TransientService implements ITransientService { // Implementation}
Configuration
Section titled “Configuration”{ "source": ".", "output": "container.gen.ts", "interface": "I[A-Z].*", "exclude": [ "**/*.test.ts", "**/*.spec.ts" ]}