From a1549523fbc680c96b647e80624fb7720f3af87e Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 31 Aug 2023 03:49:01 -0400 Subject: [PATCH] refactor: update exports and add factory for S5Node --- src/index.ts | 10 ++++++++-- src/node.ts | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 1de305c..bcb4a36 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,9 @@ +import { S5Node } from "#node.js"; +import type { S5NodeConfig } from "#node.js"; + export * from "./types.js"; -export * from "./service/p2p.js"; -export * from "./service/registry.js"; +export type { S5NodeConfig }; + +export function createNode(config: S5NodeConfig) { + return new S5Node(config); +} diff --git a/src/node.ts b/src/node.ts index 1e94177..396aa4e 100644 --- a/src/node.ts +++ b/src/node.ts @@ -26,7 +26,7 @@ const DEFAULT_LOGGER = { }, }; -interface S5NodeConfig { +export interface S5NodeConfig { p2p?: { network: string; peers?: {