From 9a9bc4b89d2088499f9273672d6b12108f2d5566 Mon Sep 17 00:00:00 2001 From: 0xLogN Date: Sun, 19 Feb 2023 06:57:06 -0800 Subject: [PATCH] repo: re-add missing exports because docs link to them --- src/index.ts | 7 ++++--- src/stream/{directstream.ts => DirectStream.ts} | 0 src/stream/controlCharacters.ts | 1 + src/tests/stream/index.test.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) rename src/stream/{directstream.ts => DirectStream.ts} (100%) diff --git a/src/index.ts b/src/index.ts index be43f63..0bf1a01 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,7 +17,8 @@ */ import SafeEventEmitter from "./lib/SafeEventEmitter.js"; -import { ControlCharacters } from "./stream/controlCharacters.js"; -import DirectStream, { DirectStreamEventArguments, DirectStreamEvents } from "./stream/directstream.js"; +import { bytes, kb, mb } from "./lib/sizeHelpers.js"; +import { ControlCharacters, SizedControlCharacters } from "./stream/controlCharacters.js"; +import DirectStream, { DirectStreamEventArguments, DirectStreamEvents } from "./stream/DirectStream.js"; -export { ControlCharacters, DirectStream, DirectStreamEventArguments, DirectStreamEvents, SafeEventEmitter }; +export { bytes, ControlCharacters, DirectStream, DirectStreamEventArguments, DirectStreamEvents, kb, mb, SafeEventEmitter, SizedControlCharacters }; diff --git a/src/stream/directstream.ts b/src/stream/DirectStream.ts similarity index 100% rename from src/stream/directstream.ts rename to src/stream/DirectStream.ts diff --git a/src/stream/controlCharacters.ts b/src/stream/controlCharacters.ts index caab324..3f7c575 100644 --- a/src/stream/controlCharacters.ts +++ b/src/stream/controlCharacters.ts @@ -43,6 +43,7 @@ enum ControlCharacters { /** **Read Reset**: Invalidates any data before this (if possible) and resets */ ReadReset = 0x18 } +/** All {@link ControlCharacters} with a size argument */ type SizedControlCharacters = | ControlCharacters.ReadBytes | ControlCharacters.ReadKB diff --git a/src/tests/stream/index.test.ts b/src/tests/stream/index.test.ts index 263d507..475b58d 100644 --- a/src/tests/stream/index.test.ts +++ b/src/tests/stream/index.test.ts @@ -18,7 +18,7 @@ import { kb, mb } from "../../lib/sizeHelpers"; import { ControlCharacters } from "../../stream/controlCharacters"; -import DirectStream, { DirectStreamEvents } from "../../stream/directstream"; +import DirectStream, { DirectStreamEvents } from "../../stream/DirectStream"; /** Makes a new {@link DirectStream} and attaches listeners. */ function makeNewStream(): { stream: DirectStream; onRead: jest.Mock; onPacket: jest.Mock; onReset: jest.Mock } {