# Decorator IO
DecoratorModule | import { IO } from "@tsed/socketio" |
---|---|
Source | /packages/socketio/src/decorators/io.ts |
# Overview
function IO(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
# Description
Inject the SocketIO.Server (opens new window) instance in the decorated parameter.
# Example
@SocketService("/nsp")
export class MyWS {
constructor(@IO private io: Server) {}
}
1
2
3
4
2
3
4
Other topics
- Session & cookies
- Passport.js
- Keycloak
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- AWS
- Seq
- OIDC
- Stripe
- Controllers
- Providers
- Model
- JsonMapper
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Exceptions
- Throw HTTP Exceptions
- Cache
- Hooks
- Response Filter
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing
- Customize 404