Skip to content

Commit 914cc4b

Browse files
authored
fix(docs): some link tags didn't resolve correctly (discordjs#10269)
* fix(docs): some link tags didn't resolve in summaries * fix: add TextBasedChannels type
1 parent 393ded4 commit 914cc4b

File tree

14 files changed

+41
-37
lines changed

14 files changed

+41
-37
lines changed

apps/website/src/components/DocNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export async function DocNode({ node, version }: { readonly node?: any; readonly
3030
rel="external noreferrer noopener"
3131
target="_blank"
3232
>
33-
{node.text}
33+
{`${node.text}${node.members}`}
3434
</a>
3535
);
3636
}

packages/api-extractor-model/src/model/ModelReferenceResolver.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { type ApiItem, ApiItemKind } from '../items/ApiItem.js';
66
import { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin.js';
77
import { ApiParameterListMixin } from '../mixins/ApiParameterListMixin.js';
88
import type { ApiEntryPoint } from './ApiEntryPoint.js';
9+
import type { ApiMethod } from './ApiMethod.js';
910
import type { ApiModel } from './ApiModel.js';
1011
import type { ApiPackage } from './ApiPackage.js';
1112

@@ -119,6 +120,10 @@ export class ModelReferenceResolver {
119120
foundMembers.filter((member) => member.kind === ApiItemKind.Interface).length === foundMembers.length - 1
120121
) {
121122
currentItem = foundClass;
123+
} else if (
124+
foundMembers.every((member) => member.kind === ApiItemKind.Method && (member as ApiMethod).overloadIndex)
125+
) {
126+
currentItem = foundMembers.find((member) => (member as ApiMethod).overloadIndex === 1)!;
122127
} else {
123128
result.errorMessage = `The member reference ${JSON.stringify(identifier)} was ambiguous`;
124129
return result;

packages/discord.js/src/managers/GuildManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class GuildManager extends CachedManager {
9797
*/
9898

9999
/**
100-
* Resolves a GuildResolvable to a Guild object.
100+
* Resolves a {@link GuildResolvable} to a {@link Guild} object.
101101
* @method resolve
102102
* @memberof GuildManager
103103
* @instance

packages/discord.js/src/managers/GuildTextThreadManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class GuildTextThreadManager extends ThreadManager {
1717

1818
/**
1919
* Options for creating a thread. <warn>Only one of `startMessage` or `type` can be defined.</warn>
20-
* @typedef {StartThreadOptions} ThreadCreateOptions
20+
* @typedef {StartThreadOptions} GuildTextThreadCreateOptions
2121
* @property {MessageResolvable} [startMessage] The message to start a thread from.
2222
* <warn>If this is defined, then the `type` of thread gets inferred automatically and cannot be changed.</warn>
2323
* @property {ThreadChannelTypes} [type] The type of thread to create.
@@ -30,7 +30,7 @@ class GuildTextThreadManager extends ThreadManager {
3030

3131
/**
3232
* Creates a new thread in the channel.
33-
* @param {ThreadCreateOptions} [options] Options to create a new thread
33+
* @param {GuildTextThreadCreateOptions} [options] Options to create a new thread
3434
* @returns {Promise<ThreadChannel>}
3535
* @example
3636
* // Create a new public thread

packages/discord.js/src/managers/ThreadManager.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,6 @@ class ThreadManager extends CachedManager {
6363
* @returns {?Snowflake}
6464
*/
6565

66-
/**
67-
* Options for creating a thread. <warn>Only one of `startMessage` or `type` can be defined.</warn>
68-
* @typedef {StartThreadOptions} ThreadCreateOptions
69-
* @property {MessageResolvable} [startMessage] The message to start a thread from. <warn>If this is defined then type
70-
* of thread gets automatically defined and cannot be changed. The provided `type` field will be ignored</warn>
71-
* @property {ChannelType.AnnouncementThread|ChannelType.PublicThread|ChannelType.PrivateThread} [type]
72-
* The type of thread to create.
73-
* Defaults to {@link ChannelType.PublicThread} if created in a {@link TextChannel}
74-
* <warn>When creating threads in a {@link NewsChannel} this is ignored and is always
75-
* {@link ChannelType.AnnouncementThread}</warn>
76-
* @property {boolean} [invitable] Whether non-moderators can add other non-moderators to the thread
77-
* <info>Can only be set when type will be {@link ChannelType.PrivateThread}</info>
78-
*/
79-
8066
/**
8167
* Options for fetching multiple threads.
8268
* @typedef {Object} FetchThreadsOptions

packages/discord.js/src/sharding/ShardingManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ShardingManager extends EventEmitter {
2323
/**
2424
* The mode to spawn shards with for a {@link ShardingManager}. Can be either one of:
2525
* * 'process' to use child processes
26-
* * 'worker' to use [Worker threads](https://nodejs.org/api/worker_threads.html)
26+
* * 'worker' to use {@link Worker} threads
2727
* @typedef {string} ShardingManagerMode
2828
*/
2929

packages/discord.js/src/structures/Guild.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class Guild extends AnonymousGuild {
164164

165165
if ('large' in data) {
166166
/**
167-
* Whether the guild is "large" (has more than {@link WebsocketOptions large_threshold} members, 50 by default)
167+
* Whether the guild is "large" (has more than {@link WebSocketOptions large_threshold} members, 50 by default)
168168
* @type {boolean}
169169
*/
170170
this.large = Boolean(data.large);
@@ -291,7 +291,8 @@ class Guild extends AnonymousGuild {
291291
if ('max_presences' in data) {
292292
/**
293293
* The maximum amount of presences the guild can have (this is `null` for all but the largest of guilds)
294-
* <info>You will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter</info>
294+
* <info>You will need to fetch the guild using {@link BaseGuild#fetch} if you want to receive
295+
* this parameter</info>
295296
* @type {?number}
296297
*/
297298
this.maximumPresences = data.max_presences;
@@ -322,7 +323,8 @@ class Guild extends AnonymousGuild {
322323
if ('approximate_member_count' in data) {
323324
/**
324325
* The approximate amount of members the guild has
325-
* <info>You will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter</info>
326+
* <info>You will need to fetch the guild using {@link BaseGuild#fetch} if you want to receive
327+
* this parameter</info>
326328
* @type {?number}
327329
*/
328330
this.approximateMemberCount = data.approximate_member_count;
@@ -333,7 +335,8 @@ class Guild extends AnonymousGuild {
333335
if ('approximate_presence_count' in data) {
334336
/**
335337
* The approximate amount of presences the guild has
336-
* <info>You will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter</info>
338+
* <info>You will need to fetch the guild using {@link BaseGuild#fetch} if you want to receive
339+
* this parameter</info>
337340
* @type {?number}
338341
*/
339342
this.approximatePresenceCount = data.approximate_presence_count;

packages/discord.js/src/structures/GuildScheduledEvent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class GuildScheduledEvent extends Base {
229229

230230
/**
231231
* The time the guild scheduled event will start at
232-
* <info>This can be potentially `null` only when it's an {@link AuditLogEntryTarget}</info>
232+
* <info>This can be potentially `null` only when it's an {@link GuildAuditLogsEntry#target}</info>
233233
* @type {?Date}
234234
* @readonly
235235
*/

packages/discord.js/src/structures/PermissionOverwrites.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class PermissionOverwrites extends Base {
148148
*/
149149

150150
/**
151-
* Data that can be resolved into {@link RawOverwriteData}. This can be:
151+
* Data that can be resolved into {@link APIOverwrite}. This can be:
152152
* * PermissionOverwrites
153153
* * OverwriteData
154154
* @typedef {PermissionOverwrites|OverwriteData} OverwriteResolvable
@@ -164,7 +164,7 @@ class PermissionOverwrites extends Base {
164164
*/
165165

166166
/**
167-
* Resolves an overwrite into {@link RawOverwriteData}.
167+
* Resolves an overwrite into {@link APIOverwrite}.
168168
* @param {OverwriteResolvable} overwrite The overwrite-like data to resolve
169169
* @param {Guild} [guild] The guild to resolve from
170170
* @returns {RawOverwriteData}

packages/discord.js/src/structures/ReactionCollector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class ReactionCollector extends Collector {
8181
this.on('collect', (reaction, user) => {
8282
/**
8383
* Emitted whenever a reaction is newly created on a message. Will emit only when a new reaction is
84-
* added to the message, as opposed to {@link Collector#collect} which will
84+
* added to the message, as opposed to {@link Collector#event:collect} which will
8585
* be emitted even when a reaction has already been added to the message.
8686
* @event ReactionCollector#create
8787
* @param {MessageReaction} reaction The reaction that was added

0 commit comments

Comments
 (0)