fix: export `Encoder` and `Decoder` types

Enables API consumer to use the types.
This commit is contained in:
fryorcraken.eth 2022-12-20 13:51:22 +11:00
parent 26b9d04912
commit bff9b857ec
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
3 changed files with 8 additions and 4 deletions

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Changed
- Export `Encoder` and `Decoder` types.
## [0.0.7] - 2022-12-19 ## [0.0.7] - 2022-12-19
### Fixed ### Fixed

View File

@ -27,7 +27,7 @@ export { DecodedMessage, generatePrivateKey, getPublicKey };
const log = debug("waku:message-encryption:ecies"); const log = debug("waku:message-encryption:ecies");
class Encoder implements IEncoder { export class Encoder implements IEncoder {
constructor( constructor(
public contentTopic: string, public contentTopic: string,
private publicKey: Uint8Array, private publicKey: Uint8Array,
@ -90,7 +90,7 @@ export function createEncoder(
return new Encoder(contentTopic, publicKey, sigPrivKey, ephemeral); return new Encoder(contentTopic, publicKey, sigPrivKey, ephemeral);
} }
class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> { export class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> {
constructor(contentTopic: string, private privateKey: Uint8Array) { constructor(contentTopic: string, private privateKey: Uint8Array) {
super(contentTopic); super(contentTopic);
} }

View File

@ -26,7 +26,7 @@ export { DecodedMessage, generateSymmetricKey };
const log = debug("waku:message-encryption:symmetric"); const log = debug("waku:message-encryption:symmetric");
class Encoder implements IEncoder { export class Encoder implements IEncoder {
constructor( constructor(
public contentTopic: string, public contentTopic: string,
private symKey: Uint8Array, private symKey: Uint8Array,
@ -88,7 +88,7 @@ export function createEncoder(
return new Encoder(contentTopic, symKey, sigPrivKey, ephemeral); return new Encoder(contentTopic, symKey, sigPrivKey, ephemeral);
} }
class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> { export class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> {
constructor(contentTopic: string, private symKey: Uint8Array) { constructor(contentTopic: string, private symKey: Uint8Array) {
super(contentTopic); super(contentTopic);
} }