mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 17:24:44 +12:00
Properly export constants using named exports - v8 (#871)
* Properly export constants so they can be imported using named imports which are present throughout the lib. * run grunt
This commit is contained in:
parent
af0663e915
commit
780cbadd79
2 changed files with 12 additions and 8 deletions
|
@ -4,8 +4,10 @@ exports.__esModule = true;
|
||||||
var Constants = {};
|
var Constants = {};
|
||||||
|
|
||||||
var API = Constants.API = "https://discordapp.com/api";
|
var API = Constants.API = "https://discordapp.com/api";
|
||||||
|
exports.API = API;
|
||||||
var CDN = Constants.CDN = "https://cdn.discordapp.com";
|
var CDN = Constants.CDN = "https://cdn.discordapp.com";
|
||||||
|
|
||||||
|
exports.CDN = CDN;
|
||||||
var Endpoints = Constants.Endpoints = {
|
var Endpoints = Constants.Endpoints = {
|
||||||
// general endpoints
|
// general endpoints
|
||||||
LOGIN: API + "/auth/login",
|
LOGIN: API + "/auth/login",
|
||||||
|
@ -117,7 +119,8 @@ var Endpoints = Constants.Endpoints = {
|
||||||
FRIENDS: API + "/users/@me/relationships"
|
FRIENDS: API + "/users/@me/relationships"
|
||||||
};
|
};
|
||||||
|
|
||||||
Constants.Permissions = {
|
exports.Endpoints = Endpoints;
|
||||||
|
var Permissions = Constants.Permissions = {
|
||||||
// general
|
// general
|
||||||
createInstantInvite: 1 << 0,
|
createInstantInvite: 1 << 0,
|
||||||
kickMembers: 1 << 1,
|
kickMembers: 1 << 1,
|
||||||
|
@ -149,7 +152,8 @@ Constants.Permissions = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Constants.PacketType = {
|
exports.Permissions = Permissions;
|
||||||
|
var PacketType = Constants.PacketType = {
|
||||||
CHANNEL_CREATE: "CHANNEL_CREATE",
|
CHANNEL_CREATE: "CHANNEL_CREATE",
|
||||||
CHANNEL_DELETE: "CHANNEL_DELETE",
|
CHANNEL_DELETE: "CHANNEL_DELETE",
|
||||||
CHANNEL_UPDATE: "CHANNEL_UPDATE",
|
CHANNEL_UPDATE: "CHANNEL_UPDATE",
|
||||||
|
@ -181,5 +185,5 @@ Constants.PacketType = {
|
||||||
FRIEND_REMOVE: "RELATIONSHIP_REMOVE"
|
FRIEND_REMOVE: "RELATIONSHIP_REMOVE"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.PacketType = PacketType;
|
||||||
exports["default"] = Constants;
|
exports["default"] = Constants;
|
||||||
module.exports = exports["default"];
|
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
const Constants = {};
|
const Constants = {};
|
||||||
|
|
||||||
const API = Constants.API = "https://discordapp.com/api";
|
export const API = Constants.API = "https://discordapp.com/api";
|
||||||
const CDN = Constants.CDN = "https://cdn.discordapp.com";
|
export const CDN = Constants.CDN = "https://cdn.discordapp.com";
|
||||||
|
|
||||||
const Endpoints = Constants.Endpoints = {
|
export const Endpoints = Constants.Endpoints = {
|
||||||
// general endpoints
|
// general endpoints
|
||||||
LOGIN: `${API}/auth/login`,
|
LOGIN: `${API}/auth/login`,
|
||||||
LOGOUT: `${API}/auth/logout`,
|
LOGOUT: `${API}/auth/logout`,
|
||||||
|
@ -59,7 +59,7 @@ const Endpoints = Constants.Endpoints = {
|
||||||
FRIENDS: `${API}/users/@me/relationships`
|
FRIENDS: `${API}/users/@me/relationships`
|
||||||
};
|
};
|
||||||
|
|
||||||
Constants.Permissions = {
|
export const Permissions = Constants.Permissions = {
|
||||||
// general
|
// general
|
||||||
createInstantInvite: 1 << 0,
|
createInstantInvite: 1 << 0,
|
||||||
kickMembers: 1 << 1,
|
kickMembers: 1 << 1,
|
||||||
|
@ -91,7 +91,7 @@ Constants.Permissions = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Constants.PacketType = {
|
export const PacketType = Constants.PacketType = {
|
||||||
CHANNEL_CREATE : "CHANNEL_CREATE",
|
CHANNEL_CREATE : "CHANNEL_CREATE",
|
||||||
CHANNEL_DELETE : "CHANNEL_DELETE",
|
CHANNEL_DELETE : "CHANNEL_DELETE",
|
||||||
CHANNEL_UPDATE : "CHANNEL_UPDATE",
|
CHANNEL_UPDATE : "CHANNEL_UPDATE",
|
||||||
|
|
Loading…
Reference in a new issue