fix: tsconfig to generate optionals correctly

This commit is contained in:
Irakli Gozalishvili
2020-11-30 16:55:33 -08:00
parent f2d6a76dcf
commit 3143efd7c1
6 changed files with 41 additions and 36 deletions

14
src/pubsub/index.d.ts vendored
View File

@ -34,9 +34,9 @@ declare class PubsubBaseProtocol {
globalSignaturePolicy: {
StrictSign: "StrictSign";
StrictNoSign: string;
};
canRelayMessage: boolean;
emitSelf: boolean;
} | undefined;
canRelayMessage: boolean | undefined;
emitSelf: boolean | undefined;
});
log: any;
/**
@ -285,13 +285,13 @@ declare namespace PubsubBaseProtocol {
}
type PeerId = import("peer-id");
type InMessage = {
from?: string;
from?: string | undefined;
receivedFrom: string;
topicIDs: string[];
seqno?: Uint8Array;
seqno?: Uint8Array | undefined;
data: Uint8Array;
signature?: Uint8Array;
key?: Uint8Array;
signature?: Uint8Array | undefined;
key?: Uint8Array | undefined;
};
import PeerStreams = require("./peer-streams");
/**

12
src/pubsub/utils.d.ts vendored
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 unknown>(message: T, peerId?: string): T & {
from?: string;
peerId?: string;
export function normalizeInRpcMessage<T extends Object>(message: T, peerId?: string | undefined): T & {
from?: string | undefined;
peerId?: string | undefined;
};
export function normalizeOutRpcMessage<T extends unknown>(message: T): T & {
from?: Uint8Array;
data?: Uint8Array;
export function normalizeOutRpcMessage<T extends Object>(message: T): T & {
from?: Uint8Array | undefined;
data?: Uint8Array | undefined;
};