Skip to content

Commit 78d512c

Browse files
almeidxQjuhkodiakhq[bot]
authored
docs: export all visible symbols (#10760)
* docs: export all visible symbols * fix: discord.js except raw * refactor: remove raw data types * docs: add back discord.js tsdoc file * refactor: remove underscores * fix: merge * docs(RPCRedis): make `promises` as internal --------- Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent c1f5bb2 commit 78d512c

File tree

19 files changed

+506
-777
lines changed

19 files changed

+506
-777
lines changed

packages/brokers/src/brokers/redis/RPCRedis.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export class RPCRedisBroker<TEvents extends Record<string, any[]>, TResponses ex
6363
*/
6464
protected override readonly options: Required<RPCRedisBrokerOptions>;
6565

66+
/**
67+
* @internal
68+
*/
6669
protected readonly promises = new Map<string, InternalPromise>();
6770

6871
public constructor(redisClient: Redis, options: RPCRedisBrokerOptions) {

packages/builders/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export * from './messages/MessageReference.js';
8686
export * from './util/componentUtil.js';
8787
export * from './util/normalizeArray.js';
8888
export * from './util/resolveBuilder.js';
89-
export * from './util/validation.js';
89+
export { disableValidators, enableValidators, isValidationEnabled } from './util/validation.js';
9090

9191
export * from './Assertions.js';
9292

packages/collection/src/collection.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,12 +1106,6 @@ export class Collection<Key, Value> extends Map<Key, Value> {
11061106
declare public static readonly [Symbol.species]: typeof Collection;
11071107
}
11081108

1109-
/**
1110-
* @internal
1111-
*/
11121109
export type Keep<Value> = { keep: false } | { keep: true; value: Value };
11131110

1114-
/**
1115-
* @internal
1116-
*/
11171111
export type Comparator<Key, Value> = (firstValue: Value, secondValue: Value, firstKey: Key, secondKey: Key) => number;

packages/discord.js/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ docs/**/*
2828

2929
# Generated files
3030
typings/index.d.mts
31-
typings/rawDataTypes.d.mts
Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,6 @@
1-
import { readFile, writeFile } from 'node:fs/promises';
1+
import { cp } from 'node:fs/promises';
22

3-
const rawTypesDTS = new URL('../typings/rawDataTypes.d.ts', import.meta.url);
43
const rawIndexDTS = new URL('../typings/index.d.ts', import.meta.url);
5-
6-
const rawTypesMDTS = new URL('../typings/rawDataTypes.d.mts', import.meta.url);
74
const rawIndexMTS = new URL('../typings/index.d.mts', import.meta.url);
85

9-
const [rawTypesString, rawIndexString] = await Promise.all([
10-
readFile(rawTypesDTS, 'utf8'),
11-
readFile(rawIndexDTS, 'utf8'),
12-
]);
13-
14-
/**
15-
*
16-
* @param {string} source
17-
* @param {[from: string, to: string][]} imports
18-
*/
19-
function updateImports(source, imports) {
20-
return imports.reduce((code, [from, to]) => {
21-
return code.replaceAll(from, to);
22-
}, source);
23-
}
24-
25-
/** @type {[string, string][]} */
26-
const rawTypesImports = [
27-
['./index.js', './index.mjs'], //
28-
];
29-
30-
/** @type {[string, string][]} */
31-
const rawIndexImports = [
32-
['./rawDataTypes.js', './rawDataTypes.mjs'], //
33-
];
34-
35-
const rawTypesMDTSString = updateImports(rawTypesString, rawTypesImports);
36-
const rawIndexMTSString = updateImports(rawIndexString, rawIndexImports);
37-
38-
await Promise.all([writeFile(rawTypesMDTS, rawTypesMDTSString), writeFile(rawIndexMTS, rawIndexMTSString)]);
6+
await cp(rawIndexDTS, rawIndexMTS);

packages/discord.js/src/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ exports.ThreadMemberFlagsBitField = require('./util/ThreadMemberFlagsBitField.js
4545
exports.UserFlagsBitField = require('./util/UserFlagsBitField.js').UserFlagsBitField;
4646

4747
__exportStar(require('./util/DataResolver.js'), exports);
48-
__exportStar(require('./util/Util.js'), exports);
48+
49+
exports.cleanCodeBlockContent = require('./util/Util.js').cleanCodeBlockContent;
50+
exports.cleanContent = require('./util/Util.js').cleanContent;
51+
exports.discordSort = require('./util/Util.js').discordSort;
52+
exports.fetchRecommendedShardCount = require('./util/Util.js').fetchRecommendedShardCount;
53+
exports.flatten = require('./util/Util.js').flatten;
54+
exports.parseEmoji = require('./util/Util.js').parseEmoji;
55+
exports.parseWebhookURL = require('./util/Util.js').parseWebhookURL;
56+
exports.resolveColor = require('./util/Util.js').resolveColor;
57+
exports.resolveSKUId = require('./util/Util.js').resolveSKUId;
58+
exports.verifyString = require('./util/Util.js').verifyString;
4959

5060
exports.version = require('../package.json').version;
5161

packages/discord.js/src/util/Util.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -521,25 +521,28 @@ function resolveSKUId(resolvable) {
521521
return null;
522522
}
523523

524-
exports.flatten = flatten;
524+
// Public
525+
exports.cleanCodeBlockContent = cleanCodeBlockContent;
526+
exports.cleanContent = cleanContent;
527+
exports.discordSort = discordSort;
525528
exports.fetchRecommendedShardCount = fetchRecommendedShardCount;
529+
exports.flatten = flatten;
526530
exports.parseEmoji = parseEmoji;
531+
exports.parseWebhookURL = parseWebhookURL;
532+
exports.resolveColor = resolveColor;
533+
exports.resolveSKUId = resolveSKUId;
534+
exports.verifyString = verifyString;
535+
536+
// Private
527537
exports.resolvePartialEmoji = resolvePartialEmoji;
528538
exports.resolveGuildEmoji = resolveGuildEmoji;
529539
exports.makeError = makeError;
530540
exports.makePlainError = makePlainError;
531541
exports.getSortableGroupTypes = getSortableGroupTypes;
532542
exports.moveElementInArray = moveElementInArray;
533-
exports.verifyString = verifyString;
534-
exports.resolveColor = resolveColor;
535-
exports.discordSort = discordSort;
536543
exports.setPosition = setPosition;
537544
exports.basename = basename;
538-
exports.cleanContent = cleanContent;
539-
exports.cleanCodeBlockContent = cleanCodeBlockContent;
540-
exports.parseWebhookURL = parseWebhookURL;
541545
exports.transformResolved = transformResolved;
542-
exports.resolveSKUId = resolveSKUId;
543546

544547
// Fixes Circular
545548
const { Attachment } = require('../structures/Attachment.js');

packages/discord.js/tsdoc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
3+
"extends": ["@discordjs/api-extractor/extends/tsdoc-base.json"],
4+
"tagDefinitions": [
5+
{
6+
"tagName": "@unstable",
7+
"syntaxKind": "modifier"
8+
}
9+
],
10+
"supportForTags": {
11+
"@unstable": true
12+
}
13+
}

0 commit comments

Comments
 (0)