fix: optional fields

This commit is contained in:
Irakli Gozalishvili
2020-11-30 22:22:28 -08:00
parent b7f10727d6
commit 7fd26cf6b9
7 changed files with 94 additions and 52 deletions

View File

@ -3,11 +3,11 @@ export function msgId(from: string, seqno: Uint8Array): Uint8Array;
export function noSignMsgId(data: Uint8Array): Uint8Array;
export function anyMatch(a: Set<any> | any[], b: Set<any> | any[]): boolean;
export function ensureArray<T>(maybeArray: T | T[]): T[];
export function normalizeInRpcMessage<T extends Object>(message: T, peerId?: string | undefined): T & {
export function normalizeInRpcMessage<T extends unknown>(message: T, peerId?: string | undefined): T & {
from?: string | undefined;
peerId?: string | undefined;
};
export function normalizeOutRpcMessage<T extends Object>(message: T): T & {
export function normalizeOutRpcMessage<T extends unknown>(message: T): T & {
from?: Uint8Array | undefined;
data?: Uint8Array | undefined;
};