feat!: export user functions from package root

`createEncoder`, `createDecoder` and `DecodedMessage` are function/types
useful to the user so they should have easy access to it.

We still export `Decoder` and `Encoder` but in a path so it cam be
re-used by `@waku/message-encryption`.
This commit is contained in:
fryorcraken.eth 2022-11-23 16:33:12 +11:00
parent ad15f861c3
commit e8efd5e962
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
6 changed files with 11 additions and 19 deletions

View File

@ -4,6 +4,12 @@ export { DefaultUserAgent } from "./lib/waku.js";
export * as proto_message from "./proto/message.js";
export * as proto_topic_only_message from "./proto/topic_only_message.js";
export {
createEncoder,
createDecoder,
DecodedMessage,
} from "./lib/waku_message/version_0.js";
export * as waku from "./lib/waku.js";
export { WakuNode } from "./lib/waku.js";

View File

@ -1,10 +1,6 @@
import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils";
import { createDecoder, createEncoder, DecodedMessage } from "@waku/core";
import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer";
import {
createDecoder,
createEncoder,
DecodedMessage,
} from "@waku/core/lib/waku_message/version_0";
import { createLightNode } from "@waku/create";
import { Protocols, WakuLight } from "@waku/interfaces";
import {

View File

@ -1,9 +1,6 @@
import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils";
import { createDecoder, createEncoder } from "@waku/core";
import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer";
import {
createDecoder,
createEncoder,
} from "@waku/core/lib/waku_message/version_0";
import { createLightNode } from "@waku/create";
import type { DecodedMessage, WakuLight } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";

View File

@ -1,6 +1,6 @@
import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils";
import { createEncoder } from "@waku/core";
import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer";
import { createEncoder } from "@waku/core/lib/waku_message/version_0";
import { createLightNode } from "@waku/create";
import type { WakuLight } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";

View File

@ -1,12 +1,8 @@
import { PeerId } from "@libp2p/interface-peer-id";
import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils";
import { DefaultPubSubTopic } from "@waku/core";
import { createDecoder, createEncoder, DecodedMessage } from "@waku/core";
import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer";
import {
createDecoder,
createEncoder,
DecodedMessage,
} from "@waku/core/lib/waku_message/version_0";
import { createPrivacyNode } from "@waku/create";
import type { WakuPrivacy } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";

View File

@ -1,10 +1,7 @@
import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils";
import { createCursor, PageDirection } from "@waku/core";
import { createDecoder, createEncoder } from "@waku/core";
import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer";
import {
createDecoder,
createEncoder,
} from "@waku/core/lib/waku_message/version_0";
import { createLightNode } from "@waku/create";
import { DecodedMessage, Message, WakuLight } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";