mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
Add constructor documentation
This commit is contained in:
@@ -14,5 +14,6 @@ module.exports = {
|
||||
"no-param-reassign": 0,
|
||||
"consistent-return": 0,
|
||||
"import/no-extraneous-dependencies": 0,
|
||||
"no-continue": 0,
|
||||
}
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -51,14 +51,16 @@ function cleanPaths() {
|
||||
}
|
||||
}
|
||||
|
||||
function clean() {
|
||||
function firstPass() {
|
||||
const cleaned = {
|
||||
classes: {},
|
||||
interfaces: {},
|
||||
typedefs: {},
|
||||
};
|
||||
for (const item of json) {
|
||||
for (const itemID in json) {
|
||||
const item = json[itemID];
|
||||
if (item.kind === 'class') {
|
||||
delete json[itemID];
|
||||
cleaned.classes[item.longname] = {
|
||||
meta: item,
|
||||
functions: [],
|
||||
@@ -66,13 +68,25 @@ function clean() {
|
||||
events: [],
|
||||
};
|
||||
} else if (item.kind === 'interface') {
|
||||
delete json[itemID];
|
||||
cleaned.interfaces[item.longname] = {
|
||||
meta: item,
|
||||
functions: [],
|
||||
properties: [],
|
||||
events: [],
|
||||
};
|
||||
} else if (item.kind === 'member') {
|
||||
}
|
||||
}
|
||||
return cleaned;
|
||||
}
|
||||
|
||||
function clean() {
|
||||
const cleaned = firstPass();
|
||||
for (const item of json) {
|
||||
if (!item) {
|
||||
continue;
|
||||
}
|
||||
if (item.kind === 'member') {
|
||||
const obj = cleaned.classes[item.memberof] || cleaned.interfaces[item.memberof];
|
||||
const newTypes = [];
|
||||
for (const name of item.type.names) {
|
||||
@@ -97,6 +111,9 @@ function clean() {
|
||||
obj.functions.push(item);
|
||||
} else if (item.kind === 'typedef') {
|
||||
cleaned.typedefs[item.longname] = item;
|
||||
} else if (item.kind === 'constructor') {
|
||||
const obj = cleaned.classes[item.memberof] || cleaned.interfaces[item.memberof];
|
||||
obj.constructor = item;
|
||||
}
|
||||
}
|
||||
json = cleaned;
|
||||
|
||||
@@ -17,6 +17,10 @@ const ActionsManager = require('./actions/ActionsManager');
|
||||
*/
|
||||
class Client extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Creates an instance of Client.
|
||||
* @param {Object} [options] options to pass to the client
|
||||
*/
|
||||
constructor(options) {
|
||||
super();
|
||||
this.options = mergeDefault(Constants.DefaultOptions, options);
|
||||
|
||||
Reference in New Issue
Block a user