Options
All
  • Public
  • Public/Protected
  • All
Menu

Tiny RPC

Original idea from wenerme/tinyrpc

Links

Index

Type aliases

Fetch

Fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>

Type declaration

    • (input: RequestInfo, init?: RequestInit): Promise<Response>
    • Parameters

      • input: RequestInfo
      • Optional init: RequestInit

      Returns Promise<Response>

ProxyInvokeHandler

ProxyInvokeHandler: (ctx: ProxyContext, method: string, args: any[]) => any

Type declaration

    • (ctx: ProxyContext, method: string, args: any[]): any
    • Parameters

      • ctx: ProxyContext
      • method: string
      • args: any[]

      Returns any

ServiceInvocationHandler

ServiceInvocationHandler: (req: ServiceInvocation) => Promise<ServiceResponse>

Type declaration

Variables

Const GlobalRegistry

GlobalRegistry: ServiceRegistry = new ServiceRegistry()

Const ProxyTargetSymbol

ProxyTargetSymbol: unique symbol = Symbol('ProxyTarget')

Functions

consumeService

  • Type parameters

    • T: object

    Parameters

    Returns T

createFetchConsumer

  • createFetchConsumer<T>(__namedParameters: { maybeFetch: undefined | ((input: RequestInfo, init?: RequestInit) => Promise<Response>); url: string }): ServiceInvocationHandler
  • Type parameters

    • T

    Parameters

    • __namedParameters: { maybeFetch: undefined | ((input: RequestInfo, init?: RequestInit) => Promise<Response>); url: string }
      • maybeFetch: undefined | ((input: RequestInfo, init?: RequestInit) => Promise<Response>)
      • url: string

    Returns ServiceInvocationHandler

createInvoker

createProxy

  • Type parameters

    • T: object

    Parameters

    Returns T

createServiceConsumer

createServiceDefinition

  • createServiceDefinition(__namedParameters: { excludes: any[]; includes: any[]; name: string; prototype: any; provider: any; target: any }): ServiceDefinition
  • Parameters

    • __namedParameters: { excludes: any[]; includes: any[]; name: string; prototype: any; provider: any; target: any }
      • excludes: any[]
      • includes: any[]
      • name: string
      • prototype: any
      • provider: any
      • target: any

    Returns ServiceDefinition

Object literals

Const JsonRpcErrors

JsonRpcErrors: object

InternalError

InternalError: object

code

code: number = -32603

message

message: string = "Internal error"

InvalidParams

InvalidParams: object

code

code: number = -32602

message

message: string = "Invalid params"

InvalidRequest

InvalidRequest: object

code

code: number = -32600

message

message: string = "Invalid Request"

MethodNotFound

MethodNotFound: object

code

code: number = -32601

message

message: string = "Method not found"

ParseError

ParseError: object

code

code: number = -32700

message

message: string = "Parse error"

ServerError

ServerError: object

code

code: number = -32000

message

message: string = "Server error"

Legend

  • Property
  • Method
  • Property
  • Method
  • Static property

Generated using TypeDoc