From 255926ab19ee8b53abda5a01269cf4b1349ece7b Mon Sep 17 00:00:00 2001 From: Ivan Pizhenko <11859904+IvanPizhenko@users.noreply.github.com> Date: Thu, 10 Feb 2022 22:13:34 +0200 Subject: [PATCH] TypeScript: mark `signature` arg as optional in `Key.isRevoked()` and remove `SignaturePacket.verified` (#1486) --- openpgp.d.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openpgp.d.ts b/openpgp.d.ts index c1b7bc831..4f7258604 100644 --- a/openpgp.d.ts +++ b/openpgp.d.ts @@ -1,6 +1,6 @@ /** * Type definitions for OpenPGP.js http://openpgpjs.org/ - * + * * Contributors: * - FlowCrypt a. s. * - Guillaume Lacasa @@ -57,7 +57,7 @@ export abstract class Key { public verifyPrimaryKey(date?: Date, userID?: UserID, config?: Config): Promise; // throws on error public verifyPrimaryUser(publicKeys: PublicKey[], date?: Date, userIDs?: UserID, config?: Config): Promise<{ keyID: KeyID, valid: boolean | null }[]>; public verifyAllUsers(publicKeys: PublicKey[], date?: Date, config?: Config): Promise<{ userID: string, keyID: KeyID, valid: boolean | null }[]>; - public isRevoked(signature: SignaturePacket, key?: AnyKeyPacket, date?: Date, config?: Config): Promise; + public isRevoked(signature?: SignaturePacket, key?: AnyKeyPacket, date?: Date, config?: Config): Promise; public getRevocationCertificate(date?: Date, config?: Config): Promise | undefined>; public getEncryptionKey(keyID?: KeyID, date?: Date | null, userID?: UserID, config?: Config): Promise; public getSigningKey(keyID?: KeyID, date?: Date | null, userID?: UserID, config?: Config): Promise; @@ -171,13 +171,13 @@ export class CleartextMessage { /* ############## v5 MSG #################### */ export function generateSessionKey(options: { encryptionKeys: MaybeArray, date?: Date, encryptionUserIDs?: MaybeArray, config?: PartialConfig }): Promise; -export function encryptSessionKey(options: SessionKey & { +export function encryptSessionKey(options: SessionKey & { encryptionKeys?: MaybeArray, passwords?: MaybeArray, format?: 'armored', wildcard?: boolean, encryptionKeyIDs?: MaybeArray, date?: Date, encryptionUserIDs?: MaybeArray, config?: PartialConfig }) : Promise; -export function encryptSessionKey(options: SessionKey & { +export function encryptSessionKey(options: SessionKey & { encryptionKeys?: MaybeArray, passwords?: MaybeArray, format: 'binary', wildcard?: boolean, encryptionKeyIDs?: MaybeArray, date?: Date, encryptionUserIDs?: MaybeArray, config?: PartialConfig }) : Promise; -export function encryptSessionKey(options: SessionKey & { +export function encryptSessionKey(options: SessionKey & { encryptionKeys?: MaybeArray, passwords?: MaybeArray, format: 'object', wildcard?: boolean, encryptionKeyIDs?: MaybeArray, date?: Date, encryptionUserIDs?: MaybeArray, config?: PartialConfig }) : Promise>; export function decryptSessionKeys>(options: { message: Message, decryptionKeys?: MaybeArray, passwords?: MaybeArray, date?: Date, config?: PartialConfig }): Promise; @@ -520,7 +520,6 @@ export class SignaturePacket extends BasePacket { public issuerKeyVersion: null | number; public issuerFingerprint: null | Uint8Array; public preferredAEADAlgorithms: enums.aead[] | null; - public verified: null | boolean; public revoked: null | boolean; public sign(key: AnySecretKeyPacket, data: Uint8Array, date?: Date, detached?: boolean): Promise; public verify(key: AnyKeyPacket, signatureType: enums.signature, data: Uint8Array, date?: Date, detached?: boolean, config?: Config): Promise; // throws on error