Skip to main content Link Search Menu Expand Document (external link)

Envelope.ts overview

Since v1.0.0


Exports Grouped by Category


constructors

makeRequest

Signature

declare const makeRequest: <Rpc extends Rpc.Any>(options: {
  readonly requestId: Snowflake
  readonly address: EntityAddress
  readonly tag: Rpc.Tag<Rpc>
  readonly payload: Rpc.Payload<Rpc>
  readonly headers: Headers.Headers
  readonly traceId: string
  readonly spanId: string
  readonly sampled: boolean
}) => Request<Rpc>

Source

Since v1.0.0

models

AckChunk (class)

Signature

declare class AckChunk

Source

Since v1.0.0

withRequestId (method)

Signature

declare const withRequestId: (requestId: Snowflake) => AckChunk

Source

Since v1.0.0

[TypeId] (property)

Signature

readonly [TypeId]: unique symbol

Source

Since v1.0.0

Envelope (type alias)

Signature

type Envelope<R> = Request<R> | AckChunk | Interrupt

Source

Since v1.0.0

Interrupt (class)

Signature

declare class Interrupt

Source

Since v1.0.0

withRequestId (method)

Signature

declare const withRequestId: (requestId: Snowflake) => Interrupt

Source

Since v1.0.0

[TypeId] (property)

Signature

readonly [TypeId]: unique symbol

Source

Since v1.0.0

Request (interface)

Signature

export interface Request<in out Rpc extends Rpc.Any> {
  readonly [TypeId]: TypeId
  readonly _tag: "Request"
  readonly requestId: Snowflake
  readonly address: EntityAddress
  readonly tag: Rpc.Tag<Rpc>
  readonly payload: Rpc.Payload<Rpc>
  readonly headers: Headers.Headers
  readonly traceId: string
  readonly spanId: string
  readonly sampled: boolean
}

Source

Since v1.0.0

primary key

primaryKey

Signature

declare const primaryKey: <R extends Rpc.Any>(envelope: Envelope<R>) => string | null

Source

Since v1.0.0

refinements

isEnvelope

Signature

declare const isEnvelope: (u: unknown) => u is Envelope<any>

Source

Since v1.0.0

serialization / deserialization

EnvelopeFromSelf

Signature

declare const EnvelopeFromSelf: Schema.Schema<Envelope.Any, Envelope.Any>

Source

Since v1.0.0

PartialEncoded

Signature

declare const PartialEncoded: Schema.Union<
  [
    Schema.Struct<{
      _tag: Schema.Literal<["Request"]>
      requestId: Schema.Schema<Snowflake, string>
      address: typeof EntityAddress
      tag: typeof Schema.String
      payload: typeof Schema.Unknown
      headers: Schema.Schema<Headers.Headers, ReadonlyRecord<string, string>>
      traceId: typeof Schema.String
      spanId: typeof Schema.String
      sampled: typeof Schema.Boolean
    }>,
    typeof AckChunk,
    typeof Interrupt
  ]
>

Source

Since v1.0.0

PartialEncodedArray

Signature

declare const PartialEncodedArray: Schema.Schema<Array<Envelope.PartialEncoded>, Array<any>>

Source

Since v1.0.0

PartialEncodedFromSelf

Signature

declare const PartialEncodedFromSelf: Schema.Union<
  [
    Schema.Struct<{
      _tag: Schema.Literal<["Request"]>
      requestId: Schema.Schema<Snowflake>
      address: Schema.Schema<EntityAddress>
      tag: typeof Schema.String
      payload: typeof Schema.Unknown
      headers: Schema.Schema<Headers.Headers>
      traceId: typeof Schema.String
      spanId: typeof Schema.String
      sampled: typeof Schema.Boolean
    }>,
    Schema.Schema<AckChunk>,
    Schema.Schema<Interrupt>
  ]
>

Source

Since v1.0.0

PartialEncodedRequest

Signature

declare const PartialEncodedRequest: Schema.Struct<{
  _tag: Schema.Literal<["Request"]>
  requestId: Schema.Schema<Snowflake, string>
  address: typeof EntityAddress
  tag: typeof Schema.String
  payload: typeof Schema.Unknown
  headers: Schema.Schema<Headers.Headers, ReadonlyRecord<string, string>>
  traceId: typeof Schema.String
  spanId: typeof Schema.String
  sampled: typeof Schema.Boolean
}>

Source

Since v1.0.0

PartialEncodedRequestFromSelf

Signature

declare const PartialEncodedRequestFromSelf: Schema.Struct<{
  _tag: Schema.Literal<["Request"]>
  requestId: Schema.Schema<Snowflake>
  address: Schema.Schema<EntityAddress>
  tag: typeof Schema.String
  payload: typeof Schema.Unknown
  headers: Schema.Schema<Headers.Headers>
  traceId: typeof Schema.String
  spanId: typeof Schema.String
  sampled: typeof Schema.Boolean
}>

Source

Since v1.0.0

RequestFromSelf

Signature

declare const RequestFromSelf: Schema.Schema<Request.Any, Request.Any>

Source

Since v1.0.0

type ids

TypeId

Signature

declare const TypeId: unique symbol

Source

Since v1.0.0

TypeId (type alias)

Signature

type TypeId = typeof TypeId

Source

Since v1.0.0

utils

Envelope (namespace)

Source

Since v1.0.0

Any (type alias)

Signature

type Any = Envelope<any>

Source

Since v1.0.0

Encoded (type alias)

Signature

type Encoded = Request.Encoded | typeof AckChunk.Encoded | typeof Interrupt.Encoded

Source

Since v1.0.0

PartialEncoded (type alias)

Signature

type PartialEncoded = Request.PartialEncoded | AckChunk | Interrupt

Source

Since v1.0.0

Request (namespace)

Source

Since v1.0.0

Encoded (interface)

Signature

export interface Encoded {
  readonly _tag: "Request"
  readonly requestId: string
  readonly address: typeof EntityAddress.Encoded
  readonly tag: string
  readonly payload: unknown
  readonly headers: ReadonlyRecord<string, string>
  readonly traceId: string
  readonly spanId: string
  readonly sampled: boolean
}

Source

Since v1.0.0

PartialEncoded (interface)

Signature

export interface PartialEncoded {
  readonly _tag: "Request"
  readonly requestId: Snowflake
  readonly address: EntityAddress
  readonly tag: string
  readonly payload: unknown
  readonly headers: Headers.Headers
  readonly traceId: string
  readonly spanId: string
  readonly sampled: boolean
}

Source

Since v1.0.0

Any (type alias)

Signature

type Any = Request<any>

Source

Since v1.0.0