mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
docs: describe private properties (#8879)
* feat: describe private properties * Update packages/discord.js/src/structures/GuildMember.js Co-authored-by: MrMythicalYT <91077061+MrMythicalYT@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: MrMythicalYT <91077061+MrMythicalYT@users.noreply.github.com> * Apply suggestions from code review --------- Co-authored-by: MrMythicalYT <91077061+MrMythicalYT@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,13 @@ class CachedManager extends DataManager {
|
||||
constructor(client, holds, iterable) {
|
||||
super(client, holds);
|
||||
|
||||
/**
|
||||
* The private cache of items for this manager.
|
||||
* @type {Collection}
|
||||
* @private
|
||||
* @readonly
|
||||
* @name CachedManager#_cache
|
||||
*/
|
||||
Object.defineProperty(this, '_cache', { value: this.client.options.makeCache(this.constructor, this.holds) });
|
||||
|
||||
if (iterable) {
|
||||
|
||||
@@ -54,6 +54,11 @@ class GuildMember extends Base {
|
||||
*/
|
||||
this.communicationDisabledUntilTimestamp = null;
|
||||
|
||||
/**
|
||||
* The role ids of the member
|
||||
* @type {Snowflake[]}
|
||||
* @private
|
||||
*/
|
||||
this._roles = [];
|
||||
if (data) this._patch(data);
|
||||
}
|
||||
|
||||
@@ -141,6 +141,12 @@ class Presence extends Base {
|
||||
*/
|
||||
class Activity {
|
||||
constructor(presence, data) {
|
||||
/**
|
||||
* The presence of the Activity
|
||||
* @type {Presence}
|
||||
* @readonly
|
||||
* @name Activity#presence
|
||||
*/
|
||||
Object.defineProperty(this, 'presence', { value: presence });
|
||||
|
||||
/**
|
||||
@@ -287,6 +293,12 @@ class Activity {
|
||||
*/
|
||||
class RichPresenceAssets {
|
||||
constructor(activity, assets) {
|
||||
/**
|
||||
* The activity of the RichPresenceAssets
|
||||
* @type {Activity}
|
||||
* @readonly
|
||||
* @name RichPresenceAssets#activity
|
||||
*/
|
||||
Object.defineProperty(this, 'activity', { value: activity });
|
||||
|
||||
/**
|
||||
|
||||
4
packages/discord.js/typings/index.d.ts
vendored
4
packages/discord.js/typings/index.d.ts
vendored
@@ -236,6 +236,7 @@ declare module 'node:events' {
|
||||
|
||||
export class Activity {
|
||||
private constructor(presence: Presence, data?: RawActivityData);
|
||||
public readonly presence: Presence;
|
||||
public applicationId: Snowflake | null;
|
||||
public assets: RichPresenceAssets | null;
|
||||
public buttons: string[];
|
||||
@@ -1505,6 +1506,7 @@ export class GuildMemberFlagsBitField extends BitField<GuildMemberFlagsString> {
|
||||
|
||||
export class GuildMember extends PartialTextBasedChannel(Base) {
|
||||
private constructor(client: Client<true>, data: RawGuildMemberData, guild: Guild);
|
||||
private _roles: Snowflake[];
|
||||
public avatar: string | null;
|
||||
public get bannable(): boolean;
|
||||
public get dmChannel(): DMChannel | null;
|
||||
@@ -2442,6 +2444,7 @@ export class ReactionEmoji extends Emoji {
|
||||
|
||||
export class RichPresenceAssets {
|
||||
private constructor(activity: Activity, assets: RawRichPresenceAssets);
|
||||
public readonly activity: Activity;
|
||||
public largeImage: Snowflake | null;
|
||||
public largeText: string | null;
|
||||
public smallImage: Snowflake | null;
|
||||
@@ -3678,6 +3681,7 @@ export abstract class DataManager<K, Holds, R> extends BaseManager {
|
||||
|
||||
export abstract class CachedManager<K, Holds, R> extends DataManager<K, Holds, R> {
|
||||
protected constructor(client: Client<true>, holds: Constructable<Holds>);
|
||||
private readonly _cache: Collection<K, Holds>;
|
||||
private _add(data: unknown, cache?: boolean, { id, extras }?: { id: K; extras: unknown[] }): Holds;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user