Skip to content

Commit

Permalink
Update type defs
Browse files Browse the repository at this point in the history
  • Loading branch information
larabr committed May 23, 2022
1 parent 9517429 commit d055fae
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions openpgp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ export abstract class Key {

type AllowedKeyPackets = PublicKeyPacket | PublicSubkeyPacket | SecretKeyPacket | SecretSubkeyPacket | UserIDPacket | UserAttributePacket | SignaturePacket;
export class PublicKey extends Key {
constructor(packetlist: PacketList<AnyKeyPacket>);
constructor(packetlist: PacketList<AnyPacket>);
}

export class PrivateKey extends PublicKey {
constructor(packetlist: PacketList<AnyKeyPacket>);
constructor(packetlist: PacketList<AnyPacket>);
public revoke(reason?: ReasonForRevocation, date?: Date, config?: Config): Promise<PrivateKey>;
public isDecrypted(): boolean;
public addSubkey(options: SubkeyOptions): Promise<PrivateKey>;
Expand Down Expand Up @@ -527,7 +527,12 @@ export class TrustPacket extends BasePacket {
static readonly tag: enums.packet.trust;
}

export type AnyPacket = BasePacket;
export class UnparsablePacket {
tag: enums.packet;
write: () => Uint8Array;
}

export type AnyPacket = BasePacket | UnparsablePacket;
export type AnySecretKeyPacket = SecretKeyPacket | SecretSubkeyPacket;
export type AnyKeyPacket = BasePublicKeyPacket;

Expand Down

0 comments on commit d055fae

Please sign in to comment.