├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── eslint.config.js ├── package-lock.json ├── package.json ├── src ├── Doc.ts ├── DocBase.ts ├── DocClass.ts ├── DocElement.ts ├── DocEvent.ts ├── DocInterface.ts ├── DocMethod.ts ├── DocParam.ts ├── DocProp.ts ├── DocTypedef.ts ├── InterfacesForDocElements.ts ├── JsDocTypes.ts ├── MessageEmbed.ts ├── index.ts └── sources.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test.js 3 | types/test.ts 4 | .DS_Store 5 | dist/ 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .gitignorex 3 | .npmignore 4 | tsconfig.json 5 | package.json 6 | package-lock.json 7 | src 8 | README.md 9 | eslint.config.js 10 | !dist 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Alex 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## discord.js docs 2 | 3 | A parser and wrapper for the [discord.js](https://github.com/discordjs/discord.js) docs. 4 | 5 | ## Usage 6 | 7 | ### Doc 8 | 9 | ```js 10 | const Doc = require('discord.js-docs') 11 | ``` 12 | 13 | ### Doc.fetch(sourceName[, options]) 14 | Fetches and parses the docs for the given project.\ 15 | `sourceName` can be any of the predefined values (`stable`, `main`, `commando`, `rpc`, `akairo`, `collection`, `builders`, `voice` and `rest`) 16 | or an URL which will return the raw generated docs (e.g https://raw.githubusercontent.com/discordjs/docs/main/discord.js/main.json ).\ 17 | Once a documentation is fetched it will be cached. Use `options.force` to avoid this behavior. 18 | 19 | **Params**: 20 | 21 | |name |type |required| 22 | |:---------:|:----:|:------:| 23 | |sourceName |string|yes | 24 | |options |object|no | 25 | 26 | **Returns**: `Promise` 27 | 28 | ```js 29 | const doc = await Doc.fetch('main') 30 | const doc = await Doc.fetch('akairo', { force: true }) 31 | const doc = await Doc.fetch( 32 | 'https://raw.githubusercontent.com/discordjs/rpc/docs/master.json', 33 | { force: true } 34 | ) 35 | ``` 36 | 37 | ### Doc#get(parent[, child1[ ...[, childN]]]) 38 | Gets documention for one element. Multiple properties/methods can be chained. 39 | **Params**: 40 | 41 | |name |type |required| 42 | |:---------:|:----:|:------:| 43 | |parent |string|yes | 44 | |...children|string|no | 45 | 46 | **Returns**: `DocElement?` 47 | 48 | ```js 49 | doc.get('message') 50 | doc.get('message', 'guild') 51 | doc.get('message', 'guild', 'members') 52 | ``` 53 | 54 | ### Doc#search(query) 55 | Searches the documentation using fuzzy search for the given query and returns top 10 hits. 56 | 57 | **Params**: 58 | 59 | |name |type |required| 60 | |:-----:|:----:|:------:| 61 | |query |string|yes | 62 | 63 | **Returns**: `Array?` 64 | 65 | ### Doc#resolveEmbed(query) 66 | Tries to resolve the query into a `DocElement` using `Doc#get`. The search terms are expected to be separated by `#` or `.`, example: `message#pin`. If an element cannot be resolved, falls back to `Doc#search`. The result is then formatted into an object representing a Discord embed which can be sent directly to a Discord channel. 67 | 68 | **Params**: 69 | 70 | |name |type |required| 71 | |:-----:|:----:|:------:| 72 | |query |string|yes | 73 | 74 | **Returns**: `object?` 75 | 76 | ### DocElement 77 | #### Properties: 78 | - `doc` - the Doc this element originates from; 79 | - `docType` - the type of this documentation element. One of `class`, `event`, `interface`, `method`, `param`, `prop` and `typedef`; 80 | - `parent` - parent element if present; 81 | - `name` - self-explanatory; 82 | - `description` - self-explanatory; 83 | - `meta` - any meta information if present; 84 | - `returns` - the type this element returns, if applicable; 85 | - `examples` - code examples, if any; 86 | - `type` - the JS type of this element, if applicable; 87 | - `nullable` - tells whether this element can be null; 88 | - `deprecated` - tells whether this element has been deprecated; 89 | - `access` - access level for this element. Defaults to `public`; 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- 1 | import eslint from '@eslint/js'; 2 | import tseslint from 'typescript-eslint'; 3 | import typescriptParser from '@typescript-eslint/parser'; 4 | import stylisticJs from '@stylistic/eslint-plugin-js'; 5 | 6 | export default [ 7 | eslint.configs.recommended, 8 | ...tseslint.configs.recommended, 9 | { 10 | ignores: ['dist'], 11 | plugins: { 12 | '@stylistic/js': stylisticJs, 13 | }, 14 | languageOptions: { 15 | sourceType: 'module', 16 | ecmaVersion: 2024, 17 | parser: typescriptParser 18 | }, 19 | rules: { 20 | 'strict': 'error', 21 | 'no-var': 'error', 22 | 'no-console': 'warn', 23 | 'array-callback-return': 'error', 24 | 'yoda': 'error', 25 | '@stylistic/js/indent': [ 26 | 'error', 27 | 'tab', 28 | ], 29 | '@stylistic/js/linebreak-style': [ 30 | 'error', 31 | 'unix' 32 | ], 33 | '@stylistic/js/quotes': [ 34 | 'error', 35 | 'single' 36 | ], 37 | '@stylistic/js/semi': [ 38 | 'error', 39 | 'always' 40 | ], 41 | '@typescript-eslint/no-unused-vars': 'error', 42 | '@typescript-eslint/ban-ts-comment': 'off', 43 | '@typescript-eslint/no-non-null-assertion': 'off' 44 | } 45 | } 46 | ]; 47 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord.js-docs", 3 | "version": "0.4.3", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "discord.js-docs", 9 | "version": "0.4.3", 10 | "license": "MIT", 11 | "dependencies": { 12 | "common-tags": "^1.8.2", 13 | "discord-api-types": "^0.37.109", 14 | "fuse.js": "^7.0.0" 15 | }, 16 | "devDependencies": { 17 | "@stylistic/eslint-plugin-js": "^2.11.0", 18 | "@types/common-tags": "^1.8.4", 19 | "eslint": "^9.15.0", 20 | "prettier": "^3.4.1", 21 | "typescript": "^5.7.2", 22 | "typescript-eslint": "^8.16.0" 23 | } 24 | }, 25 | "node_modules/@eslint-community/eslint-utils": { 26 | "version": "4.4.1", 27 | "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", 28 | "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", 29 | "dev": true, 30 | "license": "MIT", 31 | "dependencies": { 32 | "eslint-visitor-keys": "^3.4.3" 33 | }, 34 | "engines": { 35 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 36 | }, 37 | "funding": { 38 | "url": "https://opencollective.com/eslint" 39 | }, 40 | "peerDependencies": { 41 | "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" 42 | } 43 | }, 44 | "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { 45 | "version": "3.4.3", 46 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", 47 | "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", 48 | "dev": true, 49 | "license": "Apache-2.0", 50 | "engines": { 51 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 52 | }, 53 | "funding": { 54 | "url": "https://opencollective.com/eslint" 55 | } 56 | }, 57 | "node_modules/@eslint-community/regexpp": { 58 | "version": "4.12.1", 59 | "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", 60 | "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", 61 | "dev": true, 62 | "license": "MIT", 63 | "engines": { 64 | "node": "^12.0.0 || ^14.0.0 || >=16.0.0" 65 | } 66 | }, 67 | "node_modules/@eslint/config-array": { 68 | "version": "0.19.0", 69 | "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", 70 | "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", 71 | "dev": true, 72 | "license": "Apache-2.0", 73 | "dependencies": { 74 | "@eslint/object-schema": "^2.1.4", 75 | "debug": "^4.3.1", 76 | "minimatch": "^3.1.2" 77 | }, 78 | "engines": { 79 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 80 | } 81 | }, 82 | "node_modules/@eslint/core": { 83 | "version": "0.9.0", 84 | "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", 85 | "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", 86 | "dev": true, 87 | "license": "Apache-2.0", 88 | "engines": { 89 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 90 | } 91 | }, 92 | "node_modules/@eslint/eslintrc": { 93 | "version": "3.2.0", 94 | "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", 95 | "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", 96 | "dev": true, 97 | "license": "MIT", 98 | "dependencies": { 99 | "ajv": "^6.12.4", 100 | "debug": "^4.3.2", 101 | "espree": "^10.0.1", 102 | "globals": "^14.0.0", 103 | "ignore": "^5.2.0", 104 | "import-fresh": "^3.2.1", 105 | "js-yaml": "^4.1.0", 106 | "minimatch": "^3.1.2", 107 | "strip-json-comments": "^3.1.1" 108 | }, 109 | "engines": { 110 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 111 | }, 112 | "funding": { 113 | "url": "https://opencollective.com/eslint" 114 | } 115 | }, 116 | "node_modules/@eslint/js": { 117 | "version": "9.15.0", 118 | "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", 119 | "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", 120 | "dev": true, 121 | "license": "MIT", 122 | "engines": { 123 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 124 | } 125 | }, 126 | "node_modules/@eslint/object-schema": { 127 | "version": "2.1.4", 128 | "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", 129 | "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", 130 | "dev": true, 131 | "license": "Apache-2.0", 132 | "engines": { 133 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 134 | } 135 | }, 136 | "node_modules/@eslint/plugin-kit": { 137 | "version": "0.2.3", 138 | "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", 139 | "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", 140 | "dev": true, 141 | "license": "Apache-2.0", 142 | "dependencies": { 143 | "levn": "^0.4.1" 144 | }, 145 | "engines": { 146 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 147 | } 148 | }, 149 | "node_modules/@humanfs/core": { 150 | "version": "0.19.1", 151 | "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", 152 | "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", 153 | "dev": true, 154 | "license": "Apache-2.0", 155 | "engines": { 156 | "node": ">=18.18.0" 157 | } 158 | }, 159 | "node_modules/@humanfs/node": { 160 | "version": "0.16.6", 161 | "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", 162 | "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", 163 | "dev": true, 164 | "license": "Apache-2.0", 165 | "dependencies": { 166 | "@humanfs/core": "^0.19.1", 167 | "@humanwhocodes/retry": "^0.3.0" 168 | }, 169 | "engines": { 170 | "node": ">=18.18.0" 171 | } 172 | }, 173 | "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { 174 | "version": "0.3.1", 175 | "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", 176 | "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", 177 | "dev": true, 178 | "license": "Apache-2.0", 179 | "engines": { 180 | "node": ">=18.18" 181 | }, 182 | "funding": { 183 | "type": "github", 184 | "url": "https://github.com/sponsors/nzakas" 185 | } 186 | }, 187 | "node_modules/@humanwhocodes/module-importer": { 188 | "version": "1.0.1", 189 | "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", 190 | "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", 191 | "dev": true, 192 | "license": "Apache-2.0", 193 | "engines": { 194 | "node": ">=12.22" 195 | }, 196 | "funding": { 197 | "type": "github", 198 | "url": "https://github.com/sponsors/nzakas" 199 | } 200 | }, 201 | "node_modules/@humanwhocodes/retry": { 202 | "version": "0.4.1", 203 | "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", 204 | "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", 205 | "dev": true, 206 | "license": "Apache-2.0", 207 | "engines": { 208 | "node": ">=18.18" 209 | }, 210 | "funding": { 211 | "type": "github", 212 | "url": "https://github.com/sponsors/nzakas" 213 | } 214 | }, 215 | "node_modules/@nodelib/fs.scandir": { 216 | "version": "2.1.5", 217 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", 218 | "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", 219 | "dev": true, 220 | "license": "MIT", 221 | "dependencies": { 222 | "@nodelib/fs.stat": "2.0.5", 223 | "run-parallel": "^1.1.9" 224 | }, 225 | "engines": { 226 | "node": ">= 8" 227 | } 228 | }, 229 | "node_modules/@nodelib/fs.stat": { 230 | "version": "2.0.5", 231 | "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", 232 | "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", 233 | "dev": true, 234 | "license": "MIT", 235 | "engines": { 236 | "node": ">= 8" 237 | } 238 | }, 239 | "node_modules/@nodelib/fs.walk": { 240 | "version": "1.2.8", 241 | "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", 242 | "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", 243 | "dev": true, 244 | "license": "MIT", 245 | "dependencies": { 246 | "@nodelib/fs.scandir": "2.1.5", 247 | "fastq": "^1.6.0" 248 | }, 249 | "engines": { 250 | "node": ">= 8" 251 | } 252 | }, 253 | "node_modules/@stylistic/eslint-plugin-js": { 254 | "version": "2.11.0", 255 | "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.11.0.tgz", 256 | "integrity": "sha512-btchD0P3iij6cIk5RR5QMdEhtCCV0+L6cNheGhGCd//jaHILZMTi/EOqgEDAf1s4ZoViyExoToM+S2Iwa3U9DA==", 257 | "dev": true, 258 | "dependencies": { 259 | "eslint-visitor-keys": "^4.2.0", 260 | "espree": "^10.3.0" 261 | }, 262 | "engines": { 263 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 264 | }, 265 | "peerDependencies": { 266 | "eslint": ">=8.40.0" 267 | } 268 | }, 269 | "node_modules/@types/common-tags": { 270 | "version": "1.8.4", 271 | "resolved": "https://registry.npmjs.org/@types/common-tags/-/common-tags-1.8.4.tgz", 272 | "integrity": "sha512-S+1hLDJPjWNDhcGxsxEbepzaxWqURP/o+3cP4aa2w7yBXgdcmKGQtZzP8JbyfOd0m+33nh+8+kvxYE2UJtBDkg==", 273 | "dev": true, 274 | "license": "MIT" 275 | }, 276 | "node_modules/@types/estree": { 277 | "version": "1.0.6", 278 | "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", 279 | "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", 280 | "dev": true, 281 | "license": "MIT" 282 | }, 283 | "node_modules/@types/json-schema": { 284 | "version": "7.0.15", 285 | "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", 286 | "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", 287 | "dev": true, 288 | "license": "MIT" 289 | }, 290 | "node_modules/@typescript-eslint/eslint-plugin": { 291 | "version": "8.16.0", 292 | "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.16.0.tgz", 293 | "integrity": "sha512-5YTHKV8MYlyMI6BaEG7crQ9BhSc8RxzshOReKwZwRWN0+XvvTOm+L/UYLCYxFpfwYuAAqhxiq4yae0CMFwbL7Q==", 294 | "dev": true, 295 | "license": "MIT", 296 | "dependencies": { 297 | "@eslint-community/regexpp": "^4.10.0", 298 | "@typescript-eslint/scope-manager": "8.16.0", 299 | "@typescript-eslint/type-utils": "8.16.0", 300 | "@typescript-eslint/utils": "8.16.0", 301 | "@typescript-eslint/visitor-keys": "8.16.0", 302 | "graphemer": "^1.4.0", 303 | "ignore": "^5.3.1", 304 | "natural-compare": "^1.4.0", 305 | "ts-api-utils": "^1.3.0" 306 | }, 307 | "engines": { 308 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 309 | }, 310 | "funding": { 311 | "type": "opencollective", 312 | "url": "https://opencollective.com/typescript-eslint" 313 | }, 314 | "peerDependencies": { 315 | "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", 316 | "eslint": "^8.57.0 || ^9.0.0" 317 | }, 318 | "peerDependenciesMeta": { 319 | "typescript": { 320 | "optional": true 321 | } 322 | } 323 | }, 324 | "node_modules/@typescript-eslint/parser": { 325 | "version": "8.16.0", 326 | "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.16.0.tgz", 327 | "integrity": "sha512-D7DbgGFtsqIPIFMPJwCad9Gfi/hC0PWErRRHFnaCWoEDYi5tQUDiJCTmGUbBiLzjqAck4KcXt9Ayj0CNlIrF+w==", 328 | "dev": true, 329 | "license": "BSD-2-Clause", 330 | "dependencies": { 331 | "@typescript-eslint/scope-manager": "8.16.0", 332 | "@typescript-eslint/types": "8.16.0", 333 | "@typescript-eslint/typescript-estree": "8.16.0", 334 | "@typescript-eslint/visitor-keys": "8.16.0", 335 | "debug": "^4.3.4" 336 | }, 337 | "engines": { 338 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 339 | }, 340 | "funding": { 341 | "type": "opencollective", 342 | "url": "https://opencollective.com/typescript-eslint" 343 | }, 344 | "peerDependencies": { 345 | "eslint": "^8.57.0 || ^9.0.0" 346 | }, 347 | "peerDependenciesMeta": { 348 | "typescript": { 349 | "optional": true 350 | } 351 | } 352 | }, 353 | "node_modules/@typescript-eslint/scope-manager": { 354 | "version": "8.16.0", 355 | "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz", 356 | "integrity": "sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==", 357 | "dev": true, 358 | "license": "MIT", 359 | "dependencies": { 360 | "@typescript-eslint/types": "8.16.0", 361 | "@typescript-eslint/visitor-keys": "8.16.0" 362 | }, 363 | "engines": { 364 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 365 | }, 366 | "funding": { 367 | "type": "opencollective", 368 | "url": "https://opencollective.com/typescript-eslint" 369 | } 370 | }, 371 | "node_modules/@typescript-eslint/type-utils": { 372 | "version": "8.16.0", 373 | "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.16.0.tgz", 374 | "integrity": "sha512-IqZHGG+g1XCWX9NyqnI/0CX5LL8/18awQqmkZSl2ynn8F76j579dByc0jhfVSnSnhf7zv76mKBQv9HQFKvDCgg==", 375 | "dev": true, 376 | "license": "MIT", 377 | "dependencies": { 378 | "@typescript-eslint/typescript-estree": "8.16.0", 379 | "@typescript-eslint/utils": "8.16.0", 380 | "debug": "^4.3.4", 381 | "ts-api-utils": "^1.3.0" 382 | }, 383 | "engines": { 384 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 385 | }, 386 | "funding": { 387 | "type": "opencollective", 388 | "url": "https://opencollective.com/typescript-eslint" 389 | }, 390 | "peerDependencies": { 391 | "eslint": "^8.57.0 || ^9.0.0" 392 | }, 393 | "peerDependenciesMeta": { 394 | "typescript": { 395 | "optional": true 396 | } 397 | } 398 | }, 399 | "node_modules/@typescript-eslint/types": { 400 | "version": "8.16.0", 401 | "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.16.0.tgz", 402 | "integrity": "sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==", 403 | "dev": true, 404 | "license": "MIT", 405 | "engines": { 406 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 407 | }, 408 | "funding": { 409 | "type": "opencollective", 410 | "url": "https://opencollective.com/typescript-eslint" 411 | } 412 | }, 413 | "node_modules/@typescript-eslint/typescript-estree": { 414 | "version": "8.16.0", 415 | "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz", 416 | "integrity": "sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==", 417 | "dev": true, 418 | "license": "BSD-2-Clause", 419 | "dependencies": { 420 | "@typescript-eslint/types": "8.16.0", 421 | "@typescript-eslint/visitor-keys": "8.16.0", 422 | "debug": "^4.3.4", 423 | "fast-glob": "^3.3.2", 424 | "is-glob": "^4.0.3", 425 | "minimatch": "^9.0.4", 426 | "semver": "^7.6.0", 427 | "ts-api-utils": "^1.3.0" 428 | }, 429 | "engines": { 430 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 431 | }, 432 | "funding": { 433 | "type": "opencollective", 434 | "url": "https://opencollective.com/typescript-eslint" 435 | }, 436 | "peerDependenciesMeta": { 437 | "typescript": { 438 | "optional": true 439 | } 440 | } 441 | }, 442 | "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { 443 | "version": "2.0.1", 444 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 445 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 446 | "dev": true, 447 | "license": "MIT", 448 | "dependencies": { 449 | "balanced-match": "^1.0.0" 450 | } 451 | }, 452 | "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { 453 | "version": "9.0.5", 454 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", 455 | "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", 456 | "dev": true, 457 | "license": "ISC", 458 | "dependencies": { 459 | "brace-expansion": "^2.0.1" 460 | }, 461 | "engines": { 462 | "node": ">=16 || 14 >=14.17" 463 | }, 464 | "funding": { 465 | "url": "https://github.com/sponsors/isaacs" 466 | } 467 | }, 468 | "node_modules/@typescript-eslint/utils": { 469 | "version": "8.16.0", 470 | "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.16.0.tgz", 471 | "integrity": "sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==", 472 | "dev": true, 473 | "license": "MIT", 474 | "dependencies": { 475 | "@eslint-community/eslint-utils": "^4.4.0", 476 | "@typescript-eslint/scope-manager": "8.16.0", 477 | "@typescript-eslint/types": "8.16.0", 478 | "@typescript-eslint/typescript-estree": "8.16.0" 479 | }, 480 | "engines": { 481 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 482 | }, 483 | "funding": { 484 | "type": "opencollective", 485 | "url": "https://opencollective.com/typescript-eslint" 486 | }, 487 | "peerDependencies": { 488 | "eslint": "^8.57.0 || ^9.0.0" 489 | }, 490 | "peerDependenciesMeta": { 491 | "typescript": { 492 | "optional": true 493 | } 494 | } 495 | }, 496 | "node_modules/@typescript-eslint/visitor-keys": { 497 | "version": "8.16.0", 498 | "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz", 499 | "integrity": "sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==", 500 | "dev": true, 501 | "license": "MIT", 502 | "dependencies": { 503 | "@typescript-eslint/types": "8.16.0", 504 | "eslint-visitor-keys": "^4.2.0" 505 | }, 506 | "engines": { 507 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 508 | }, 509 | "funding": { 510 | "type": "opencollective", 511 | "url": "https://opencollective.com/typescript-eslint" 512 | } 513 | }, 514 | "node_modules/acorn": { 515 | "version": "8.14.0", 516 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", 517 | "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", 518 | "dev": true, 519 | "license": "MIT", 520 | "bin": { 521 | "acorn": "bin/acorn" 522 | }, 523 | "engines": { 524 | "node": ">=0.4.0" 525 | } 526 | }, 527 | "node_modules/acorn-jsx": { 528 | "version": "5.3.2", 529 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", 530 | "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", 531 | "dev": true, 532 | "license": "MIT", 533 | "peerDependencies": { 534 | "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" 535 | } 536 | }, 537 | "node_modules/ajv": { 538 | "version": "6.12.6", 539 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", 540 | "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", 541 | "dev": true, 542 | "license": "MIT", 543 | "dependencies": { 544 | "fast-deep-equal": "^3.1.1", 545 | "fast-json-stable-stringify": "^2.0.0", 546 | "json-schema-traverse": "^0.4.1", 547 | "uri-js": "^4.2.2" 548 | }, 549 | "funding": { 550 | "type": "github", 551 | "url": "https://github.com/sponsors/epoberezkin" 552 | } 553 | }, 554 | "node_modules/ansi-styles": { 555 | "version": "4.3.0", 556 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 557 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 558 | "dev": true, 559 | "license": "MIT", 560 | "dependencies": { 561 | "color-convert": "^2.0.1" 562 | }, 563 | "engines": { 564 | "node": ">=8" 565 | }, 566 | "funding": { 567 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 568 | } 569 | }, 570 | "node_modules/argparse": { 571 | "version": "2.0.1", 572 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 573 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", 574 | "dev": true, 575 | "license": "Python-2.0" 576 | }, 577 | "node_modules/balanced-match": { 578 | "version": "1.0.2", 579 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 580 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 581 | "dev": true, 582 | "license": "MIT" 583 | }, 584 | "node_modules/brace-expansion": { 585 | "version": "1.1.11", 586 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 587 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 588 | "dev": true, 589 | "license": "MIT", 590 | "dependencies": { 591 | "balanced-match": "^1.0.0", 592 | "concat-map": "0.0.1" 593 | } 594 | }, 595 | "node_modules/braces": { 596 | "version": "3.0.3", 597 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", 598 | "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", 599 | "dev": true, 600 | "license": "MIT", 601 | "dependencies": { 602 | "fill-range": "^7.1.1" 603 | }, 604 | "engines": { 605 | "node": ">=8" 606 | } 607 | }, 608 | "node_modules/callsites": { 609 | "version": "3.1.0", 610 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", 611 | "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", 612 | "dev": true, 613 | "license": "MIT", 614 | "engines": { 615 | "node": ">=6" 616 | } 617 | }, 618 | "node_modules/chalk": { 619 | "version": "4.1.2", 620 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 621 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 622 | "dev": true, 623 | "license": "MIT", 624 | "dependencies": { 625 | "ansi-styles": "^4.1.0", 626 | "supports-color": "^7.1.0" 627 | }, 628 | "engines": { 629 | "node": ">=10" 630 | }, 631 | "funding": { 632 | "url": "https://github.com/chalk/chalk?sponsor=1" 633 | } 634 | }, 635 | "node_modules/color-convert": { 636 | "version": "2.0.1", 637 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 638 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 639 | "dev": true, 640 | "license": "MIT", 641 | "dependencies": { 642 | "color-name": "~1.1.4" 643 | }, 644 | "engines": { 645 | "node": ">=7.0.0" 646 | } 647 | }, 648 | "node_modules/color-name": { 649 | "version": "1.1.4", 650 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 651 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 652 | "dev": true, 653 | "license": "MIT" 654 | }, 655 | "node_modules/common-tags": { 656 | "version": "1.8.2", 657 | "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", 658 | "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", 659 | "license": "MIT", 660 | "engines": { 661 | "node": ">=4.0.0" 662 | } 663 | }, 664 | "node_modules/concat-map": { 665 | "version": "0.0.1", 666 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 667 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 668 | "dev": true, 669 | "license": "MIT" 670 | }, 671 | "node_modules/cross-spawn": { 672 | "version": "7.0.6", 673 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", 674 | "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", 675 | "dev": true, 676 | "license": "MIT", 677 | "dependencies": { 678 | "path-key": "^3.1.0", 679 | "shebang-command": "^2.0.0", 680 | "which": "^2.0.1" 681 | }, 682 | "engines": { 683 | "node": ">= 8" 684 | } 685 | }, 686 | "node_modules/debug": { 687 | "version": "4.3.7", 688 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", 689 | "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", 690 | "dev": true, 691 | "license": "MIT", 692 | "dependencies": { 693 | "ms": "^2.1.3" 694 | }, 695 | "engines": { 696 | "node": ">=6.0" 697 | }, 698 | "peerDependenciesMeta": { 699 | "supports-color": { 700 | "optional": true 701 | } 702 | } 703 | }, 704 | "node_modules/deep-is": { 705 | "version": "0.1.4", 706 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", 707 | "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", 708 | "dev": true, 709 | "license": "MIT" 710 | }, 711 | "node_modules/discord-api-types": { 712 | "version": "0.37.109", 713 | "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.109.tgz", 714 | "integrity": "sha512-B4W/ao8vempNVCS4/K4CeeCGhiabTcU7ekgqJy4/RytEsgkJP9hWS0MWZMcRP3wWzU/FXi6QqqvArZTJUfc6Iw==", 715 | "license": "MIT" 716 | }, 717 | "node_modules/escape-string-regexp": { 718 | "version": "4.0.0", 719 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", 720 | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", 721 | "dev": true, 722 | "license": "MIT", 723 | "engines": { 724 | "node": ">=10" 725 | }, 726 | "funding": { 727 | "url": "https://github.com/sponsors/sindresorhus" 728 | } 729 | }, 730 | "node_modules/eslint": { 731 | "version": "9.15.0", 732 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", 733 | "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", 734 | "dev": true, 735 | "dependencies": { 736 | "@eslint-community/eslint-utils": "^4.2.0", 737 | "@eslint-community/regexpp": "^4.12.1", 738 | "@eslint/config-array": "^0.19.0", 739 | "@eslint/core": "^0.9.0", 740 | "@eslint/eslintrc": "^3.2.0", 741 | "@eslint/js": "9.15.0", 742 | "@eslint/plugin-kit": "^0.2.3", 743 | "@humanfs/node": "^0.16.6", 744 | "@humanwhocodes/module-importer": "^1.0.1", 745 | "@humanwhocodes/retry": "^0.4.1", 746 | "@types/estree": "^1.0.6", 747 | "@types/json-schema": "^7.0.15", 748 | "ajv": "^6.12.4", 749 | "chalk": "^4.0.0", 750 | "cross-spawn": "^7.0.5", 751 | "debug": "^4.3.2", 752 | "escape-string-regexp": "^4.0.0", 753 | "eslint-scope": "^8.2.0", 754 | "eslint-visitor-keys": "^4.2.0", 755 | "espree": "^10.3.0", 756 | "esquery": "^1.5.0", 757 | "esutils": "^2.0.2", 758 | "fast-deep-equal": "^3.1.3", 759 | "file-entry-cache": "^8.0.0", 760 | "find-up": "^5.0.0", 761 | "glob-parent": "^6.0.2", 762 | "ignore": "^5.2.0", 763 | "imurmurhash": "^0.1.4", 764 | "is-glob": "^4.0.0", 765 | "json-stable-stringify-without-jsonify": "^1.0.1", 766 | "lodash.merge": "^4.6.2", 767 | "minimatch": "^3.1.2", 768 | "natural-compare": "^1.4.0", 769 | "optionator": "^0.9.3" 770 | }, 771 | "bin": { 772 | "eslint": "bin/eslint.js" 773 | }, 774 | "engines": { 775 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 776 | }, 777 | "funding": { 778 | "url": "https://eslint.org/donate" 779 | }, 780 | "peerDependencies": { 781 | "jiti": "*" 782 | }, 783 | "peerDependenciesMeta": { 784 | "jiti": { 785 | "optional": true 786 | } 787 | } 788 | }, 789 | "node_modules/eslint-scope": { 790 | "version": "8.2.0", 791 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", 792 | "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", 793 | "dev": true, 794 | "license": "BSD-2-Clause", 795 | "dependencies": { 796 | "esrecurse": "^4.3.0", 797 | "estraverse": "^5.2.0" 798 | }, 799 | "engines": { 800 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 801 | }, 802 | "funding": { 803 | "url": "https://opencollective.com/eslint" 804 | } 805 | }, 806 | "node_modules/eslint-visitor-keys": { 807 | "version": "4.2.0", 808 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", 809 | "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", 810 | "dev": true, 811 | "license": "Apache-2.0", 812 | "engines": { 813 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 814 | }, 815 | "funding": { 816 | "url": "https://opencollective.com/eslint" 817 | } 818 | }, 819 | "node_modules/espree": { 820 | "version": "10.3.0", 821 | "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", 822 | "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", 823 | "dev": true, 824 | "license": "BSD-2-Clause", 825 | "dependencies": { 826 | "acorn": "^8.14.0", 827 | "acorn-jsx": "^5.3.2", 828 | "eslint-visitor-keys": "^4.2.0" 829 | }, 830 | "engines": { 831 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 832 | }, 833 | "funding": { 834 | "url": "https://opencollective.com/eslint" 835 | } 836 | }, 837 | "node_modules/esquery": { 838 | "version": "1.6.0", 839 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", 840 | "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", 841 | "dev": true, 842 | "license": "BSD-3-Clause", 843 | "dependencies": { 844 | "estraverse": "^5.1.0" 845 | }, 846 | "engines": { 847 | "node": ">=0.10" 848 | } 849 | }, 850 | "node_modules/esrecurse": { 851 | "version": "4.3.0", 852 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", 853 | "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", 854 | "dev": true, 855 | "license": "BSD-2-Clause", 856 | "dependencies": { 857 | "estraverse": "^5.2.0" 858 | }, 859 | "engines": { 860 | "node": ">=4.0" 861 | } 862 | }, 863 | "node_modules/estraverse": { 864 | "version": "5.3.0", 865 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", 866 | "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", 867 | "dev": true, 868 | "license": "BSD-2-Clause", 869 | "engines": { 870 | "node": ">=4.0" 871 | } 872 | }, 873 | "node_modules/esutils": { 874 | "version": "2.0.3", 875 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 876 | "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 877 | "dev": true, 878 | "license": "BSD-2-Clause", 879 | "engines": { 880 | "node": ">=0.10.0" 881 | } 882 | }, 883 | "node_modules/fast-deep-equal": { 884 | "version": "3.1.3", 885 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", 886 | "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", 887 | "dev": true, 888 | "license": "MIT" 889 | }, 890 | "node_modules/fast-glob": { 891 | "version": "3.3.2", 892 | "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", 893 | "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", 894 | "dev": true, 895 | "license": "MIT", 896 | "dependencies": { 897 | "@nodelib/fs.stat": "^2.0.2", 898 | "@nodelib/fs.walk": "^1.2.3", 899 | "glob-parent": "^5.1.2", 900 | "merge2": "^1.3.0", 901 | "micromatch": "^4.0.4" 902 | }, 903 | "engines": { 904 | "node": ">=8.6.0" 905 | } 906 | }, 907 | "node_modules/fast-glob/node_modules/glob-parent": { 908 | "version": "5.1.2", 909 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 910 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 911 | "dev": true, 912 | "license": "ISC", 913 | "dependencies": { 914 | "is-glob": "^4.0.1" 915 | }, 916 | "engines": { 917 | "node": ">= 6" 918 | } 919 | }, 920 | "node_modules/fast-json-stable-stringify": { 921 | "version": "2.1.0", 922 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 923 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", 924 | "dev": true, 925 | "license": "MIT" 926 | }, 927 | "node_modules/fast-levenshtein": { 928 | "version": "2.0.6", 929 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 930 | "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", 931 | "dev": true, 932 | "license": "MIT" 933 | }, 934 | "node_modules/fastq": { 935 | "version": "1.17.1", 936 | "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", 937 | "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", 938 | "dev": true, 939 | "license": "ISC", 940 | "dependencies": { 941 | "reusify": "^1.0.4" 942 | } 943 | }, 944 | "node_modules/file-entry-cache": { 945 | "version": "8.0.0", 946 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", 947 | "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", 948 | "dev": true, 949 | "license": "MIT", 950 | "dependencies": { 951 | "flat-cache": "^4.0.0" 952 | }, 953 | "engines": { 954 | "node": ">=16.0.0" 955 | } 956 | }, 957 | "node_modules/fill-range": { 958 | "version": "7.1.1", 959 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", 960 | "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", 961 | "dev": true, 962 | "license": "MIT", 963 | "dependencies": { 964 | "to-regex-range": "^5.0.1" 965 | }, 966 | "engines": { 967 | "node": ">=8" 968 | } 969 | }, 970 | "node_modules/find-up": { 971 | "version": "5.0.0", 972 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", 973 | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", 974 | "dev": true, 975 | "license": "MIT", 976 | "dependencies": { 977 | "locate-path": "^6.0.0", 978 | "path-exists": "^4.0.0" 979 | }, 980 | "engines": { 981 | "node": ">=10" 982 | }, 983 | "funding": { 984 | "url": "https://github.com/sponsors/sindresorhus" 985 | } 986 | }, 987 | "node_modules/flat-cache": { 988 | "version": "4.0.1", 989 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", 990 | "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", 991 | "dev": true, 992 | "license": "MIT", 993 | "dependencies": { 994 | "flatted": "^3.2.9", 995 | "keyv": "^4.5.4" 996 | }, 997 | "engines": { 998 | "node": ">=16" 999 | } 1000 | }, 1001 | "node_modules/flatted": { 1002 | "version": "3.3.2", 1003 | "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", 1004 | "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", 1005 | "dev": true, 1006 | "license": "ISC" 1007 | }, 1008 | "node_modules/fuse.js": { 1009 | "version": "7.0.0", 1010 | "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.0.0.tgz", 1011 | "integrity": "sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q==", 1012 | "license": "Apache-2.0", 1013 | "engines": { 1014 | "node": ">=10" 1015 | } 1016 | }, 1017 | "node_modules/glob-parent": { 1018 | "version": "6.0.2", 1019 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", 1020 | "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", 1021 | "dev": true, 1022 | "license": "ISC", 1023 | "dependencies": { 1024 | "is-glob": "^4.0.3" 1025 | }, 1026 | "engines": { 1027 | "node": ">=10.13.0" 1028 | } 1029 | }, 1030 | "node_modules/globals": { 1031 | "version": "14.0.0", 1032 | "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", 1033 | "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", 1034 | "dev": true, 1035 | "license": "MIT", 1036 | "engines": { 1037 | "node": ">=18" 1038 | }, 1039 | "funding": { 1040 | "url": "https://github.com/sponsors/sindresorhus" 1041 | } 1042 | }, 1043 | "node_modules/graphemer": { 1044 | "version": "1.4.0", 1045 | "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", 1046 | "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", 1047 | "dev": true, 1048 | "license": "MIT" 1049 | }, 1050 | "node_modules/has-flag": { 1051 | "version": "4.0.0", 1052 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 1053 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 1054 | "dev": true, 1055 | "license": "MIT", 1056 | "engines": { 1057 | "node": ">=8" 1058 | } 1059 | }, 1060 | "node_modules/ignore": { 1061 | "version": "5.3.2", 1062 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", 1063 | "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", 1064 | "dev": true, 1065 | "license": "MIT", 1066 | "engines": { 1067 | "node": ">= 4" 1068 | } 1069 | }, 1070 | "node_modules/import-fresh": { 1071 | "version": "3.3.0", 1072 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", 1073 | "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", 1074 | "dev": true, 1075 | "license": "MIT", 1076 | "dependencies": { 1077 | "parent-module": "^1.0.0", 1078 | "resolve-from": "^4.0.0" 1079 | }, 1080 | "engines": { 1081 | "node": ">=6" 1082 | }, 1083 | "funding": { 1084 | "url": "https://github.com/sponsors/sindresorhus" 1085 | } 1086 | }, 1087 | "node_modules/imurmurhash": { 1088 | "version": "0.1.4", 1089 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 1090 | "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", 1091 | "dev": true, 1092 | "license": "MIT", 1093 | "engines": { 1094 | "node": ">=0.8.19" 1095 | } 1096 | }, 1097 | "node_modules/is-extglob": { 1098 | "version": "2.1.1", 1099 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 1100 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 1101 | "dev": true, 1102 | "license": "MIT", 1103 | "engines": { 1104 | "node": ">=0.10.0" 1105 | } 1106 | }, 1107 | "node_modules/is-glob": { 1108 | "version": "4.0.3", 1109 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 1110 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 1111 | "dev": true, 1112 | "license": "MIT", 1113 | "dependencies": { 1114 | "is-extglob": "^2.1.1" 1115 | }, 1116 | "engines": { 1117 | "node": ">=0.10.0" 1118 | } 1119 | }, 1120 | "node_modules/is-number": { 1121 | "version": "7.0.0", 1122 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 1123 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 1124 | "dev": true, 1125 | "license": "MIT", 1126 | "engines": { 1127 | "node": ">=0.12.0" 1128 | } 1129 | }, 1130 | "node_modules/isexe": { 1131 | "version": "2.0.0", 1132 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 1133 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 1134 | "dev": true, 1135 | "license": "ISC" 1136 | }, 1137 | "node_modules/js-yaml": { 1138 | "version": "4.1.0", 1139 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 1140 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 1141 | "dev": true, 1142 | "license": "MIT", 1143 | "dependencies": { 1144 | "argparse": "^2.0.1" 1145 | }, 1146 | "bin": { 1147 | "js-yaml": "bin/js-yaml.js" 1148 | } 1149 | }, 1150 | "node_modules/json-buffer": { 1151 | "version": "3.0.1", 1152 | "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", 1153 | "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", 1154 | "dev": true, 1155 | "license": "MIT" 1156 | }, 1157 | "node_modules/json-schema-traverse": { 1158 | "version": "0.4.1", 1159 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 1160 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 1161 | "dev": true, 1162 | "license": "MIT" 1163 | }, 1164 | "node_modules/json-stable-stringify-without-jsonify": { 1165 | "version": "1.0.1", 1166 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 1167 | "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", 1168 | "dev": true, 1169 | "license": "MIT" 1170 | }, 1171 | "node_modules/keyv": { 1172 | "version": "4.5.4", 1173 | "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", 1174 | "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", 1175 | "dev": true, 1176 | "license": "MIT", 1177 | "dependencies": { 1178 | "json-buffer": "3.0.1" 1179 | } 1180 | }, 1181 | "node_modules/levn": { 1182 | "version": "0.4.1", 1183 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", 1184 | "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", 1185 | "dev": true, 1186 | "license": "MIT", 1187 | "dependencies": { 1188 | "prelude-ls": "^1.2.1", 1189 | "type-check": "~0.4.0" 1190 | }, 1191 | "engines": { 1192 | "node": ">= 0.8.0" 1193 | } 1194 | }, 1195 | "node_modules/locate-path": { 1196 | "version": "6.0.0", 1197 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", 1198 | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", 1199 | "dev": true, 1200 | "license": "MIT", 1201 | "dependencies": { 1202 | "p-locate": "^5.0.0" 1203 | }, 1204 | "engines": { 1205 | "node": ">=10" 1206 | }, 1207 | "funding": { 1208 | "url": "https://github.com/sponsors/sindresorhus" 1209 | } 1210 | }, 1211 | "node_modules/lodash.merge": { 1212 | "version": "4.6.2", 1213 | "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", 1214 | "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", 1215 | "dev": true, 1216 | "license": "MIT" 1217 | }, 1218 | "node_modules/merge2": { 1219 | "version": "1.4.1", 1220 | "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", 1221 | "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", 1222 | "dev": true, 1223 | "license": "MIT", 1224 | "engines": { 1225 | "node": ">= 8" 1226 | } 1227 | }, 1228 | "node_modules/micromatch": { 1229 | "version": "4.0.8", 1230 | "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", 1231 | "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", 1232 | "dev": true, 1233 | "license": "MIT", 1234 | "dependencies": { 1235 | "braces": "^3.0.3", 1236 | "picomatch": "^2.3.1" 1237 | }, 1238 | "engines": { 1239 | "node": ">=8.6" 1240 | } 1241 | }, 1242 | "node_modules/minimatch": { 1243 | "version": "3.1.2", 1244 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 1245 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 1246 | "dev": true, 1247 | "license": "ISC", 1248 | "dependencies": { 1249 | "brace-expansion": "^1.1.7" 1250 | }, 1251 | "engines": { 1252 | "node": "*" 1253 | } 1254 | }, 1255 | "node_modules/ms": { 1256 | "version": "2.1.3", 1257 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 1258 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 1259 | "dev": true, 1260 | "license": "MIT" 1261 | }, 1262 | "node_modules/natural-compare": { 1263 | "version": "1.4.0", 1264 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 1265 | "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", 1266 | "dev": true, 1267 | "license": "MIT" 1268 | }, 1269 | "node_modules/optionator": { 1270 | "version": "0.9.4", 1271 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", 1272 | "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", 1273 | "dev": true, 1274 | "license": "MIT", 1275 | "dependencies": { 1276 | "deep-is": "^0.1.3", 1277 | "fast-levenshtein": "^2.0.6", 1278 | "levn": "^0.4.1", 1279 | "prelude-ls": "^1.2.1", 1280 | "type-check": "^0.4.0", 1281 | "word-wrap": "^1.2.5" 1282 | }, 1283 | "engines": { 1284 | "node": ">= 0.8.0" 1285 | } 1286 | }, 1287 | "node_modules/p-limit": { 1288 | "version": "3.1.0", 1289 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", 1290 | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", 1291 | "dev": true, 1292 | "license": "MIT", 1293 | "dependencies": { 1294 | "yocto-queue": "^0.1.0" 1295 | }, 1296 | "engines": { 1297 | "node": ">=10" 1298 | }, 1299 | "funding": { 1300 | "url": "https://github.com/sponsors/sindresorhus" 1301 | } 1302 | }, 1303 | "node_modules/p-locate": { 1304 | "version": "5.0.0", 1305 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", 1306 | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", 1307 | "dev": true, 1308 | "license": "MIT", 1309 | "dependencies": { 1310 | "p-limit": "^3.0.2" 1311 | }, 1312 | "engines": { 1313 | "node": ">=10" 1314 | }, 1315 | "funding": { 1316 | "url": "https://github.com/sponsors/sindresorhus" 1317 | } 1318 | }, 1319 | "node_modules/parent-module": { 1320 | "version": "1.0.1", 1321 | "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", 1322 | "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", 1323 | "dev": true, 1324 | "license": "MIT", 1325 | "dependencies": { 1326 | "callsites": "^3.0.0" 1327 | }, 1328 | "engines": { 1329 | "node": ">=6" 1330 | } 1331 | }, 1332 | "node_modules/path-exists": { 1333 | "version": "4.0.0", 1334 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 1335 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 1336 | "dev": true, 1337 | "license": "MIT", 1338 | "engines": { 1339 | "node": ">=8" 1340 | } 1341 | }, 1342 | "node_modules/path-key": { 1343 | "version": "3.1.1", 1344 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 1345 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 1346 | "dev": true, 1347 | "license": "MIT", 1348 | "engines": { 1349 | "node": ">=8" 1350 | } 1351 | }, 1352 | "node_modules/picomatch": { 1353 | "version": "2.3.1", 1354 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 1355 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 1356 | "dev": true, 1357 | "license": "MIT", 1358 | "engines": { 1359 | "node": ">=8.6" 1360 | }, 1361 | "funding": { 1362 | "url": "https://github.com/sponsors/jonschlinkert" 1363 | } 1364 | }, 1365 | "node_modules/prelude-ls": { 1366 | "version": "1.2.1", 1367 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", 1368 | "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", 1369 | "dev": true, 1370 | "license": "MIT", 1371 | "engines": { 1372 | "node": ">= 0.8.0" 1373 | } 1374 | }, 1375 | "node_modules/prettier": { 1376 | "version": "3.4.1", 1377 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", 1378 | "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", 1379 | "dev": true, 1380 | "license": "MIT", 1381 | "bin": { 1382 | "prettier": "bin/prettier.cjs" 1383 | }, 1384 | "engines": { 1385 | "node": ">=14" 1386 | }, 1387 | "funding": { 1388 | "url": "https://github.com/prettier/prettier?sponsor=1" 1389 | } 1390 | }, 1391 | "node_modules/punycode": { 1392 | "version": "2.3.1", 1393 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", 1394 | "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", 1395 | "dev": true, 1396 | "license": "MIT", 1397 | "engines": { 1398 | "node": ">=6" 1399 | } 1400 | }, 1401 | "node_modules/queue-microtask": { 1402 | "version": "1.2.3", 1403 | "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", 1404 | "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", 1405 | "dev": true, 1406 | "funding": [ 1407 | { 1408 | "type": "github", 1409 | "url": "https://github.com/sponsors/feross" 1410 | }, 1411 | { 1412 | "type": "patreon", 1413 | "url": "https://www.patreon.com/feross" 1414 | }, 1415 | { 1416 | "type": "consulting", 1417 | "url": "https://feross.org/support" 1418 | } 1419 | ], 1420 | "license": "MIT" 1421 | }, 1422 | "node_modules/resolve-from": { 1423 | "version": "4.0.0", 1424 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", 1425 | "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", 1426 | "dev": true, 1427 | "license": "MIT", 1428 | "engines": { 1429 | "node": ">=4" 1430 | } 1431 | }, 1432 | "node_modules/reusify": { 1433 | "version": "1.0.4", 1434 | "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", 1435 | "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", 1436 | "dev": true, 1437 | "license": "MIT", 1438 | "engines": { 1439 | "iojs": ">=1.0.0", 1440 | "node": ">=0.10.0" 1441 | } 1442 | }, 1443 | "node_modules/run-parallel": { 1444 | "version": "1.2.0", 1445 | "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", 1446 | "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", 1447 | "dev": true, 1448 | "funding": [ 1449 | { 1450 | "type": "github", 1451 | "url": "https://github.com/sponsors/feross" 1452 | }, 1453 | { 1454 | "type": "patreon", 1455 | "url": "https://www.patreon.com/feross" 1456 | }, 1457 | { 1458 | "type": "consulting", 1459 | "url": "https://feross.org/support" 1460 | } 1461 | ], 1462 | "license": "MIT", 1463 | "dependencies": { 1464 | "queue-microtask": "^1.2.2" 1465 | } 1466 | }, 1467 | "node_modules/semver": { 1468 | "version": "7.6.3", 1469 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", 1470 | "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", 1471 | "dev": true, 1472 | "license": "ISC", 1473 | "bin": { 1474 | "semver": "bin/semver.js" 1475 | }, 1476 | "engines": { 1477 | "node": ">=10" 1478 | } 1479 | }, 1480 | "node_modules/shebang-command": { 1481 | "version": "2.0.0", 1482 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 1483 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 1484 | "dev": true, 1485 | "license": "MIT", 1486 | "dependencies": { 1487 | "shebang-regex": "^3.0.0" 1488 | }, 1489 | "engines": { 1490 | "node": ">=8" 1491 | } 1492 | }, 1493 | "node_modules/shebang-regex": { 1494 | "version": "3.0.0", 1495 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 1496 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 1497 | "dev": true, 1498 | "license": "MIT", 1499 | "engines": { 1500 | "node": ">=8" 1501 | } 1502 | }, 1503 | "node_modules/strip-json-comments": { 1504 | "version": "3.1.1", 1505 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", 1506 | "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", 1507 | "dev": true, 1508 | "license": "MIT", 1509 | "engines": { 1510 | "node": ">=8" 1511 | }, 1512 | "funding": { 1513 | "url": "https://github.com/sponsors/sindresorhus" 1514 | } 1515 | }, 1516 | "node_modules/supports-color": { 1517 | "version": "7.2.0", 1518 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 1519 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 1520 | "dev": true, 1521 | "license": "MIT", 1522 | "dependencies": { 1523 | "has-flag": "^4.0.0" 1524 | }, 1525 | "engines": { 1526 | "node": ">=8" 1527 | } 1528 | }, 1529 | "node_modules/to-regex-range": { 1530 | "version": "5.0.1", 1531 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 1532 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 1533 | "dev": true, 1534 | "license": "MIT", 1535 | "dependencies": { 1536 | "is-number": "^7.0.0" 1537 | }, 1538 | "engines": { 1539 | "node": ">=8.0" 1540 | } 1541 | }, 1542 | "node_modules/ts-api-utils": { 1543 | "version": "1.4.2", 1544 | "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.2.tgz", 1545 | "integrity": "sha512-ZF5gQIQa/UmzfvxbHZI3JXN0/Jt+vnAfAviNRAMc491laiK6YCLpCW9ft8oaCRFOTxCZtUTE6XB0ZQAe3olntw==", 1546 | "dev": true, 1547 | "license": "MIT", 1548 | "engines": { 1549 | "node": ">=16" 1550 | }, 1551 | "peerDependencies": { 1552 | "typescript": ">=4.2.0" 1553 | } 1554 | }, 1555 | "node_modules/type-check": { 1556 | "version": "0.4.0", 1557 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", 1558 | "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", 1559 | "dev": true, 1560 | "license": "MIT", 1561 | "dependencies": { 1562 | "prelude-ls": "^1.2.1" 1563 | }, 1564 | "engines": { 1565 | "node": ">= 0.8.0" 1566 | } 1567 | }, 1568 | "node_modules/typescript": { 1569 | "version": "5.7.2", 1570 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", 1571 | "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", 1572 | "dev": true, 1573 | "license": "Apache-2.0", 1574 | "bin": { 1575 | "tsc": "bin/tsc", 1576 | "tsserver": "bin/tsserver" 1577 | }, 1578 | "engines": { 1579 | "node": ">=14.17" 1580 | } 1581 | }, 1582 | "node_modules/typescript-eslint": { 1583 | "version": "8.16.0", 1584 | "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.16.0.tgz", 1585 | "integrity": "sha512-wDkVmlY6O2do4V+lZd0GtRfbtXbeD0q9WygwXXSJnC1xorE8eqyC2L1tJimqpSeFrOzRlYtWnUp/uzgHQOgfBQ==", 1586 | "dev": true, 1587 | "license": "MIT", 1588 | "dependencies": { 1589 | "@typescript-eslint/eslint-plugin": "8.16.0", 1590 | "@typescript-eslint/parser": "8.16.0", 1591 | "@typescript-eslint/utils": "8.16.0" 1592 | }, 1593 | "engines": { 1594 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 1595 | }, 1596 | "funding": { 1597 | "type": "opencollective", 1598 | "url": "https://opencollective.com/typescript-eslint" 1599 | }, 1600 | "peerDependencies": { 1601 | "eslint": "^8.57.0 || ^9.0.0" 1602 | }, 1603 | "peerDependenciesMeta": { 1604 | "typescript": { 1605 | "optional": true 1606 | } 1607 | } 1608 | }, 1609 | "node_modules/uri-js": { 1610 | "version": "4.4.1", 1611 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", 1612 | "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", 1613 | "dev": true, 1614 | "license": "BSD-2-Clause", 1615 | "dependencies": { 1616 | "punycode": "^2.1.0" 1617 | } 1618 | }, 1619 | "node_modules/which": { 1620 | "version": "2.0.2", 1621 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 1622 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 1623 | "dev": true, 1624 | "license": "ISC", 1625 | "dependencies": { 1626 | "isexe": "^2.0.0" 1627 | }, 1628 | "bin": { 1629 | "node-which": "bin/node-which" 1630 | }, 1631 | "engines": { 1632 | "node": ">= 8" 1633 | } 1634 | }, 1635 | "node_modules/word-wrap": { 1636 | "version": "1.2.5", 1637 | "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", 1638 | "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", 1639 | "dev": true, 1640 | "license": "MIT", 1641 | "engines": { 1642 | "node": ">=0.10.0" 1643 | } 1644 | }, 1645 | "node_modules/yocto-queue": { 1646 | "version": "0.1.0", 1647 | "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", 1648 | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", 1649 | "dev": true, 1650 | "license": "MIT", 1651 | "engines": { 1652 | "node": ">=10" 1653 | }, 1654 | "funding": { 1655 | "url": "https://github.com/sponsors/sindresorhus" 1656 | } 1657 | } 1658 | } 1659 | } 1660 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord.js-docs", 3 | "version": "0.4.3", 4 | "description": "A discord.js docs parser and wrapper.", 5 | "main": "dist/index.js", 6 | "types": "dist/index.d.ts", 7 | "repository": { 8 | "url": "git@github.com:TeeSeal/discord.js-docs.git" 9 | }, 10 | "author": "TeeSeal ", 11 | "license": "MIT", 12 | "type": "module", 13 | "scripts": { 14 | "build": "tsc", 15 | "format": "eslint --fix ./src", 16 | "prepare": "npm run build" 17 | }, 18 | "dependencies": { 19 | "common-tags": "^1.8.2", 20 | "discord-api-types": "^0.37.109", 21 | "fuse.js": "^7.0.0" 22 | }, 23 | "devDependencies": { 24 | "@stylistic/eslint-plugin-js": "^2.11.0", 25 | "@types/common-tags": "^1.8.4", 26 | "eslint": "^9.15.0", 27 | "prettier": "^3.4.1", 28 | "typescript": "^5.7.2", 29 | "typescript-eslint": "^8.16.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Doc.ts: -------------------------------------------------------------------------------- 1 | import sourcesJSON from './sources.js'; 2 | import Fuse from 'fuse.js'; 3 | import { DocAllTypes, DocBase } from './DocBase.js'; 4 | import { DocElementJSON, EmbedOptions } from './DocElement.js'; 5 | import { DocClass } from './DocClass.js'; 6 | import { DocTypedef } from './DocTypedef.js'; 7 | import { DocInterface } from './DocInterface.js'; 8 | import { APIEmbed } from './MessageEmbed.js'; 9 | import { DataJSON } from './InterfacesForDocElements.js'; 10 | 11 | type DocJSON = { 12 | classes: DocElementJSON[]; 13 | typedefs: DocElementJSON[]; 14 | interfaces: DocElementJSON[]; 15 | } 16 | 17 | type FuseFormatElement = { 18 | id: string; 19 | name: string; 20 | } 21 | 22 | const sources: { [key: string]: string } = sourcesJSON; 23 | const docCache: Map = new Map(); 24 | 25 | const DJS = 'discordjs'; 26 | const AKAIRO = 'discord-akairo'; 27 | 28 | function dissectURL(url: string): [string, string, string] { 29 | const replacedURL = url.replace('https://raw.githubusercontent.com/', ''); 30 | if (replacedURL.startsWith('discordjs')) { 31 | const splitterRegex = 32 | /(?:discordjs|discord-akairo)\/(?:docs\/main\/)?(?[^/]*)\/(?:docs\/)?(?[^/]*)/; 33 | const { repo = 'unknown', branch = 'Unknown' } = replacedURL.match(splitterRegex)?.groups ?? {}; 34 | return ['discordjs', repo, branch.replace('.json', '')]; 35 | } 36 | const parts = replacedURL.split('/'); 37 | return [parts[0], parts[1], parts[3].slice(0, -5)]; 38 | } 39 | 40 | export class Doc extends DocBase { 41 | public project: string; 42 | public repo: string; 43 | public branch: string; 44 | public fuse: Fuse; 45 | 46 | constructor(public url: string, docs: DataJSON) { 47 | super(docs); 48 | // this.url = url; 49 | [this.project, this.repo, this.branch] = dissectURL(url); 50 | 51 | this.adoptAll(docs.classes, DocClass); 52 | this.adoptAll(docs.typedefs, DocTypedef); 53 | this.adoptAll(docs.interfaces, DocInterface); 54 | 55 | this.fuse = new Fuse(this.toFuseFormat(), { 56 | shouldSort: true, 57 | threshold: 0.5, 58 | location: 0, 59 | distance: 80, 60 | minMatchCharLength: 1, 61 | keys: ['name', 'id'], 62 | }); 63 | } 64 | 65 | get repoURL(): string { 66 | return `https://github.com/${this.project}/${this.repo}/blob/${this.branch}`; 67 | } 68 | 69 | get baseURL(): string | null { 70 | switch (this.project) { 71 | case DJS: 72 | return 'https://discord.js.org'; 73 | case AKAIRO: 74 | return 'https://discord-akairo.github.io'; 75 | default: 76 | return null; 77 | } 78 | } 79 | 80 | get baseDocsURL(): string | null { 81 | if (!this.baseURL) return null; 82 | const repo = [AKAIRO].includes(this.repo) ? 'main' : this.repo; 83 | return `${this.baseURL}/#/docs/${repo}/${this.branch}`; 84 | } 85 | 86 | get icon(): string | null { 87 | if (!this.baseURL) return null; 88 | return this.baseURL === 'https://discord-akairo.github.io' 89 | ? `${this.baseURL}/static/favicon.ico` 90 | : `${this.baseURL}/favicon.ico`; 91 | } 92 | 93 | get color(): number | null { 94 | switch (this.project) { 95 | case DJS: 96 | return 0x2296f3; 97 | case AKAIRO: 98 | return 0x87202f; 99 | default: 100 | return null; 101 | } 102 | } 103 | 104 | get(...terms: string[]): DocAllTypes | null { 105 | const lowerCasedTerms = terms.filter((term) => term).map((term) => term.toLowerCase()); 106 | const parentTerm = lowerCasedTerms.shift(); 107 | if (!parentTerm) return null; 108 | let elem = this.findChild(parentTerm); 109 | if (!elem || !lowerCasedTerms.length) return elem || null; 110 | while (lowerCasedTerms.length) { 111 | const term = lowerCasedTerms.shift(); 112 | if (!term || !elem) return null; 113 | const child = elem.findChild(term); 114 | 115 | if (!child) return null; 116 | elem = lowerCasedTerms.length && child.typeElement ? child.typeElement : child; 117 | } 118 | 119 | return elem; 120 | } 121 | 122 | private _getWithExclude(...terms: [Array, ...string[]]): DocAllTypes | null { 123 | const exclude = (Array.isArray(terms[0]) ? terms.shift() : []) as DocAllTypes[]; 124 | const remainingTerms = terms as string[]; 125 | const lowerCasedTerms = remainingTerms.filter((term) => term).map((term) => term.toLowerCase()); 126 | const parentTerm = lowerCasedTerms.shift(); 127 | if (!parentTerm) return null; 128 | let elem = this.findChild(parentTerm); 129 | if (!elem || !lowerCasedTerms.length) return elem || null; 130 | while (lowerCasedTerms.length) { 131 | const term = lowerCasedTerms.shift(); 132 | if (!term || !elem) return null; 133 | const child = elem.findChild(term, exclude); 134 | 135 | if (!child) return null; 136 | elem = lowerCasedTerms.length && child.typeElement ? child.typeElement : child; 137 | } 138 | 139 | return elem; 140 | } 141 | 142 | search(query: string, { excludePrivateElements, maxResults = 10 }: EmbedOptions = {}): DocAllTypes[] | null { 143 | const result = this.fuse.search(query); 144 | if (!result.length) return null; 145 | 146 | const filtered: DocAllTypes[] = []; 147 | 148 | while (result.length > 0 && filtered.length < maxResults) { 149 | const firstResult = result.shift(); 150 | if (!firstResult) continue; 151 | //@ts-ignore 152 | const element = this._getWithExclude(filtered, ...firstResult.item.name.split("#")); 153 | if (excludePrivateElements && element?.access === 'private') continue; 154 | if (element) filtered.push(element); 155 | } 156 | 157 | return filtered; 158 | } 159 | 160 | resolveEmbed(query: string, options: EmbedOptions = {}): APIEmbed | null { 161 | const element = this.get(...query.split(/\.|#/)); 162 | if (element) return element.embed(options); 163 | 164 | const searchResults = this.search(query, options); 165 | if (!searchResults) return null; 166 | 167 | const embed = this.baseEmbed(); 168 | embed.title = 'Search results:'; 169 | embed.description = searchResults 170 | .map((el) => { 171 | const prefix = el.embedPrefix; 172 | return `${prefix ? `${prefix} ` : ''}**${el.link}**`; 173 | }) 174 | .join('\n'); 175 | return embed; 176 | } 177 | 178 | toFuseFormat(): FuseFormatElement[] { 179 | const parents = Array.from(this.children.values()); 180 | 181 | const children = parents.map((parent) => Array.from(parent.children.values())).reduce((a, b) => a.concat(b)); 182 | 183 | const formattedParents = parents.map(({ name }) => ({ id: name!, name: name! })); 184 | const formattedChildren = children.map(({ name, parent }) => ({ id: `${parent?.name}#${name}`, name: name! })); 185 | 186 | return formattedParents.concat(formattedChildren); 187 | } 188 | 189 | toJSON(): DocJSON { 190 | const json: DocJSON = { classes: [], typedefs: [], interfaces: [] }; 191 | 192 | for (const key of ['classes', 'typedefs', 'interfaces'] as const) { 193 | const thisKey = this[key]; 194 | if (!thisKey) continue; 195 | json[key] = thisKey.map((item) => item.toJSON()); 196 | } 197 | 198 | return json; 199 | } 200 | 201 | baseEmbed(): APIEmbed { 202 | const title = 203 | { 204 | 'discord.js': 'Discord.js Docs', 205 | commando: 'Commando Docs', 206 | rpc: 'RPC Docs', 207 | 'discord-akairo': 'Akairo Docs', 208 | collection: 'Collection', 209 | }[this.repo] || this.repo; 210 | 211 | return { 212 | color: this.color || undefined, 213 | author: { 214 | name: `${title} (${this.branch})`, 215 | url: this.baseDocsURL || undefined, 216 | icon_url: this.icon || undefined, 217 | }, 218 | }; 219 | } 220 | 221 | formatType(types: string[]): string { 222 | const typestring = types 223 | .map((text, index) => { 224 | if (/<|>|\*/.test(text)) { 225 | return text 226 | .split('') 227 | .map((char) => `\\${char}`) 228 | .join(''); 229 | } 230 | 231 | const typeElem = this.findChild(text.toLowerCase()); 232 | const prependOr = index !== 0 && /\w|>/.test(types[index - 1]) && /\w/.test(text); 233 | 234 | return (prependOr ? '|' : '') + (typeElem ? typeElem.link : text); 235 | }) 236 | .join(''); 237 | 238 | return `**${typestring}**`; 239 | } 240 | 241 | static getRepoURL(id: string): string { 242 | const [name, branch] = id.split('/'); 243 | const project = { 244 | main: 'discord.js', 245 | commando: 'Commando', 246 | rpc: 'RPC', 247 | }[name]; 248 | 249 | return `https://github.com/discordjs/${project}/blob/${branch}/`; 250 | } 251 | 252 | static sources(): typeof sources { 253 | return sources; 254 | } 255 | 256 | static async fetch(sourceName: string, { force }: { force?: boolean } = {}): Promise { 257 | const url = sources[sourceName] || sourceName; 258 | const cachedDoc = docCache.get(url); 259 | if (!force && cachedDoc) return cachedDoc; 260 | 261 | try { 262 | const response = await fetch(url); 263 | 264 | if (!response) { 265 | throw new Error(response); 266 | } 267 | 268 | const data = await response.json(); 269 | const doc = new Doc(url, data); 270 | docCache.set(url, doc); 271 | return doc; 272 | } catch (err) { 273 | throw new Error(`Invalid source name or URL: ${err}`); 274 | } 275 | } 276 | } 277 | -------------------------------------------------------------------------------- /src/DocBase.ts: -------------------------------------------------------------------------------- 1 | import { DocClass } from './DocClass.js'; 2 | import { RawDocumentedElement } from './DocElement.js'; 3 | import { DocEvent } from './DocEvent.js'; 4 | import { DocInterface } from './DocInterface.js'; 5 | import { DocMethod } from './DocMethod.js'; 6 | import { DocParam } from './DocParam.js'; 7 | import { DocProp } from './DocProp.js'; 8 | import { DocTypedef } from './DocTypedef.js'; 9 | 10 | export enum types { 11 | CLASS = 'class', 12 | EVENT = 'event', 13 | INTERFACE = 'interface', 14 | METHOD = 'method', 15 | PARAM = 'param', 16 | PROP = 'prop', 17 | TYPEDEF = 'typedef', 18 | } 19 | 20 | type typesMapper = { 21 | class: DocClass; 22 | event: DocEvent; 23 | interface: DocInterface; 24 | method: DocMethod; 25 | param: DocParam; 26 | prop: DocProp; 27 | typedef: DocTypedef; 28 | } 29 | 30 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 31 | export type Constr = new (...args: any[]) => T; 32 | export type DocParentTypes = DocClass | DocInterface | DocMethod | DocEvent; 33 | export type DocAllTypes = DocClass | DocEvent | DocInterface | DocMethod | DocParam | DocProp | DocTypedef; 34 | export class DocBase { 35 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 36 | public originalJSON: any; 37 | public children: Map; 38 | 39 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 40 | constructor(json: any) { 41 | this.originalJSON = json; 42 | this.children = new Map(); 43 | } 44 | 45 | addChild(child: DocAllTypes): void { 46 | this.children.set(`${child.name?.toLowerCase()}-${child.docType}`, child); 47 | } 48 | 49 | adoptAll(enumerable: RawDocumentedElement[], Constructor: Constr): void { 50 | if (!enumerable) return; 51 | for (const elem of enumerable) { 52 | this.addChild(new Constructor(this, elem)); 53 | } 54 | } 55 | 56 | childrenOfType(type: t): Array | null { 57 | const filtered = Array.from(this.children.values()).filter( 58 | (child) => child.docType === type, 59 | ) as typesMapper[t][]; 60 | 61 | return filtered.length ? filtered : null; 62 | } 63 | 64 | findChild(query: string, exclude: DocAllTypes[] = []): DocAllTypes | undefined { 65 | query = query.toLowerCase(); 66 | 67 | let docType: types | null = null; 68 | if (query.endsWith('()')) { 69 | query = query.slice(0, -2); 70 | docType = types.METHOD; 71 | } else if (query.startsWith('e-')) { 72 | query = query.slice(2); 73 | docType = types.EVENT; 74 | } 75 | return Array.from(this.children.values()).find( 76 | (child) => 77 | child.name && 78 | !exclude.includes(child) && 79 | child.name.toLowerCase() === query && 80 | (!docType || child.docType === docType), 81 | ); 82 | } 83 | 84 | get classes(): DocClass[] | null { 85 | return this.childrenOfType(types.CLASS); 86 | } 87 | 88 | get typedefs(): DocTypedef[] | null { 89 | return this.childrenOfType(types.TYPEDEF); 90 | } 91 | 92 | get interfaces(): DocInterface[] | null { 93 | return this.childrenOfType(types.INTERFACE); 94 | } 95 | 96 | get props(): DocProp[] | null { 97 | return this.childrenOfType(types.PROP); 98 | } 99 | 100 | get methods(): DocMethod[] | null { 101 | return this.childrenOfType(types.METHOD); 102 | } 103 | 104 | get events(): DocEvent[] | null { 105 | return this.childrenOfType(types.EVENT); 106 | } 107 | 108 | get params(): DocParam[] | null { 109 | return this.childrenOfType(types.PARAM); 110 | } 111 | 112 | static get types(): typeof types { 113 | return types; 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /src/DocClass.ts: -------------------------------------------------------------------------------- 1 | import { DocElement } from './DocElement.js'; 2 | import { DocProp } from './DocProp.js'; 3 | import { DocMethod } from './DocMethod.js'; 4 | import { DocEvent } from './DocEvent.js'; 5 | import type { Doc } from './Doc.js'; 6 | import type { 7 | RawDocumentedClass, RawDocumentedConstructor 8 | } from './InterfacesForDocElements'; 9 | 10 | export class DocClass extends DocElement { 11 | public construct: RawDocumentedConstructor; 12 | 13 | constructor(doc: Doc, data: RawDocumentedClass) { 14 | super(doc, DocElement.types.CLASS, data); 15 | this.extends = data.extends || null; 16 | this.implements = data.implements || null; 17 | this.construct = data.construct; 18 | 19 | if (data.props) this.adoptAll(data.props, DocProp); 20 | if (data.methods) this.adoptAll(data.methods, DocMethod); 21 | if (data.events) this.adoptAll(data.events, DocEvent); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DocElement.ts: -------------------------------------------------------------------------------- 1 | import { DocAllTypes, DocBase, DocParentTypes, types } from './DocBase.js'; 2 | import { stripIndents } from 'common-tags'; 3 | import type { Doc } from './Doc.js'; 4 | import { 5 | RawDocumentedItemMeta, 6 | RawDocumentedClass, 7 | RawDocumentedEvent, 8 | RawDocumentedInterface, 9 | RawDocumentedFunction, 10 | RawDocumentedParam, 11 | RawDocumentedMember, 12 | RawDocumentedTypedef, 13 | } from './InterfacesForDocElements.js'; 14 | import { 15 | JSDocDeprecated, 16 | JSDocExamples, 17 | JSDocAccess, 18 | JSDocExtends, 19 | JSDocImplements, 20 | JSDocScope, 21 | JSDocReturns, 22 | } from './JsDocTypes.js'; 23 | import { APIEmbed } from './MessageEmbed.js'; 24 | 25 | export type RawDocumentedElement = 26 | | RawDocumentedClass 27 | | RawDocumentedEvent 28 | | RawDocumentedInterface 29 | | RawDocumentedFunction 30 | | RawDocumentedParam 31 | | RawDocumentedMember 32 | | RawDocumentedTypedef; 33 | 34 | const DESCRIPTION_LIMIT = 1500; 35 | 36 | export type EmbedOptions = { 37 | excludePrivateElements?: boolean; 38 | maxResults?: number; 39 | } 40 | 41 | export type DocElementJSON = { 42 | name?: string | null; 43 | description?: string | null; 44 | internal_type?: types; 45 | props?: Array; 46 | parent?: string; 47 | methods?: Array; 48 | events?: Array; 49 | params?: DocElementJSON[]; 50 | type?: string; 51 | examples?: JSDocExamples; 52 | } 53 | 54 | export class DocElement extends DocBase { 55 | public name: string | null = null; 56 | public description: string | null = null; 57 | public meta: RawDocumentedItemMeta | null; 58 | public returns: JSDocReturns | null = null; 59 | public examples: JSDocExamples | null = null; 60 | public type: string[] | null = null; 61 | public nullable: boolean | null = null; 62 | public deprecated: JSDocDeprecated; 63 | public access: JSDocAccess | null; 64 | public extends: JSDocExtends | null = null; 65 | public implements: JSDocImplements | null = null; 66 | public scope: JSDocScope | null = null; 67 | 68 | constructor( 69 | public doc: Doc, 70 | public docType: types, 71 | data: RawDocumentedElement, 72 | public parent: DocParentTypes | null = null, 73 | ) { 74 | super(data); 75 | this.name = data.name || null; 76 | this.description = data.description || null; 77 | this.meta = 'meta' in data ? data.meta : null; 78 | this.deprecated = 'deprecated' in data && data.deprecated ? data.deprecated : false; 79 | this.access = 'access' in data && data.access ? data.access : 'public'; 80 | } 81 | 82 | get embedPrefix(): string | null { 83 | const { types } = DocElement; 84 | const emoji = (char: string) => `:regional_indicator_${char}:`; 85 | 86 | switch (this.docType) { 87 | case types.CLASS: 88 | return emoji('c'); 89 | case types.EVENT: 90 | return emoji('e'); 91 | case types.INTERFACE: 92 | return emoji('i'); 93 | case types.METHOD: 94 | return emoji('m'); 95 | case types.TYPEDEF: 96 | return emoji('t'); 97 | case types.PROP: 98 | return emoji('p'); 99 | default: 100 | return null; 101 | } 102 | } 103 | 104 | get anchor(): string | null { 105 | if (this.static) return 's-'; 106 | else if (this.docType === DocElement.types.EVENT) return 'e-'; 107 | return null; 108 | } 109 | 110 | get typeElement(): DocAllTypes | null { 111 | const { type } = this; 112 | 113 | if (!type) return null; 114 | 115 | return ( 116 | type 117 | ?.filter((text: string) => /^\w+$/.test(text)) 118 | .map((text: string) => this.doc.findChild(text.toLowerCase())) 119 | .find((elem) => elem) ?? null 120 | ); 121 | } 122 | 123 | get url(): string | null { 124 | if (!this.doc.baseDocsURL) return null; 125 | 126 | const path = this.parent 127 | ? `${this.parent.docType}/${this.parent.name}?scrollTo=${this.anchor || ''}${this.name}` 128 | : `${this.docType}/${this.name}`; 129 | 130 | return `${this.doc.baseDocsURL}/${path}`; 131 | } 132 | 133 | get sourceURL(): string | null { 134 | if (!this.doc.repoURL || !this.meta) return null; 135 | 136 | const { path, file, line } = this.meta; 137 | return `${this.doc.repoURL}/${path}/${file}#L${line}`; 138 | } 139 | 140 | get formattedName(): string | null { 141 | return this.name; 142 | } 143 | 144 | get formattedDescription(): string { 145 | let result = this.formatText(this.description); 146 | 147 | if (result.length > DESCRIPTION_LIMIT) { 148 | result = 149 | result.slice(0, DESCRIPTION_LIMIT) + 150 | `...\nDescription truncated. View full description [here](${this.url}).`; 151 | } 152 | 153 | return result; 154 | } 155 | 156 | get formattedReturn(): string { 157 | if (this.returns) return ''; 158 | return this.formatText(this.returns); 159 | } 160 | 161 | get formattedType(): string { 162 | const { type: thisType } = this; 163 | if (!thisType) return ''; 164 | return `${this.nullable ? '?' : ''}${this.doc.formatType(thisType)}`; 165 | } 166 | 167 | get formattedExtends(): string { 168 | const { extends: thisExtends } = this; 169 | if (!thisExtends) return ''; 170 | return `(extends ${this.formatInherits(thisExtends)})`; 171 | } 172 | 173 | get formattedImplements(): string { 174 | const { implements: thisImplements } = this; 175 | if (!thisImplements) return ''; 176 | return `(implements ${this.formatInherits(thisImplements)})`; 177 | } 178 | 179 | get link(): string { 180 | return `[${this.formattedName}](${this.url})`; 181 | } 182 | 183 | get static(): boolean { 184 | return this.scope === 'static'; 185 | } 186 | 187 | embed(options = {}): APIEmbed { 188 | const embed = this.doc.baseEmbed(); 189 | let name = `__**${this.link}**__`; 190 | 191 | if (this.extends) name += ` ${this.formattedExtends}`; 192 | if (this.implements) name += ` ${this.formattedImplements}`; 193 | if (this.access === 'private') name += ' **PRIVATE**'; 194 | if (this.deprecated) name += ' **DEPRECATED**'; 195 | 196 | embed.description = `${name}\n${this.formattedDescription}`; 197 | if (this.url) embed.url = this.url; 198 | embed.fields = []; 199 | this.formatEmbed(embed, options); 200 | embed.fields.push({ 201 | name: '\u200b', 202 | value: `[View source](${this.sourceURL})`, 203 | }); 204 | 205 | return embed; 206 | } 207 | 208 | formatEmbed(embed: APIEmbed, options: EmbedOptions = {}): void { 209 | this.attachProps(embed, options); 210 | this.attachMethods(embed, options); 211 | this.attachEvents(embed); 212 | this.attachParams(embed); 213 | this.attachType(embed); 214 | this.attachReturn(embed); 215 | this.attachExamples(embed); 216 | } 217 | 218 | attachProps(embed: APIEmbed, { excludePrivateElements }: EmbedOptions = {}): void { 219 | if (!this.props) return; 220 | 221 | let props = this.props; 222 | if (excludePrivateElements) props = props.filter((prop) => prop.access !== 'private'); 223 | if (props.length === 0) return; 224 | if (!embed.fields) embed.fields = []; 225 | 226 | embed.fields.push({ 227 | name: 'Properties', 228 | value: props.map((prop) => `\`${prop.name}\``).join(' '), 229 | }); 230 | } 231 | 232 | attachMethods(embed: APIEmbed, { excludePrivateElements }: EmbedOptions = {}): void { 233 | if (!this.methods) return; 234 | 235 | let methods = this.methods; 236 | if (excludePrivateElements) methods = methods.filter((prop) => prop.access !== 'private'); 237 | if (methods.length === 0) return; 238 | if (!embed.fields) embed.fields = []; 239 | 240 | embed.fields.push({ 241 | name: 'Methods', 242 | value: methods.map((method) => `\`${method.name}\``).join(' '), 243 | }); 244 | } 245 | 246 | attachEvents(embed: APIEmbed): void { 247 | if (!this.events) return; 248 | if (!embed.fields) embed.fields = []; 249 | 250 | embed.fields.push({ 251 | name: 'Events', 252 | value: this.events.map((event) => `\`${event.name}\``).join(' '), 253 | }); 254 | } 255 | 256 | attachParams(embed: APIEmbed): void { 257 | if (!this.params) return; 258 | const params = this.params.map( 259 | (param) => 260 | stripIndents` 261 | ${param.formattedName} ${param.formattedType} 262 | ${param.formattedDescription} 263 | `, 264 | ); 265 | 266 | const slice = params.splice(0, 5); 267 | if (!embed.fields) embed.fields = []; 268 | embed.fields.push({ name: 'Params', value: slice.join('\n\n') }); 269 | 270 | while (params.length > 0) { 271 | const slice = params.splice(0, 5); 272 | embed.fields.push({ name: '\u200b', value: slice.join('\n\n') }); 273 | } 274 | } 275 | 276 | attachReturn(embed: APIEmbed): void { 277 | if (!this.returns) return; 278 | if (!embed.fields) embed.fields = []; 279 | embed.fields.push({ 280 | name: 'Returns', 281 | value: this.formattedReturn, 282 | }); 283 | } 284 | 285 | attachType(embed: APIEmbed): void { 286 | if (!this.type) return; 287 | if (!embed.fields) embed.fields = []; 288 | embed.fields.push({ 289 | name: 'Type', 290 | value: this.formattedType, 291 | }); 292 | } 293 | 294 | attachExamples(embed: APIEmbed): void { 295 | if (!this.examples) return; 296 | if (!embed.fields) embed.fields = []; 297 | embed.fields.push({ 298 | name: 'Examples', 299 | value: this.examples.map((ex) => `\`\`\`js\n${ex}\n\`\`\``).join('\n'), 300 | }); 301 | } 302 | 303 | toJSON(): DocElementJSON { 304 | const json: DocElementJSON = { 305 | name: this.name, 306 | description: this.description, 307 | internal_type: this.docType, 308 | }; 309 | 310 | if (this.props) json.props = this.props.map((prop) => prop.name); 311 | if (this.parent) json.parent = this.parent.name || undefined; 312 | if (this.methods) json.methods = this.methods.map((method) => method.name); 313 | if (this.events) json.events = this.events.map((event) => event.name); 314 | if (this.params) json.params = this.params.map((param) => param.toJSON()); 315 | if (this.type) json.type = this.type.join(''); 316 | if (this.examples) json.examples = this.examples; 317 | 318 | return json; 319 | } 320 | 321 | formatInherits(inherits: JSDocImplements): string { 322 | const flatInherits = inherits.flat(Infinity) as string[]; 323 | return flatInherits.map((baseClass) => this.doc.formatType([baseClass])).join(' and '); 324 | } 325 | 326 | formatText(text: string | null | undefined): string { 327 | if (!text) return ''; 328 | 329 | return text 330 | .replace(/\{@link (.+?)\}/g, (match, name) => { 331 | const element = this.doc.get(...name.split(/\.|#/)); 332 | return element ? element.link : name; 333 | }) 334 | .replace(/(```[^]+?```)|(^[*-].+$)?\n(?![*-])/gm, (match, codeblock, hasListBefore) => { 335 | if (codeblock) return codeblock; 336 | if (hasListBefore) return match; 337 | return ' '; 338 | }) 339 | .replace(/<(info|warn)>([^]+?)<\/(?:\1)>/g, '\n**$2**\n') 340 | .replace(/<\/?p>/g, '') // remove paragraph tags 341 | .replace(/<\/?code>/g, '`') // format code tags 342 | .replace(/(.+)<\/a>/g, '[$2]($1)'); // format anchor tags 343 | } 344 | 345 | static get types(): typeof types { 346 | return DocBase.types; 347 | } 348 | } 349 | -------------------------------------------------------------------------------- /src/DocEvent.ts: -------------------------------------------------------------------------------- 1 | import { DocElement } from './DocElement.js'; 2 | import { DocParam } from './DocParam.js'; 3 | import type { DocParentTypes } from './DocBase.js'; 4 | import { RawDocumentedEvent } from './InterfacesForDocElements.js'; 5 | 6 | export class DocEvent extends DocElement { 7 | constructor(parent: DocParentTypes, data: RawDocumentedEvent) { 8 | super(parent.doc, DocElement.types.EVENT, data, parent); 9 | if (data.params) this.adoptAll(data.params, DocParam); 10 | } 11 | 12 | get formattedName(): string { 13 | if (!this.parent) return ''; 14 | return `${this.parent.name}#${this.name}`; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DocInterface.ts: -------------------------------------------------------------------------------- 1 | import { DocElement } from './DocElement.js'; 2 | import { DocProp } from './DocProp.js'; 3 | import { DocMethod } from './DocMethod.js'; 4 | import type { Doc } from './Doc.js'; 5 | import { RawDocumentedInterface } from './InterfacesForDocElements.js'; 6 | 7 | export class DocInterface extends DocElement { 8 | constructor(doc: Doc, data: RawDocumentedInterface) { 9 | super(doc, DocElement.types.INTERFACE, data); 10 | if (data.props) this.adoptAll(data.props, DocProp); 11 | if (data.methods) this.adoptAll(data.methods, DocMethod); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DocMethod.ts: -------------------------------------------------------------------------------- 1 | import { DocElement, DocElementJSON } from './DocElement.js'; 2 | import { DocParam } from './DocParam.js'; 3 | import type { DocParentTypes } from './DocBase.js'; 4 | import { RawDocumentedFunction } from './InterfacesForDocElements.js'; 5 | 6 | interface DocMethodJSON extends DocElementJSON { 7 | returns: { type: string; description?: string }; 8 | } 9 | 10 | export class DocMethod extends DocElement { 11 | constructor(parent: DocParentTypes, data: RawDocumentedFunction) { 12 | super(parent.doc, DocElement.types.METHOD, data, parent); 13 | 14 | this.examples = data.examples || null; 15 | this.returns = data.returns || null; 16 | this.scope = data.scope || null; 17 | if (data.params) this.adoptAll(data.params, DocParam); 18 | } 19 | 20 | get formattedName(): string { 21 | if (!this.parent) return ''; 22 | return [this.parent.name, this.static ? '.' : '#', this.name, '()'].join(''); 23 | } 24 | 25 | get formattedReturn(): string { 26 | if (!this.returns) return '**Void**'; 27 | const returnTypes = ('types' in this.returns ? this.returns.types : this.returns) 28 | .map((type) => this.doc.formatType(Array.isArray(type) ? type.flat(5) : [type])) 29 | .join(' or '); 30 | 31 | return [returnTypes, 'description' in this.returns ? this.formatText(this.returns.description) : ''] 32 | .filter((text) => text) 33 | .join('\n'); 34 | } 35 | 36 | get static(): boolean { 37 | return this.scope === 'static'; 38 | } 39 | 40 | toJSON(): DocMethodJSON { 41 | const returnType = this.returns 42 | ? ('types' in this.returns ? this.returns.types : this.returns).flat(5).join('') 43 | : 'void'; 44 | 45 | const json: DocMethodJSON = { returns: { type: returnType }, ...super.toJSON() }; 46 | if (this.returns && 'description' in this.returns) { 47 | json.returns.description = this.returns.description; 48 | } 49 | 50 | return json; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/DocParam.ts: -------------------------------------------------------------------------------- 1 | import { DocElement } from './DocElement.js'; 2 | import type { DocParentTypes } from './DocBase.js'; 3 | import { RawDocumentedParam } from './InterfacesForDocElements.js'; 4 | 5 | export class DocParam extends DocElement { 6 | public optional: boolean | undefined; 7 | public variable: boolean | undefined; 8 | 9 | constructor(parent: DocParentTypes, data: RawDocumentedParam) { 10 | super(parent.doc, DocElement.types.PARAM, data, parent); 11 | this.type = data.type?.flat(5) || null; 12 | this.optional = data.optional; 13 | this.variable = data.variable; 14 | } 15 | 16 | get formattedName(): string { 17 | return this.optional ? `\`[${this.name}]\`` : `\`${this.name}\``; 18 | } 19 | 20 | get formattedType(): string { 21 | if (!this.variable) return super.formattedType; 22 | return super.formattedType 23 | .split('|') 24 | .map((param) => `...${param}`) 25 | .join('|'); 26 | } 27 | 28 | get url(): null { 29 | return null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/DocProp.ts: -------------------------------------------------------------------------------- 1 | import { DocElement } from './DocElement.js'; 2 | import type { DocParentTypes } from './DocBase.js'; 3 | import { RawDocumentedMember } from './InterfacesForDocElements.js'; 4 | 5 | export class DocProp extends DocElement { 6 | constructor(parent: DocParentTypes, data: RawDocumentedMember) { 7 | super(parent.doc, DocElement.types.PROP, data, parent); 8 | this.scope = data.scope || null; 9 | this.type = (Array.isArray(data.type) ? data.type : data.type?.types)?.flat(5) || null; 10 | this.nullable = data.nullable || false; 11 | } 12 | 13 | get formattedName(): string { 14 | if (!this.parent) return ''; 15 | return [this.parent.name, this.static ? '.' : '#', this.name].join(''); 16 | } 17 | 18 | get static(): boolean { 19 | return this.scope === 'static'; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DocTypedef.ts: -------------------------------------------------------------------------------- 1 | import type { Doc } from './Doc.js'; 2 | import { DocElement } from './DocElement.js'; 3 | import { RawDocumentedTypedef } from './InterfacesForDocElements.js'; 4 | 5 | export class DocTypedef extends DocElement { 6 | constructor(doc: Doc, data: RawDocumentedTypedef) { 7 | super(doc, DocElement.types.TYPEDEF, data); 8 | this.type = (Array.isArray(data.type) ? data.type : data.type?.types)?.flat(5) || null; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/InterfacesForDocElements.ts: -------------------------------------------------------------------------------- 1 | import { 2 | JSDocAbstract, 3 | JSDocAccess, 4 | JSDocAsync, 5 | JSDocDefault, 6 | JSDocDeprecated, 7 | JSDocEmits, 8 | JSDocExamples, 9 | JSDocExtends, 10 | JSDocGenerator, 11 | JSDocImplements, 12 | JSDocReadonly, 13 | JSDocReturns, 14 | JSDocScope, 15 | JSDocSee, 16 | JSDocThrows, 17 | JSDocVirtual, 18 | SplitNameWithAnyType, 19 | } from './JsDocTypes.js'; 20 | 21 | export type RawDocumentedVarType = | SplitNameWithAnyType[] | { types: SplitNameWithAnyType[]; description?: string; nullable?: true }; 22 | 23 | export type RawDocumentedItemMeta = { 24 | line: number; 25 | file: string; 26 | path: string; 27 | } 28 | 29 | export type RawDocumentedParam = { 30 | name?: string; 31 | description?: string; 32 | optional?: boolean; 33 | default?: boolean | string | number | null; 34 | variable?: boolean; 35 | nullable?: boolean; 36 | type?: SplitNameWithAnyType[]; 37 | } 38 | 39 | export type RawDocumentedFunction = { 40 | name?: string; 41 | description?: string; 42 | see?: JSDocSee; 43 | scope?: JSDocScope | undefined; 44 | access?: JSDocAccess; 45 | inherits?: string; 46 | inherited?: boolean; 47 | implements?: JSDocImplements; 48 | examples?: JSDocExamples; 49 | abstract?: JSDocAbstract; 50 | deprecated?: JSDocDeprecated; 51 | emits?: JSDocEmits; 52 | //* As of writing, this will always be undefined since discord.js' docgen uses throws instead of exception 53 | throws?: JSDocThrows | undefined; 54 | params?: RawDocumentedParam[] | undefined; 55 | async?: JSDocAsync; 56 | generator?: JSDocGenerator; 57 | returns?: JSDocReturns | undefined; 58 | returnsDescription?: string; 59 | meta: RawDocumentedItemMeta; 60 | } 61 | 62 | export type RawDocumentedEvent = { 63 | name?: string; 64 | description?: string; 65 | see?: JSDocSee; 66 | deprecated?: JSDocDeprecated; 67 | params?: RawDocumentedParam[] | undefined; 68 | meta: RawDocumentedItemMeta; 69 | } 70 | 71 | export type RawDocumentedConstructor = { 72 | name?: string; 73 | description?: string; 74 | see?: JSDocSee; 75 | access?: JSDocAccess; 76 | params?: RawDocumentedParam[] | undefined; 77 | } 78 | 79 | export type RawDocumentedMember = { 80 | name?: string; 81 | description?: string; 82 | see?: JSDocSee; 83 | scope?: JSDocScope | undefined; 84 | access?: JSDocAccess; 85 | readonly?: JSDocReadonly; 86 | nullable?: boolean; 87 | abstract?: JSDocVirtual; 88 | deprecated?: JSDocDeprecated; 89 | default?: JSDocDefault; 90 | type?: RawDocumentedVarType; 91 | props?: RawDocumentedParam[] | undefined; 92 | meta: RawDocumentedItemMeta; 93 | } 94 | 95 | export type RawDocumentedClass = { 96 | name?: string; 97 | description?: string; 98 | see?: JSDocSee; 99 | extends?: JSDocExtends; 100 | implements?: JSDocImplements; 101 | access?: JSDocAccess; 102 | abstract?: JSDocAbstract; 103 | deprecated?: JSDocDeprecated; 104 | construct: RawDocumentedConstructor; 105 | props?: RawDocumentedMember[] | undefined; 106 | methods?: RawDocumentedFunction[] | undefined; 107 | events?: RawDocumentedEvent[] | undefined; 108 | meta: RawDocumentedItemMeta; 109 | } 110 | 111 | export type RawDocumentedInterface = RawDocumentedClass; 112 | 113 | export type RawDocumentedTypedef = { 114 | name?: string; 115 | description?: string; 116 | see?: JSDocSee; 117 | access?: JSDocAccess; 118 | deprecated?: JSDocDeprecated; 119 | type?: RawDocumentedVarType; 120 | props?: RawDocumentedParam[] | undefined; 121 | params?: RawDocumentedParam[] | undefined; 122 | returns?: RawDocumentedVarType | undefined; 123 | returnsDescription?: string; 124 | meta: RawDocumentedItemMeta; 125 | } 126 | 127 | export type RawDocumentedExternal = { 128 | name: string; 129 | see: string[]; 130 | meta: RawDocumentedItemMeta; 131 | } 132 | 133 | export type DataJSON = { 134 | meta: MainMeta; 135 | classes: RawDocumentedClass[]; 136 | interfaces: RawDocumentedInterface[]; 137 | typedefs: RawDocumentedTypedef[]; 138 | externals: RawDocumentedExternal[]; 139 | } 140 | 141 | export type MainMeta = { 142 | generator: string; 143 | format: number; 144 | date: number; 145 | } 146 | -------------------------------------------------------------------------------- /src/JsDocTypes.ts: -------------------------------------------------------------------------------- 1 | export type SplitNameWithAnyType = Array; 2 | export type JSDocAbstract = boolean; 3 | export type JSDocVirtual = boolean; 4 | export type JSDocAccess = 'package' | 'private' | 'protected' | 'public'; 5 | export type JSDocAsync = boolean; 6 | export type JSDocExtends = Array | Array>; 7 | export type JSDocDefault = boolean | string | number | null; 8 | export type JSDocDeprecated = boolean | string; 9 | export type JSDocExamples = string[]; 10 | export type JSDocEmits = string[]; 11 | export type JSDocImplements = Array | Array>; 12 | export type JSDocGenerator = boolean; 13 | export type JSDocReadonly = boolean; 14 | export type JSDocReturns = 15 | | SplitNameWithAnyType[] 16 | | { types: SplitNameWithAnyType; description?: string; nullable?: true }; 17 | 18 | export type JSDocReturn = 19 | | SplitNameWithAnyType[] 20 | | { types: SplitNameWithAnyType; description?: string; nullable?: true }; 21 | 22 | export type JSDocThrows = 23 | | SplitNameWithAnyType[] 24 | | { types: SplitNameWithAnyType; description?: string; nullable?: true }; 25 | 26 | export type JSDocSee = Array; 27 | export type JSDocType = SplitNameWithAnyType[]; 28 | export type JSDocScope = 'static'; 29 | -------------------------------------------------------------------------------- /src/MessageEmbed.ts: -------------------------------------------------------------------------------- 1 | export { APIEmbed } from 'discord-api-types/v9'; -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { Doc } from './Doc.js'; 2 | import sources from './sources.js'; 3 | 4 | export default Doc; 5 | export { sources }; 6 | -------------------------------------------------------------------------------- /src/sources.ts: -------------------------------------------------------------------------------- 1 | const sources = { 2 | 'stable': 'https://raw.githubusercontent.com/discordjs/docs/main/discord.js/stable.json', 3 | 'main': 'https://raw.githubusercontent.com/discordjs/docs/main/discord.js/main.json', 4 | 'commando': 'https://raw.githubusercontent.com/discordjs/commando/docs/master.json', 5 | 'rpc': 'https://raw.githubusercontent.com/discordjs/rpc/docs/master.json', 6 | 'akairo': 'https://raw.githubusercontent.com/discord-akairo/discord-akairo/docs/master.json', 7 | 'collection': 'https://raw.githubusercontent.com/discordjs/docs/main/collection/main.json', 8 | 'builders': 'https://raw.githubusercontent.com/discordjs/docs/main/builders/main.json', 9 | 'voice': 'https://raw.githubusercontent.com/discordjs/docs/main/voice/main.json', 10 | 'rest': 'https://raw.githubusercontent.com/discordjs/docs/main/rest/main.json' 11 | }; 12 | 13 | export default sources; 14 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | /* Basic Options */ 5 | // "incremental": true, /* Enable incremental compilation */ 6 | "target": "ES2023", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 7 | "module": "ESNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 8 | "lib": [ 9 | "esnext", 10 | "dom" 11 | ], /* Specify library files to be included in the compilation. */ 12 | // "allowJs": true, /* Allow javascript files to be compiled. */ 13 | // "checkJs": true, /* Report errors in .js files. */ 14 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 15 | "declaration": true, /* Generates corresponding '.d.ts' file. */ 16 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 17 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 18 | // "outFile": "./", /* Concatenate and emit output to single file. */ 19 | "outDir": "./dist", /* Redirect output structure to the directory. */ 20 | "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 21 | // "composite": true, /* Enable project compilation */ 22 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 23 | // "removeComments": true, /* Do not emit comments to output. */ 24 | // "noEmit": true, /* Do not emit outputs. */ 25 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 26 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 27 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 28 | /* Strict Type-Checking Options */ 29 | "strict": true, /* Enable all strict type-checking options. */ 30 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 31 | // "strictNullChecks": true, /* Enable strict null checks. */ 32 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 33 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 34 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 35 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 36 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | /* Module Resolution Options */ 43 | "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 44 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 45 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 46 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 47 | // "typeRoots": [], /* List of folders to include type definitions from. */ 48 | // "types": [], /* Type declaration files to be included in compilation. */ 49 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 50 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 51 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 52 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 53 | /* Source Map Options */ 54 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 55 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 56 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 57 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 58 | /* Experimental Options */ 59 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 60 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 61 | /* Advanced Options */ 62 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 63 | "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */ 64 | //"watch": true, 65 | "resolveJsonModule": true 66 | }, 67 | "exclude": [ 68 | "node_modules" 69 | ], 70 | "include": [ 71 | "src/**/*.ts" 72 | ] 73 | } 74 | --------------------------------------------------------------------------------