UNPKG

picorpc

Version:

A tiny RPC library and spec, inspired by JSON-RPC 2.0 and tRPC.

20 lines (19 loc) 1.11 kB
declare const attempt: <T, U>(fn: () => T, fallback: U) => T | U; declare const castError: (exception: unknown) => Error & { code?: unknown; data?: unknown; }; declare const identity: <T>(value: T) => T; declare const isArray: (value: unknown) => value is unknown[]; declare const isError: (value: unknown) => value is Error; declare const isFinite: (value: unknown) => value is number; declare const isFunction: (value: unknown) => value is Function; declare const isInteger: (value: unknown) => value is number; declare const isNumber: (value: unknown) => value is number; declare const isObject: (value: unknown) => value is object; declare const isString: (value: unknown) => value is string; declare const isUndefined: (value: unknown) => value is undefined; declare const isVersionCompatible: (version: string, supported: string) => boolean; declare const noop: () => void; declare const rethrow: (exception: unknown) => never; export { attempt, castError, identity, isArray, isError, isFinite, isFunction, isInteger, isNumber, isObject, isString, isUndefined, isVersionCompatible, noop, rethrow };