mirror of https://github.com/waku-org/js-waku.git
fix: export `Encoder` and `Decoder` types
Enables API consumer to use the types.
This commit is contained in:
parent
26b9d04912
commit
bff9b857ec
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue