Thanks to visit codestin.com
Credit goes to effect-ts.github.io

Skip to main content Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

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 | undefined
  readonly spanId?: string | undefined
  readonly sampled?: boolean | undefined
}) => 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 | undefined
  readonly spanId?: string | undefined
  readonly sampled?: boolean | undefined
}

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

primaryKeyByAddress

Signature

declare const primaryKeyByAddress: (options: {
  readonly address: EntityAddress
  readonly tag: string
  readonly id: string
}) => string

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, never>

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: Schema.optional<typeof Schema.String>
      spanId: Schema.optional<typeof Schema.String>
      sampled: Schema.optional<typeof Schema.Boolean>
    }>,
    typeof AckChunk,
    typeof Interrupt
  ]
>

Source

Since v1.0.0

PartialEncodedArray

Signature

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

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: Schema.optional<typeof Schema.String>
      spanId: Schema.optional<typeof Schema.String>
      sampled: Schema.optional<typeof Schema.Boolean>
    }>,
    Schema.Schema<AckChunk, AckChunk, never>,
    Schema.Schema<Interrupt, Interrupt, never>
  ]
>

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: Schema.optional<typeof Schema.String>
  spanId: Schema.optional<typeof Schema.String>
  sampled: Schema.optional<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: Schema.optional<typeof Schema.String>
  spanId: Schema.optional<typeof Schema.String>
  sampled: Schema.optional<typeof Schema.Boolean>
}>

Source

Since v1.0.0

RequestFromSelf

Signature

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

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 | undefined
  readonly spanId?: string | undefined
  readonly sampled?: boolean | undefined
}

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 | undefined
  readonly spanId?: string | undefined
  readonly sampled?: boolean | undefined
}

Source

Since v1.0.0

Any (type alias)

Signature

type Any = Request<any>

Source

Since v1.0.0