Improve Typescript typing
This commit is contained in:
parent
dbd8a44fa2
commit
b5d68376b5
1 changed files with 13 additions and 3 deletions
16
javascript/index.d.ts
vendored
16
javascript/index.d.ts
vendored
|
@ -51,7 +51,10 @@ declare class Session {
|
||||||
has_received_message(): boolean;
|
has_received_message(): boolean;
|
||||||
matches_inbound(one_time_key_message: string): boolean;
|
matches_inbound(one_time_key_message: string): boolean;
|
||||||
matches_inbound_from(identity_key: string, one_time_key_message: string): boolean;
|
matches_inbound_from(identity_key: string, one_time_key_message: string): boolean;
|
||||||
encrypt(plaintext: string): object;
|
encrypt(plaintext: string): {
|
||||||
|
type: 0 | 1; // 0: PreKey, 1: Message
|
||||||
|
body: string;
|
||||||
|
};
|
||||||
decrypt(message_type: number, message: string): string;
|
decrypt(message_type: number, message: string): string;
|
||||||
describe(): string;
|
describe(): string;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +73,10 @@ declare class InboundGroupSession {
|
||||||
unpickle(key: string | Uint8Array, pickle: string): void;
|
unpickle(key: string | Uint8Array, pickle: string): void;
|
||||||
create(session_key: string): string;
|
create(session_key: string): string;
|
||||||
import_session(session_key: string): string;
|
import_session(session_key: string): string;
|
||||||
decrypt(message: string): object;
|
decrypt(message: string): {
|
||||||
|
message_index: string;
|
||||||
|
plaintext: string;
|
||||||
|
};
|
||||||
session_id(): string;
|
session_id(): string;
|
||||||
first_known_index(): number;
|
first_known_index(): number;
|
||||||
export_session(message_index: number): string;
|
export_session(message_index: number): string;
|
||||||
|
@ -92,7 +98,11 @@ declare class PkEncryption {
|
||||||
constructor();
|
constructor();
|
||||||
free(): void;
|
free(): void;
|
||||||
set_recipient_key(key: string): void;
|
set_recipient_key(key: string): void;
|
||||||
encrypt(plaintext: string): object;
|
encrypt(plaintext: string): {
|
||||||
|
ciphertext: string;
|
||||||
|
mac: string;
|
||||||
|
ephemeral: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
declare class PkDecryption {
|
declare class PkDecryption {
|
||||||
|
|
Loading…
Reference in a new issue