Skip to content

Commit

Permalink
refactor: optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgloning committed Sep 2, 2023
1 parent 880c486 commit d43efa7
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/baseconnection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventEmitter, ValidEventTypes } from "eventemitter3";
import { EventEmitter, type ValidEventTypes } from "eventemitter3";
import type { Peer } from "./peer";
import type { ServerMessage } from "./servermessage";
import type { ConnectionType } from "./enums";
Expand Down
2 changes: 1 addition & 1 deletion lib/cborPeer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Peer, SerializerMapping } from "./peer";
import { Peer, type SerializerMapping } from "./peer";
import { Cbor } from "./dataconnection/StreamConnection/Cbor";

export class CborPeer extends Peer {
Expand Down
2 changes: 1 addition & 1 deletion lib/dataconnection/BufferedConnection/BinaryPack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import logger from "../../logger";
import type { Peer } from "../../peer";
import { BufferedConnection } from "./BufferedConnection";
import { SerializationType } from "../../enums";
import { type Packable, pack, unpack } from "peerjs-js-binarypack";
import { pack, type Packable, unpack } from "peerjs-js-binarypack";

export class BinaryPack extends BufferedConnection {
private readonly chunker = new BinaryPackChunker();
Expand Down
1 change: 1 addition & 0 deletions lib/dataconnection/BufferedConnection/Json.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BufferedConnection } from "./BufferedConnection";
import { SerializationType } from "../../enums";
import { util } from "../../util";

export class Json extends BufferedConnection {
readonly serialization = SerializationType.JSON;
private readonly encoder = new TextEncoder();
Expand Down
2 changes: 1 addition & 1 deletion lib/dataconnection/StreamConnection/Cbor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Peer } from "../../peer.js";
import { Encoder, Decoder } from "cbor-x";
import { Decoder, Encoder } from "cbor-x";
import { StreamConnection } from "./StreamConnection.js";

const NullValue = Symbol.for(null);
Expand Down
2 changes: 1 addition & 1 deletion lib/msgPackPeer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Peer, SerializerMapping } from "./peer";
import { Peer, type SerializerMapping } from "./peer";
import { MsgPack } from "./exports";

export class MsgPackPeer extends Peer {
Expand Down
4 changes: 2 additions & 2 deletions lib/peer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import type { DataConnection } from "./dataconnection/DataConnection";
import {
ConnectionType,
PeerErrorType,
SocketEventType,
ServerMessageType,
SocketEventType,
} from "./enums";
import type { ServerMessage } from "./servermessage";
import { API } from "./api";
import type {
CallOption,
PeerConnectOption,
PeerJSOption,
CallOption,
} from "./optionInterfaces";
import { BinaryPack } from "./dataconnection/BufferedConnection/BinaryPack";
import { Raw } from "./dataconnection/BufferedConnection/Raw";
Expand Down
2 changes: 1 addition & 1 deletion lib/socket.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EventEmitter } from "eventemitter3";
import logger from "./logger";
import { SocketEventType, ServerMessageType } from "./enums";
import { ServerMessageType, SocketEventType } from "./enums";
import { version } from "../package.json";

/**
Expand Down

0 comments on commit d43efa7

Please sign in to comment.