Libraries
    Preparing search index...

    Class SubscriptionBuilder<TParams, TQuery, THeaders, TServices, TPrincipal, TRoles, TIncoming, TOutgoing>

    Immutable, fluent builder for WebSocket subscription endpoint definitions.

    All methods return a new builder instance — the original is never mutated. Use endpoint.subscription() to obtain the first builder in the chain.

    const ChatRoom = endpoint
    .subscription('/ws/chat')
    .incoming(object({ text: string() }))
    .outgoing(object({ user: string(), text: string(), timestamp: number() }))
    .authorize(PrincipalSchema)
    .summary('Real-time chat room');

    Type Parameters

    • TParams = {}
    • TQuery = {}
    • THeaders = {}
    • TServices = {}
    • TPrincipal = undefined
    • TRoles extends string = string
    • TIncoming = undefined
    • TOutgoing = undefined
    Index

    Constructors

    • Type Parameters

      • TParams = {}
      • TQuery = {}
      • THeaders = {}
      • TServices = {}
      • TPrincipal = undefined
      • TRoles extends string = string
      • TIncoming = undefined
      • TOutgoing = undefined

      Parameters

      • basePath: string
      • pathTemplate: RoutePath = '/'
      • incomingSchema: SchemaBuilder<any, any, any, any, any> | null = null
      • outgoingSchema: SchemaBuilder<any, any, any, any, any> | null = null
      • querySchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null = null
      • headerSchema: ObjectSchemaBuilder<any, any, any, any, any, any, any> | null = null
      • serviceSchemas: Record<string, SchemaBuilder<any, any, any, any, any>> | null = null
      • authRoles: readonly string[] | null = null
      • summary: string | null = null
      • description: string | null = null
      • tags: readonly string[] = []
      • operationId: string | null = null
      • deprecated: boolean = false
      • externalDocs: { description?: string; url: string } | null = null

      Returns SubscriptionBuilder<
          TParams,
          TQuery,
          THeaders,
          TServices,
          TPrincipal,
          TRoles,
          TIncoming,
          TOutgoing,
      >

    Methods