Skip to content

Commit

Permalink
Moved unnecessary stuff out of index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Amelixx committed Jan 12, 2022
1 parent 1caa008 commit 11a7c58
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amelix/phoenix.js",
"version": "1.0.0",
"version": "1.0.1",
"description": "A feature-rich API wrapper for the critically acclaimed chatting app Phoenix.. or something.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion src/classes/Client.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import * as https from 'https'

import { io, Socket } from "socket.io-client";
import { apiPath, defaultIcon, hostname, PhoenixResponse } from "..";
import { apiPath, defaultIcon, hostname } from "../config";
import { AnyChannel } from "./Channel";
import ClientUser from "./ClientUser";
import DeletedUser from "./DeletedUser";
import EventEmitter from "./EventEmitter";
import Invite from "./Invite";
import Member from "./Member";
import Message from "./Message";
import PhoenixResponse from './PhoenixResponse'
import Server from "./Server";
import ServerChannel from "./ServerChannel";
import TextChannel from "./TextChannel";
Expand Down
2 changes: 1 addition & 1 deletion src/classes/DeletedUser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defaultIcon } from "..";
import { defaultIcon } from "../config";
import { Client } from "./Client";
import User from "./User";

Expand Down
2 changes: 1 addition & 1 deletion src/classes/Message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hostname } from "..";
import { hostname } from "../config";
import Base from "./Base";
import { Client } from "./Client";
import Invite from "./Invite";
Expand Down
10 changes: 10 additions & 0 deletions src/classes/PhoenixResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { IncomingMessage } from "http"

export default class PhoenixResponse<T> {
res: IncomingMessage
body: T
constructor(res: IncomingMessage, body: any) {
this.res = res
this.body = body
}
}
2 changes: 1 addition & 1 deletion src/classes/Server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { apiPath, defaultIcon, hostname } from "..";
import { apiPath, defaultIcon, hostname } from "../config";
import Base from "./Base";
import { Client } from "./Client";
import Member from "./Member";
Expand Down
2 changes: 1 addition & 1 deletion src/classes/TextChannel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { messageQueryLimit } from "..";
import { messageQueryLimit } from "../config";
import { Client } from "./Client";
import Message from "./Message";
import ServerChannel from "./ServerChannel";
Expand Down
2 changes: 1 addition & 1 deletion src/classes/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Client } from "./Client";
import Server from "./Server";

import DeletedUser from "./DeletedUser";
import { apiPath, defaultIcon, hostname } from "..";
import { apiPath, defaultIcon, hostname } from "../config";

export type AnyUser = User | DeletedUser

Expand Down
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const hostname = "phoenix.amelix.xyz"
export const apiPath = ""
export const defaultIcon = 'https://' + hostname + '/avatars/default'
export const messageQueryLimit = 150
28 changes: 6 additions & 22 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import { IncomingMessage } from 'http'

export const hostname = "phoenix.amelix.xyz"
export const apiPath = ""
export const defaultIcon = 'https://' + hostname + '/avatars/default'
export const messageQueryLimit = 150

import Base from './classes/Base'
import Channel from './classes/Channel'
import { Client } from './classes/Client'
Expand All @@ -20,24 +13,15 @@ import User from './classes/User'

export {
Base,
Channel,
Client,
Server,
Channel,
ServerChannel,
TextChannel,
ClientUser,
User,
DeletedUser,
Invite,
Member,
Message,
Server,
ServerChannel,
TextChannel,
User
}

export class PhoenixResponse<T> {
res: IncomingMessage
body: T
constructor(res: IncomingMessage, body: any) {
this.res = res
this.body = body
}
Invite,
}

0 comments on commit 11a7c58

Please sign in to comment.