diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..42d14d29 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +src/* @jacoobes +docs/* @Murtatrxx \ No newline at end of file diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..8e8bdaee --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# Contributing + +When contributing to this repository, please first discuss the change you wish to make via issue, +email, or any other method with the owners of this repository before making a change. + +Please note we have a [code of conduct](https://github.com/sern-handler/handler/blob/main/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project. + +## Pull Request Process + +1. Ensure any install or build dependencies are removed before the end of the layer when doing a + build. +2. Update the README.md with details of changes to the interface, this includes new environment + variables, exposed ports, useful file locations and container parameters. +3. Increase the version numbers in any examples files and the README.md to the new version that this + Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). +4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you + do not have permission to do that, you may request the second reviewer to merge it for you. + +### Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. +### Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at our [discord server](https://discord.com/invite/QgnfxWzrcj). All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +### Attribution + +This contributing guidelines is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 8081eaec..45d71847 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -2,12 +2,14 @@ ## Supported Versions -Project is currently in development and is not yet ready to be used. +Project is currently under heavy development but you can try out our [npm package](https://npmjs.com/package/@sern/handler) | Version | Supported | | ------- | ------------------ | | 0.1.0 @ dev | :white_check_mark: | +* Dev versions might include bugs, use it with your own risk. + ## Reporting a Vulnerability You can report a vulnerability by opening an issue on the [project's GitHub](https://github.com/SernHandler/Sern/issues) repository. diff --git a/.gitignore b/.gitignore index d765bb9b..f208b310 100644 --- a/.gitignore +++ b/.gitignore @@ -54,19 +54,20 @@ typings/ # Yarn Integrity file .yarn-integrity -# dotenv environment variables file +# Typedoc raw output +.typedoc + +# Dotenv environment variables file .env -# parcel-bundler cache (https://parceljs.org/) +# Parcel-bundler cache (https://parceljs.org/) .cache -# next.js build output +# next.js and nuxt.js build output .next - -# nuxt.js build output .nuxt -# vuepress build output +# Vuepress build output .vuepress/dist # Serverless directories @@ -75,8 +76,11 @@ typings/ # FuseBox cache .fusebox/ +# TypeScript build output dist +# VisualStudio Config file .vs -.idea \ No newline at end of file +# IntelliJ IDEA Config file +.idea/ diff --git a/.npmignore b/.npmignore index 5c5532a6..506ff152 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,3 @@ src/ -tsconfig.json \ No newline at end of file +tsconfig.json +docs/ \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..42061c01 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index f0c38cfe..1b53835a 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,7 +2,7 @@ "semi": true, "trailingComma": "all", "singleQuote": true, - "printWidth": 120, + "printWidth": 100, "tabWidth": 4, "arrowParens": "avoid" } diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 9aa60006..102875c8 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,5 +1,5 @@ # Code of Conduct -All participants of SernHandler. are expected to abide by our Code of Conduct, both online and during in-person events that are hosted and/or associated with SernHandler. +All participants of SernHandler are expected to abide by our Code of Conduct, both online and during in-person events that are hosted and/or associated with SernHandler. # The Pledge In the interest of fostering an open and welcoming environment, we pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. diff --git a/LICENSE.md b/LICENSE.md index 921e84f8..a668bd1c 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,339 +1,23 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 +MIT License - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. +**Copyright (c) 2022 Sern** - Preamble +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - A discord.js wrapper to make easier to use discord.js - Copyright (C) 2022 SernHandler, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. +End license text. diff --git a/README.md b/README.md index 47b6d47a..6292eb05 100644 --- a/README.md +++ b/README.md @@ -1,91 +1,83 @@ -# Sern Handler - -NPM version NPM downloads Builds Passing +# SernHandler -Sern can automate and streamline development of your discord bot with new version compatibility and full customization. +NPM version +NPM downloads +[![License: MIT](https://img.shields.io/badge/License-MIT-blavk.svg)](https://opensource.org/licenses/MIT) + +A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development. -- A reincarnation of [this old project](https://github.com/jacoobes/sern_handler) ## Installation ```sh -npm install sern-handler +npm install @sern/handler ``` + ```sh -yarn add sern-handler +yarn add @sern/handler ``` + ```sh -pnpm add sern-handler +pnpm add @sern/handler ``` ## Basic Usage -#### ` index.js ` +#### ` index.js (CommonJS)` + ```js -import { Client, Intents } from 'discord.js'; -import { Sern } from 'sern-handler'; -import { prefix, token } from '../src/secrets.json'; +const { Client, GatewayIntentBits } = require('discord.js'); +const { Sern } = require('sern-handler'); +const { defaultPrefix, token } = require('./config.json'); const client = new Client({ - intents: [ - Intents.FLAGS.GUILDS, - Intents.FLAGS.GUILD_MESSAGES, - Intents.FLAGS.GUILD_MEMBERS - ] + intents: [ + GatewayIntentBits.Guilds, + GatewayIntentBits.GuildMembers, + GatewayIntentBits.GuildMessages + ] }); -new Sern.Handler({ +Sern.init({ client, - prefix, - commands : 'dist/commands', - privateServers : [ - { - test : true, - id: 'server-id' - } - ], - init: async (handler) => { - // Optional function to initialize anything else on bot startup - }, + defaultPrefix, + commands : 'src/commands', }); - client.login(token); ``` -#### ` ping.js ` +#### ` ping.js (CommonJS)` + ```js -import { Sern, Types } from 'sern-handler'; -import { Ok } from 'ts-results'; - -export default { - alias: [], - desc : 'A ping pong command', - visibility : 'private', - test : false, - type: Sern.CommandType.SLASH | Sern.CommandType.TEXT, - execute : async ({ message, interaction }, args) => 'pong!' -}; +const { Sern, CommandType } = require('@sern/handler'); + +exports.default = { + description: 'A ping pong command', + type: CommandType.Slash, + execute(ctx) { + ctx.reply('pong!'); + } + }; ``` -See [documentation](https://sern-handler.js.org) for TypeScript examples and more +See our [templates](https://github.com/sern-handler/templates) for TypeScript examples and more + +## CLI + +We are providing a [command line interface](https://github.com/sern-handler/cli) for better & easier bot developement. Don't forget to view it. -## Links ![link](https://img.shields.io/badge/Coming-Soon-purple) +## Links -- [Official Documentation](https://tmp.com) -- [Example Bot](https://tmp.com) -- [Discord Server](https://google.com) +- [Official Documentation](https://sern-handler.js.org) +- [Support Server](https://discord.com/invite/Yvb7DnqjXX) ## Contribute -- Pull up on [issues](https://github.com/sern-handler/Sern/issues) and tell us, if there are bugs -- All kinds of contributions are welcomed! +- Read our contribution [guidelines](https://github.com/sern-handler/handler) carefully +- Pull up on [issues](https://github.com/sern-handler/handler/issues) and report bugs +- All kinds of contributions are welcomed. -## TODO +## Roadmap -- Default commands -- Categories -- Ruling out all bugs in the command system -- Better support for slash commands -- More Build scripts -- Logger +You can check our [roadmap](https://github.com/sern-handler/roadmap) to see what's going to be added or patched in the future. diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css index 26d41f4c..875f2107 100644 --- a/docs/assets/highlight.css +++ b/docs/assets/highlight.css @@ -1,27 +1,28 @@ :root { - --light-hl-0: #000000; - --dark-hl-0: #D4D4D4; - --light-hl-1: #AF00DB; - --dark-hl-1: #C586C0; - --light-hl-2: #001080; - --dark-hl-2: #9CDCFE; - --light-hl-3: #A31515; - --dark-hl-3: #CE9178; - --light-hl-4: #0000FF; - --dark-hl-4: #569CD6; - --light-hl-5: #0070C1; - --dark-hl-5: #4FC1FF; - --light-hl-6: #795E26; - --dark-hl-6: #DCDCAA; - --light-hl-7: #008000; - --dark-hl-7: #6A9955; - --light-hl-8: #CD3131; - --dark-hl-8: #F44747; - --light-code-background: #F5F5F5; - --dark-code-background: #1E1E1E; + --light-hl-0: #000000; + --dark-hl-0: #d4d4d4; + --light-hl-1: #af00db; + --dark-hl-1: #c586c0; + --light-hl-2: #001080; + --dark-hl-2: #9cdcfe; + --light-hl-3: #a31515; + --dark-hl-3: #ce9178; + --light-hl-4: #0000ff; + --dark-hl-4: #569cd6; + --light-hl-5: #0070c1; + --dark-hl-5: #4fc1ff; + --light-hl-6: #795e26; + --dark-hl-6: #dcdcaa; + --light-hl-7: #008000; + --dark-hl-7: #6a9955; + --light-hl-8: #cd3131; + --dark-hl-8: #f44747; + --light-code-background: #f5f5f5; + --dark-code-background: #1e1e1e; } -@media (prefers-color-scheme: light) { :root { +@media (prefers-color-scheme: light) { + :root { --hl-0: var(--light-hl-0); --hl-1: var(--light-hl-1); --hl-2: var(--light-hl-2); @@ -32,9 +33,11 @@ --hl-7: var(--light-hl-7); --hl-8: var(--light-hl-8); --code-background: var(--light-code-background); -} } + } +} -@media (prefers-color-scheme: dark) { :root { +@media (prefers-color-scheme: dark) { + :root { --hl-0: var(--dark-hl-0); --hl-1: var(--dark-hl-1); --hl-2: var(--dark-hl-2); @@ -45,41 +48,63 @@ --hl-7: var(--dark-hl-7); --hl-8: var(--dark-hl-8); --code-background: var(--dark-code-background); -} } + } +} body.light { - --hl-0: var(--light-hl-0); - --hl-1: var(--light-hl-1); - --hl-2: var(--light-hl-2); - --hl-3: var(--light-hl-3); - --hl-4: var(--light-hl-4); - --hl-5: var(--light-hl-5); - --hl-6: var(--light-hl-6); - --hl-7: var(--light-hl-7); - --hl-8: var(--light-hl-8); - --code-background: var(--light-code-background); + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --code-background: var(--light-code-background); } body.dark { - --hl-0: var(--dark-hl-0); - --hl-1: var(--dark-hl-1); - --hl-2: var(--dark-hl-2); - --hl-3: var(--dark-hl-3); - --hl-4: var(--dark-hl-4); - --hl-5: var(--dark-hl-5); - --hl-6: var(--dark-hl-6); - --hl-7: var(--dark-hl-7); - --hl-8: var(--dark-hl-8); - --code-background: var(--dark-code-background); + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --code-background: var(--dark-code-background); } -.hl-0 { color: var(--hl-0); } -.hl-1 { color: var(--hl-1); } -.hl-2 { color: var(--hl-2); } -.hl-3 { color: var(--hl-3); } -.hl-4 { color: var(--hl-4); } -.hl-5 { color: var(--hl-5); } -.hl-6 { color: var(--hl-6); } -.hl-7 { color: var(--hl-7); } -.hl-8 { color: var(--hl-8); } -pre, code { background: var(--code-background); } +.hl-0 { + color: var(--hl-0); +} +.hl-1 { + color: var(--hl-1); +} +.hl-2 { + color: var(--hl-2); +} +.hl-3 { + color: var(--hl-3); +} +.hl-4 { + color: var(--hl-4); +} +.hl-5 { + color: var(--hl-5); +} +.hl-6 { + color: var(--hl-6); +} +.hl-7 { + color: var(--hl-7); +} +.hl-8 { + color: var(--hl-8); +} +pre, +code { + background: var(--code-background); +} diff --git a/docs/assets/icons.css b/docs/assets/icons.css index 776a3562..43784345 100644 --- a/docs/assets/icons.css +++ b/docs/assets/icons.css @@ -1,1043 +1,907 @@ .tsd-kind-icon { - display: block; - position: relative; - padding-left: 20px; - text-indent: -20px; + display: block; + position: relative; + padding-left: 20px; + text-indent: -20px; } .tsd-kind-icon:before { - content: ""; - display: inline-block; - vertical-align: middle; - width: 17px; - height: 17px; - margin: 0 3px 2px 0; - background-image: url(./icons.png); + content: ''; + display: inline-block; + vertical-align: middle; + width: 17px; + height: 17px; + margin: 0 3px 2px 0; + background-image: url(./icons.png); } @media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) { - .tsd-kind-icon:before { - background-image: url(./icons@2x.png); - background-size: 238px 204px; - } + .tsd-kind-icon:before { + background-image: url(./icons@2x.png); + background-size: 238px 204px; + } } .tsd-signature.tsd-kind-icon:before { - background-position: 0 -153px; + background-position: 0 -153px; } .tsd-kind-object-literal > .tsd-kind-icon:before { - background-position: 0px -17px; + background-position: 0px -17px; } .tsd-kind-object-literal.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -17px; + background-position: -17px -17px; } .tsd-kind-object-literal.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -17px; + background-position: -34px -17px; } .tsd-kind-class > .tsd-kind-icon:before { - background-position: 0px -34px; + background-position: 0px -34px; } .tsd-kind-class.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -34px; + background-position: -17px -34px; } .tsd-kind-class.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -34px; + background-position: -34px -34px; } .tsd-kind-class.tsd-has-type-parameter > .tsd-kind-icon:before { - background-position: 0px -51px; + background-position: 0px -51px; } -.tsd-kind-class.tsd-has-type-parameter.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -17px -51px; +.tsd-kind-class.tsd-has-type-parameter.tsd-is-protected > .tsd-kind-icon:before { + background-position: -17px -51px; } .tsd-kind-class.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -51px; + background-position: -34px -51px; } .tsd-kind-interface > .tsd-kind-icon:before { - background-position: 0px -68px; + background-position: 0px -68px; } .tsd-kind-interface.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -68px; + background-position: -17px -68px; } .tsd-kind-interface.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -68px; + background-position: -34px -68px; } .tsd-kind-interface.tsd-has-type-parameter > .tsd-kind-icon:before { - background-position: 0px -85px; + background-position: 0px -85px; } -.tsd-kind-interface.tsd-has-type-parameter.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -17px -85px; +.tsd-kind-interface.tsd-has-type-parameter.tsd-is-protected > .tsd-kind-icon:before { + background-position: -17px -85px; } -.tsd-kind-interface.tsd-has-type-parameter.tsd-is-private - > .tsd-kind-icon:before { - background-position: -34px -85px; +.tsd-kind-interface.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { + background-position: -34px -85px; } .tsd-kind-namespace > .tsd-kind-icon:before { - background-position: 0px -102px; + background-position: 0px -102px; } .tsd-kind-namespace.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -102px; + background-position: -17px -102px; } .tsd-kind-namespace.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -102px; + background-position: -34px -102px; } .tsd-kind-module > .tsd-kind-icon:before { - background-position: 0px -102px; + background-position: 0px -102px; } .tsd-kind-module.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -102px; + background-position: -17px -102px; } .tsd-kind-module.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -102px; + background-position: -34px -102px; } .tsd-kind-enum > .tsd-kind-icon:before { - background-position: 0px -119px; + background-position: 0px -119px; } .tsd-kind-enum.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -119px; + background-position: -17px -119px; } .tsd-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -119px; + background-position: -34px -119px; } .tsd-kind-enum-member > .tsd-kind-icon:before { - background-position: 0px -136px; + background-position: 0px -136px; } .tsd-kind-enum-member.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -136px; + background-position: -17px -136px; } .tsd-kind-enum-member.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -136px; + background-position: -34px -136px; } .tsd-kind-signature > .tsd-kind-icon:before { - background-position: 0px -153px; + background-position: 0px -153px; } .tsd-kind-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -153px; + background-position: -17px -153px; } .tsd-kind-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -153px; + background-position: -34px -153px; } .tsd-kind-type-alias > .tsd-kind-icon:before { - background-position: 0px -170px; + background-position: 0px -170px; } .tsd-kind-type-alias.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -170px; + background-position: -17px -170px; } .tsd-kind-type-alias.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -170px; + background-position: -34px -170px; } .tsd-kind-type-alias.tsd-has-type-parameter > .tsd-kind-icon:before { - background-position: 0px -187px; + background-position: 0px -187px; } -.tsd-kind-type-alias.tsd-has-type-parameter.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -17px -187px; +.tsd-kind-type-alias.tsd-has-type-parameter.tsd-is-protected > .tsd-kind-icon:before { + background-position: -17px -187px; } -.tsd-kind-type-alias.tsd-has-type-parameter.tsd-is-private - > .tsd-kind-icon:before { - background-position: -34px -187px; +.tsd-kind-type-alias.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { + background-position: -34px -187px; } .tsd-kind-variable > .tsd-kind-icon:before { - background-position: -136px -0px; + background-position: -136px -0px; } .tsd-kind-variable.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -0px; + background-position: -153px -0px; } .tsd-kind-variable.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -0px; + background-position: -119px -0px; } .tsd-kind-variable.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -0px; + background-position: -51px -0px; } -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -0px; +.tsd-kind-variable.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -0px; } -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -0px; +.tsd-kind-variable.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -0px; } -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -0px; +.tsd-kind-variable.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -0px; } -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -0px; +.tsd-kind-variable.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -0px; } .tsd-kind-variable.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -0px; + background-position: -170px -0px; } -.tsd-kind-variable.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -0px; +.tsd-kind-variable.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -0px; } .tsd-kind-variable.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -0px; + background-position: -119px -0px; } .tsd-kind-variable.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -0px; + background-position: -204px -0px; } -.tsd-kind-variable.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -0px; +.tsd-kind-variable.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -0px; } .tsd-kind-property > .tsd-kind-icon:before { - background-position: -136px -0px; + background-position: -136px -0px; } .tsd-kind-property.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -0px; + background-position: -153px -0px; } .tsd-kind-property.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -0px; + background-position: -119px -0px; } .tsd-kind-property.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -0px; + background-position: -51px -0px; } -.tsd-kind-property.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -0px; +.tsd-kind-property.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -0px; } -.tsd-kind-property.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -0px; +.tsd-kind-property.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -0px; } -.tsd-kind-property.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -0px; +.tsd-kind-property.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -0px; } -.tsd-kind-property.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -0px; +.tsd-kind-property.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -0px; } .tsd-kind-property.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -0px; + background-position: -170px -0px; } -.tsd-kind-property.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -0px; +.tsd-kind-property.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -0px; } .tsd-kind-property.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -0px; + background-position: -119px -0px; } .tsd-kind-property.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -0px; + background-position: -204px -0px; } -.tsd-kind-property.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -0px; +.tsd-kind-property.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -0px; } .tsd-kind-get-signature > .tsd-kind-icon:before { - background-position: -136px -17px; + background-position: -136px -17px; } .tsd-kind-get-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -17px; + background-position: -153px -17px; } .tsd-kind-get-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -17px; + background-position: -119px -17px; } .tsd-kind-get-signature.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -17px; + background-position: -51px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -17px; +.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -17px; +.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -17px; +.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -17px; +.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -17px; } .tsd-kind-get-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -17px; + background-position: -170px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -17px; +.tsd-kind-get-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -17px; +.tsd-kind-get-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -17px; } .tsd-kind-get-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -17px; + background-position: -204px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -17px; +.tsd-kind-get-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -17px; } .tsd-kind-set-signature > .tsd-kind-icon:before { - background-position: -136px -34px; + background-position: -136px -34px; } .tsd-kind-set-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -34px; + background-position: -153px -34px; } .tsd-kind-set-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -34px; + background-position: -119px -34px; } .tsd-kind-set-signature.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -34px; + background-position: -51px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -34px; +.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -34px; +.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -34px; +.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -34px; +.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -34px; } .tsd-kind-set-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -34px; + background-position: -170px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -34px; +.tsd-kind-set-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -34px; +.tsd-kind-set-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -34px; } .tsd-kind-set-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -34px; + background-position: -204px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -34px; +.tsd-kind-set-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -34px; } .tsd-kind-accessor > .tsd-kind-icon:before { - background-position: -136px -51px; + background-position: -136px -51px; } .tsd-kind-accessor.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -51px; + background-position: -153px -51px; } .tsd-kind-accessor.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -51px; + background-position: -119px -51px; } .tsd-kind-accessor.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -51px; + background-position: -51px -51px; } -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -51px; +.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -51px; } -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -51px; +.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -51px; } -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -51px; +.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -51px; } -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -51px; +.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -51px; } .tsd-kind-accessor.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -51px; + background-position: -170px -51px; } -.tsd-kind-accessor.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -51px; +.tsd-kind-accessor.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -51px; } .tsd-kind-accessor.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -51px; + background-position: -119px -51px; } .tsd-kind-accessor.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -51px; + background-position: -204px -51px; } -.tsd-kind-accessor.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -51px; +.tsd-kind-accessor.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -51px; } .tsd-kind-function > .tsd-kind-icon:before { - background-position: -136px -68px; + background-position: -136px -68px; } .tsd-kind-function.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -68px; + background-position: -153px -68px; } .tsd-kind-function.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; + background-position: -119px -68px; } .tsd-kind-function.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -68px; + background-position: -51px -68px; } -.tsd-kind-function.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -68px; +.tsd-kind-function.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -68px; } -.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -68px; +.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -68px; } -.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -68px; +.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -68px; } -.tsd-kind-function.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -68px; +.tsd-kind-function.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -68px; } .tsd-kind-function.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -68px; + background-position: -170px -68px; } -.tsd-kind-function.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -68px; +.tsd-kind-function.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -68px; } .tsd-kind-function.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; + background-position: -119px -68px; } .tsd-kind-function.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -68px; + background-position: -204px -68px; } -.tsd-kind-function.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -68px; +.tsd-kind-function.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -68px; } .tsd-kind-method > .tsd-kind-icon:before { - background-position: -136px -68px; + background-position: -136px -68px; } .tsd-kind-method.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -68px; + background-position: -153px -68px; } .tsd-kind-method.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; + background-position: -119px -68px; } .tsd-kind-method.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -68px; + background-position: -51px -68px; } -.tsd-kind-method.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -68px; +.tsd-kind-method.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -68px; } -.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -68px; +.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -68px; } -.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -68px; +.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -68px; } .tsd-kind-method.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; + background-position: -119px -68px; } .tsd-kind-method.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -68px; + background-position: -170px -68px; } .tsd-kind-method.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { - background-position: -187px -68px; + background-position: -187px -68px; } .tsd-kind-method.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; + background-position: -119px -68px; } .tsd-kind-method.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -68px; + background-position: -204px -68px; } -.tsd-kind-method.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -68px; +.tsd-kind-method.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -68px; } .tsd-kind-call-signature > .tsd-kind-icon:before { - background-position: -136px -68px; + background-position: -136px -68px; } .tsd-kind-call-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -68px; + background-position: -153px -68px; } .tsd-kind-call-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; + background-position: -119px -68px; } .tsd-kind-call-signature.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -68px; + background-position: -51px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -68px; +.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -68px; +.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -68px; +.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -68px; +.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -68px; } .tsd-kind-call-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -68px; + background-position: -170px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -68px; +.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -68px; +.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -68px; } .tsd-kind-call-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -68px; + background-position: -204px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -68px; +.tsd-kind-call-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -68px; } .tsd-kind-function.tsd-has-type-parameter > .tsd-kind-icon:before { - background-position: -136px -85px; + background-position: -136px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -153px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-is-protected > .tsd-kind-icon:before { + background-position: -153px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class - > .tsd-kind-icon:before { - background-position: -51px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class > .tsd-kind-icon:before { + background-position: -51px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -85px; } .tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -85px; + > .tsd-kind-icon:before { + background-position: -102px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum - > .tsd-kind-icon:before { - background-position: -170px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum > .tsd-kind-icon:before { + background-position: -170px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-interface > .tsd-kind-icon:before { + background-position: -204px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -85px; +.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -85px; } .tsd-kind-method.tsd-has-type-parameter > .tsd-kind-icon:before { - background-position: -136px -85px; + background-position: -136px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -153px -85px; +.tsd-kind-method.tsd-has-type-parameter.tsd-is-protected > .tsd-kind-icon:before { + background-position: -153px -85px; } .tsd-kind-method.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -85px; + background-position: -119px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class - > .tsd-kind-icon:before { - background-position: -51px -85px; +.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class > .tsd-kind-icon:before { + background-position: -51px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -85px; +.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -85px; +.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -85px; } .tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -85px; + > .tsd-kind-icon:before { + background-position: -102px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -85px; +.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum - > .tsd-kind-icon:before { - background-position: -170px -85px; +.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum > .tsd-kind-icon:before { + background-position: -170px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -85px; +.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -85px; +.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -85px; +.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-interface > .tsd-kind-icon:before { + background-position: -204px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -85px; +.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -85px; } .tsd-kind-constructor > .tsd-kind-icon:before { - background-position: -136px -102px; + background-position: -136px -102px; } .tsd-kind-constructor.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -102px; + background-position: -153px -102px; } .tsd-kind-constructor.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -102px; + background-position: -119px -102px; } .tsd-kind-constructor.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -102px; + background-position: -51px -102px; } -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -102px; +.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -102px; } -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -102px; +.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -102px; } -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -102px; +.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -102px; } -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -102px; +.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -102px; } .tsd-kind-constructor.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -102px; + background-position: -170px -102px; } -.tsd-kind-constructor.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -102px; +.tsd-kind-constructor.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -102px; } -.tsd-kind-constructor.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -102px; +.tsd-kind-constructor.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -102px; } .tsd-kind-constructor.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -102px; + background-position: -204px -102px; } -.tsd-kind-constructor.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -102px; +.tsd-kind-constructor.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -102px; } .tsd-kind-constructor-signature > .tsd-kind-icon:before { - background-position: -136px -102px; + background-position: -136px -102px; } .tsd-kind-constructor-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -102px; + background-position: -153px -102px; } .tsd-kind-constructor-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -102px; + background-position: -119px -102px; } .tsd-kind-constructor-signature.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -102px; + background-position: -51px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -102px; +.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -102px; +.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -102px; +.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -102px; +.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -102px; } .tsd-kind-constructor-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -102px; + background-position: -170px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -102px; +.tsd-kind-constructor-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -102px; +.tsd-kind-constructor-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -102px; +.tsd-kind-constructor-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { + background-position: -204px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -102px; +.tsd-kind-constructor-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -102px; } .tsd-kind-index-signature > .tsd-kind-icon:before { - background-position: -136px -119px; + background-position: -136px -119px; } .tsd-kind-index-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -119px; + background-position: -153px -119px; } .tsd-kind-index-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -119px; + background-position: -119px -119px; } .tsd-kind-index-signature.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -119px; + background-position: -51px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -119px; +.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -119px; +.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -119px; +.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -119px; +.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -119px; } .tsd-kind-index-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -119px; + background-position: -170px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -119px; +.tsd-kind-index-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -119px; +.tsd-kind-index-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -119px; } .tsd-kind-index-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -119px; + background-position: -204px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -119px; +.tsd-kind-index-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -119px; } .tsd-kind-event > .tsd-kind-icon:before { - background-position: -136px -136px; + background-position: -136px -136px; } .tsd-kind-event.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -136px; + background-position: -153px -136px; } .tsd-kind-event.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -136px; + background-position: -119px -136px; } .tsd-kind-event.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -136px; + background-position: -51px -136px; } .tsd-kind-event.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { - background-position: -68px -136px; + background-position: -68px -136px; } .tsd-kind-event.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { - background-position: -85px -136px; + background-position: -85px -136px; } -.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -136px; +.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -136px; } .tsd-kind-event.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -136px; + background-position: -119px -136px; } .tsd-kind-event.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -136px; + background-position: -170px -136px; } .tsd-kind-event.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { - background-position: -187px -136px; + background-position: -187px -136px; } .tsd-kind-event.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -136px; + background-position: -119px -136px; } .tsd-kind-event.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -136px; + background-position: -204px -136px; } -.tsd-kind-event.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -136px; +.tsd-kind-event.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -136px; } .tsd-is-static > .tsd-kind-icon:before { - background-position: -136px -153px; + background-position: -136px -153px; } .tsd-is-static.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -153px; + background-position: -153px -153px; } .tsd-is-static.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -153px; + background-position: -119px -153px; } .tsd-is-static.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -153px; + background-position: -51px -153px; } .tsd-is-static.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { - background-position: -68px -153px; + background-position: -68px -153px; } .tsd-is-static.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { - background-position: -85px -153px; + background-position: -85px -153px; } -.tsd-is-static.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -153px; +.tsd-is-static.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -153px; } .tsd-is-static.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -153px; + background-position: -119px -153px; } .tsd-is-static.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -153px; + background-position: -170px -153px; } .tsd-is-static.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { - background-position: -187px -153px; + background-position: -187px -153px; } .tsd-is-static.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -153px; + background-position: -119px -153px; } .tsd-is-static.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -153px; + background-position: -204px -153px; } -.tsd-is-static.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -153px; +.tsd-is-static.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -153px; } .tsd-is-static.tsd-kind-function > .tsd-kind-icon:before { - background-position: -136px -170px; + background-position: -136px -170px; } .tsd-is-static.tsd-kind-function.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -170px; + background-position: -153px -170px; } .tsd-is-static.tsd-kind-function.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -170px; + background-position: -119px -170px; } .tsd-is-static.tsd-kind-function.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -170px; + background-position: -51px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -170px; +.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -170px; +.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -170px; +.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; +.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -170px; } .tsd-is-static.tsd-kind-function.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -170px; + background-position: -170px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -170px; +.tsd-is-static.tsd-kind-function.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; +.tsd-is-static.tsd-kind-function.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -170px; +.tsd-is-static.tsd-kind-function.tsd-parent-kind-interface > .tsd-kind-icon:before { + background-position: -204px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -170px; +.tsd-is-static.tsd-kind-function.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -170px; } .tsd-is-static.tsd-kind-method > .tsd-kind-icon:before { - background-position: -136px -170px; + background-position: -136px -170px; } .tsd-is-static.tsd-kind-method.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -170px; + background-position: -153px -170px; } .tsd-is-static.tsd-kind-method.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -170px; + background-position: -119px -170px; } .tsd-is-static.tsd-kind-method.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -170px; + background-position: -51px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -170px; +.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -170px; +.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -170px; +.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; +.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -170px; } .tsd-is-static.tsd-kind-method.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -170px; + background-position: -170px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -170px; +.tsd-is-static.tsd-kind-method.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; +.tsd-is-static.tsd-kind-method.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -170px; +.tsd-is-static.tsd-kind-method.tsd-parent-kind-interface > .tsd-kind-icon:before { + background-position: -204px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -170px; +.tsd-is-static.tsd-kind-method.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -170px; } .tsd-is-static.tsd-kind-call-signature > .tsd-kind-icon:before { - background-position: -136px -170px; + background-position: -136px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -153px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-is-protected > .tsd-kind-icon:before { + background-position: -153px -170px; } .tsd-is-static.tsd-kind-call-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -170px; + background-position: -119px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class - > .tsd-kind-icon:before { - background-position: -51px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class > .tsd-kind-icon:before { + background-position: -51px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum - > .tsd-kind-icon:before { - background-position: -170px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { + background-position: -170px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { + background-position: -204px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -170px; +.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -170px; } .tsd-is-static.tsd-kind-event > .tsd-kind-icon:before { - background-position: -136px -187px; + background-position: -136px -187px; } .tsd-is-static.tsd-kind-event.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -187px; + background-position: -153px -187px; } .tsd-is-static.tsd-kind-event.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -187px; + background-position: -119px -187px; } .tsd-is-static.tsd-kind-event.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -187px; + background-position: -51px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -187px; +.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -68px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -187px; +.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { + background-position: -85px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -187px; +.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -102px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -187px; +.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -187px; } .tsd-is-static.tsd-kind-event.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -187px; + background-position: -170px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -187px; +.tsd-is-static.tsd-kind-event.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { + background-position: -187px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -187px; +.tsd-is-static.tsd-kind-event.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { + background-position: -119px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -187px; +.tsd-is-static.tsd-kind-event.tsd-parent-kind-interface > .tsd-kind-icon:before { + background-position: -204px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -187px; +.tsd-is-static.tsd-kind-event.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { + background-position: -221px -187px; } diff --git a/docs/assets/style.css b/docs/assets/style.css index a16ed029..0e048966 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -1,110 +1,55 @@ -@import url("./icons.css"); +@import url('./icons.css'); :root { - /* Light */ - --light-color-background: #fcfcfc; - --light-color-secondary-background: #fff; - --light-color-text: #222; - --light-color-text-aside: #707070; - --light-color-link: #4da6ff; - --light-color-menu-divider: #eee; - --light-color-menu-divider-focus: #000; - --light-color-menu-label: #707070; - --light-color-panel: var(--light-color-secondary-background); - --light-color-panel-divider: #eee; - --light-color-comment-tag: #707070; - --light-color-comment-tag-text: #fff; - --light-color-ts: #9600ff; - --light-color-ts-interface: #647f1b; - --light-color-ts-enum: #937210; - --light-color-ts-class: #0672de; - --light-color-ts-private: #707070; - --light-color-toolbar: #fff; - --light-color-toolbar-text: #333; - --light-icon-filter: invert(0); - --light-external-icon: url("data:image/svg+xml;utf8,"); - - /* Dark */ - --dark-color-background: #36393f; - --dark-color-secondary-background: #2f3136; - --dark-color-text: #ffffff; - --dark-color-text-aside: #e6e4e4; - --dark-color-link: #00aff4; - --dark-color-menu-divider: #eee; - --dark-color-menu-divider-focus: #000; - --dark-color-menu-label: #707070; - --dark-color-panel: var(--dark-color-secondary-background); - --dark-color-panel-divider: #818181; - --dark-color-comment-tag: #dcddde; - --dark-color-comment-tag-text: #2f3136; - --dark-color-ts: #c97dff; - --dark-color-ts-interface: #9cbe3c; - --dark-color-ts-enum: #d6ab29; - --dark-color-ts-class: #3695f3; - --dark-color-ts-private: #e2e2e2; - --dark-color-toolbar: #34373c; - --dark-color-toolbar-text: #ffffff; - --dark-icon-filter: invert(1); - --dark-external-icon: url("data:image/svg+xml;utf8,"); + /* Light */ + --light-color-background: #fcfcfc; + --light-color-secondary-background: #fff; + --light-color-text: #222; + --light-color-text-aside: #707070; + --light-color-link: #4da6ff; + --light-color-menu-divider: #eee; + --light-color-menu-divider-focus: #000; + --light-color-menu-label: #707070; + --light-color-panel: var(--light-color-secondary-background); + --light-color-panel-divider: #eee; + --light-color-comment-tag: #707070; + --light-color-comment-tag-text: #fff; + --light-color-ts: #9600ff; + --light-color-ts-interface: #647f1b; + --light-color-ts-enum: #937210; + --light-color-ts-class: #0672de; + --light-color-ts-private: #707070; + --light-color-toolbar: #fff; + --light-color-toolbar-text: #333; + --light-icon-filter: invert(0); + --light-external-icon: url("data:image/svg+xml;utf8,"); + + /* Dark */ + --dark-color-background: #36393f; + --dark-color-secondary-background: #2f3136; + --dark-color-text: #ffffff; + --dark-color-text-aside: #e6e4e4; + --dark-color-link: #00aff4; + --dark-color-menu-divider: #eee; + --dark-color-menu-divider-focus: #000; + --dark-color-menu-label: #707070; + --dark-color-panel: var(--dark-color-secondary-background); + --dark-color-panel-divider: #818181; + --dark-color-comment-tag: #dcddde; + --dark-color-comment-tag-text: #2f3136; + --dark-color-ts: #c97dff; + --dark-color-ts-interface: #9cbe3c; + --dark-color-ts-enum: #d6ab29; + --dark-color-ts-class: #3695f3; + --dark-color-ts-private: #e2e2e2; + --dark-color-toolbar: #34373c; + --dark-color-toolbar-text: #ffffff; + --dark-icon-filter: invert(1); + --dark-external-icon: url("data:image/svg+xml;utf8,"); } @media (prefers-color-scheme: light) { - :root { - --color-background: var(--light-color-background); - --color-secondary-background: var(--light-color-secondary-background); - --color-text: var(--light-color-text); - --color-text-aside: var(--light-color-text-aside); - --color-link: var(--light-color-link); - --color-menu-divider: var(--light-color-menu-divider); - --color-menu-divider-focus: var(--light-color-menu-divider-focus); - --color-menu-label: var(--light-color-menu-label); - --color-panel: var(--light-color-panel); - --color-panel-divider: var(--light-color-panel-divider); - --color-comment-tag: var(--light-color-comment-tag); - --color-comment-tag-text: var(--light-color-comment-tag-text); - --color-ts: var(--light-color-ts); - --color-ts-interface: var(--light-color-ts-interface); - --color-ts-enum: var(--light-color-ts-enum); - --color-ts-class: var(--light-color-ts-class); - --color-ts-private: var(--light-color-ts-private); - --color-toolbar: var(--light-color-toolbar); - --color-toolbar-text: var(--light-color-toolbar-text); - --icon-filter: var(--light-icon-filter); - --external-icon: var(--light-external-icon); - } -} - -@media (prefers-color-scheme: dark) { - :root { - --color-background: var(--dark-color-background); - --color-secondary-background: var(--dark-color-secondary-background); - --color-text: var(--dark-color-text); - --color-text-aside: var(--dark-color-text-aside); - --color-link: var(--dark-color-link); - --color-menu-divider: var(--dark-color-menu-divider); - --color-menu-divider-focus: var(--dark-color-menu-divider-focus); - --color-menu-label: var(--dark-color-menu-label); - --color-panel: var(--dark-color-panel); - --color-panel-divider: var(--dark-color-panel-divider); - --color-comment-tag: var(--dark-color-comment-tag); - --color-comment-tag-text: var(--dark-color-comment-tag-text); - --color-ts: var(--dark-color-ts); - --color-ts-interface: var(--dark-color-ts-interface); - --color-ts-enum: var(--dark-color-ts-enum); - --color-ts-class: var(--dark-color-ts-class); - --color-ts-private: var(--dark-color-ts-private); - --color-toolbar: var(--dark-color-toolbar); - --color-toolbar-text: var(--dark-color-toolbar-text); - --icon-filter: var(--dark-icon-filter); - --external-icon: var(--dark-external-icon); - } -} - -body { - margin: 0; -} - -body.light { + :root { --color-background: var(--light-color-background); --color-secondary-background: var(--light-color-secondary-background); --color-text: var(--light-color-text); @@ -126,9 +71,11 @@ body.light { --color-toolbar-text: var(--light-color-toolbar-text); --icon-filter: var(--light-icon-filter); --external-icon: var(--light-external-icon); + } } -body.dark { +@media (prefers-color-scheme: dark) { + :root { --color-background: var(--dark-color-background); --color-secondary-background: var(--dark-color-secondary-background); --color-text: var(--dark-color-text); @@ -150,6 +97,59 @@ body.dark { --color-toolbar-text: var(--dark-color-toolbar-text); --icon-filter: var(--dark-icon-filter); --external-icon: var(--dark-external-icon); + } +} + +body { + margin: 0; +} + +body.light { + --color-background: var(--light-color-background); + --color-secondary-background: var(--light-color-secondary-background); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + --color-menu-divider: var(--light-color-menu-divider); + --color-menu-divider-focus: var(--light-color-menu-divider-focus); + --color-menu-label: var(--light-color-menu-label); + --color-panel: var(--light-color-panel); + --color-panel-divider: var(--light-color-panel-divider); + --color-comment-tag: var(--light-color-comment-tag); + --color-comment-tag-text: var(--light-color-comment-tag-text); + --color-ts: var(--light-color-ts); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-class: var(--light-color-ts-class); + --color-ts-private: var(--light-color-ts-private); + --color-toolbar: var(--light-color-toolbar); + --color-toolbar-text: var(--light-color-toolbar-text); + --icon-filter: var(--light-icon-filter); + --external-icon: var(--light-external-icon); +} + +body.dark { + --color-background: var(--dark-color-background); + --color-secondary-background: var(--dark-color-secondary-background); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + --color-menu-divider: var(--dark-color-menu-divider); + --color-menu-divider-focus: var(--dark-color-menu-divider-focus); + --color-menu-label: var(--dark-color-menu-label); + --color-panel: var(--dark-color-panel); + --color-panel-divider: var(--dark-color-panel-divider); + --color-comment-tag: var(--dark-color-comment-tag); + --color-comment-tag-text: var(--dark-color-comment-tag-text); + --color-ts: var(--dark-color-ts); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-private: var(--dark-color-ts-private); + --color-toolbar: var(--dark-color-toolbar); + --color-toolbar-text: var(--dark-color-toolbar-text); + --icon-filter: var(--dark-icon-filter); + --external-icon: var(--dark-external-icon); } h1, @@ -158,97 +158,97 @@ h3, h4, h5, h6 { - line-height: 1.2; + line-height: 1.2; } h1 { - font-size: 2em; - margin: 0.67em 0; + font-size: 2em; + margin: 0.67em 0; } h2 { - font-size: 1.5em; - margin: 0.83em 0; + font-size: 1.5em; + margin: 0.83em 0; } h3 { - font-size: 1.17em; - margin: 1em 0; + font-size: 1.17em; + margin: 1em 0; } h4, .tsd-index-panel h3 { - font-size: 1em; - margin: 1.33em 0; + font-size: 1em; + margin: 1.33em 0; } h5 { - font-size: 0.83em; - margin: 1.67em 0; + font-size: 0.83em; + margin: 1.67em 0; } h6 { - font-size: 0.67em; - margin: 2.33em 0; + font-size: 0.67em; + margin: 2.33em 0; } pre { - white-space: pre; - white-space: pre-wrap; - word-wrap: break-word; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; } dl, menu, ol, ul { - margin: 1em 0; + margin: 1em 0; } dd { - margin: 0 0 0 40px; + margin: 0 0 0 40px; } .container { - max-width: 1200px; - margin: 0 auto; - padding: 0 40px; + max-width: 1200px; + margin: 0 auto; + padding: 0 40px; } @media (max-width: 640px) { - .container { - padding: 0 20px; - } + .container { + padding: 0 20px; + } } .container-main { - padding-bottom: 200px; + padding-bottom: 200px; } .row { - display: flex; - position: relative; - margin: 0 -10px; + display: flex; + position: relative; + margin: 0 -10px; } .row:after { - visibility: hidden; - display: block; - content: ""; - clear: both; - height: 0; + visibility: hidden; + display: block; + content: ''; + clear: both; + height: 0; } .col-4, .col-8 { - box-sizing: border-box; - float: left; - padding: 0 10px; + box-sizing: border-box; + float: left; + padding: 0 10px; } .col-4 { - width: 33.3333333333%; + width: 33.3333333333%; } .col-8 { - width: 66.6666666667%; + width: 66.6666666667%; } ul.tsd-descriptions > li > :first-child, @@ -263,7 +263,7 @@ ul.tsd-descriptions > li > :first-child > :first-child > :first-child, .tsd-panel > :first-child > :first-child > :first-child, .col-8 > :first-child > :first-child > :first-child, .col-4 > :first-child > :first-child > :first-child { - margin-top: 0; + margin-top: 0; } ul.tsd-descriptions > li > :last-child, .tsd-panel > :last-child, @@ -277,1137 +277,1137 @@ ul.tsd-descriptions > li > :last-child > :last-child > :last-child, .tsd-panel > :last-child > :last-child > :last-child, .col-8 > :last-child > :last-child > :last-child, .col-4 > :last-child > :last-child > :last-child { - margin-bottom: 0; + margin-bottom: 0; } @keyframes fade-in { - from { - opacity: 0; - } - to { - opacity: 1; - } + from { + opacity: 0; + } + to { + opacity: 1; + } } @keyframes fade-out { - from { - opacity: 1; - visibility: visible; - } - to { - opacity: 0; - } + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + } } @keyframes fade-in-delayed { - 0% { - opacity: 0; - } - 33% { - opacity: 0; - } - 100% { - opacity: 1; - } + 0% { + opacity: 0; + } + 33% { + opacity: 0; + } + 100% { + opacity: 1; + } } @keyframes fade-out-delayed { - 0% { - opacity: 1; - visibility: visible; - } - 66% { - opacity: 0; - } - 100% { - opacity: 0; - } + 0% { + opacity: 1; + visibility: visible; + } + 66% { + opacity: 0; + } + 100% { + opacity: 0; + } } @keyframes shift-to-left { - from { - transform: translate(0, 0); - } - to { - transform: translate(-25%, 0); - } + from { + transform: translate(0, 0); + } + to { + transform: translate(-25%, 0); + } } @keyframes unshift-to-left { - from { - transform: translate(-25%, 0); - } - to { - transform: translate(0, 0); - } + from { + transform: translate(-25%, 0); + } + to { + transform: translate(0, 0); + } } @keyframes pop-in-from-right { - from { - transform: translate(100%, 0); - } - to { - transform: translate(0, 0); - } + from { + transform: translate(100%, 0); + } + to { + transform: translate(0, 0); + } } @keyframes pop-out-to-right { - from { - transform: translate(0, 0); - visibility: visible; - } - to { - transform: translate(100%, 0); - } + from { + transform: translate(0, 0); + visibility: visible; + } + to { + transform: translate(100%, 0); + } } body { - background: var(--color-background); - font-family: "Segoe UI", sans-serif; - font-size: 16px; - color: var(--color-text); + background: var(--color-background); + font-family: 'Segoe UI', sans-serif; + font-size: 16px; + color: var(--color-text); } a { - color: var(--color-link); - text-decoration: none; + color: var(--color-link); + text-decoration: none; } a:hover { - text-decoration: underline; + text-decoration: underline; } -a.external[target="_blank"] { - background-image: var(--external-icon); - background-position: top 3px right; - background-repeat: no-repeat; - padding-right: 13px; +a.external[target='_blank'] { + background-image: var(--external-icon); + background-position: top 3px right; + background-repeat: no-repeat; + padding-right: 13px; } code, pre { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - padding: 0.2em; - margin: 0; - font-size: 14px; + font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; + padding: 0.2em; + margin: 0; + font-size: 14px; } pre { - padding: 10px; + padding: 10px; } pre code { - padding: 0; - font-size: 100%; + padding: 0; + font-size: 100%; } blockquote { - margin: 1em 0; - padding-left: 1em; - border-left: 4px solid gray; + margin: 1em 0; + padding-left: 1em; + border-left: 4px solid gray; } .tsd-typography { - line-height: 1.333em; + line-height: 1.333em; } .tsd-typography ul { - list-style: square; - padding: 0 0 0 20px; - margin: 0; + list-style: square; + padding: 0 0 0 20px; + margin: 0; } .tsd-typography h4, .tsd-typography .tsd-index-panel h3, .tsd-index-panel .tsd-typography h3, .tsd-typography h5, .tsd-typography h6 { - font-size: 1em; - margin: 0; + font-size: 1em; + margin: 0; } .tsd-typography h5, .tsd-typography h6 { - font-weight: normal; + font-weight: normal; } .tsd-typography p, .tsd-typography ul, .tsd-typography ol { - margin: 1em 0; + margin: 1em 0; } @media (min-width: 901px) and (max-width: 1024px) { - html .col-content { - width: 72%; - } - html .col-menu { - width: 28%; - } - html .tsd-navigation { - padding-left: 10px; - } + html .col-content { + width: 72%; + } + html .col-menu { + width: 28%; + } + html .tsd-navigation { + padding-left: 10px; + } } @media (max-width: 900px) { - html .col-content { - float: none; - width: 100%; - } - html .col-menu { - position: fixed !important; - overflow: auto; - -webkit-overflow-scrolling: touch; - z-index: 1024; - top: 0 !important; - bottom: 0 !important; - left: auto !important; - right: 0 !important; - width: 100%; - padding: 20px 20px 0 0; - max-width: 450px; - visibility: hidden; - background-color: var(--color-panel); - transform: translate(100%, 0); - } - html .col-menu > *:last-child { - padding-bottom: 20px; - } - html .overlay { - content: ""; - display: block; - position: fixed; - z-index: 1023; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.75); - visibility: hidden; - } - - .to-has-menu .overlay { - animation: fade-in 0.4s; - } - - .to-has-menu :is(header, footer, .col-content) { - animation: shift-to-left 0.4s; - } - - .to-has-menu .col-menu { - animation: pop-in-from-right 0.4s; - } - - .from-has-menu .overlay { - animation: fade-out 0.4s; - } - - .from-has-menu :is(header, footer, .col-content) { - animation: unshift-to-left 0.4s; - } - - .from-has-menu .col-menu { - animation: pop-out-to-right 0.4s; - } - - .has-menu body { - overflow: hidden; - } - .has-menu .overlay { - visibility: visible; - } - .has-menu :is(header, footer, .col-content) { - transform: translate(-25%, 0); - } - .has-menu .col-menu { - visibility: visible; - transform: translate(0, 0); - display: grid; - grid-template-rows: auto 1fr; - max-height: 100vh; - } - .has-menu .tsd-navigation { - max-height: 100%; - } + html .col-content { + float: none; + width: 100%; + } + html .col-menu { + position: fixed !important; + overflow: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + width: 100%; + padding: 20px 20px 0 0; + max-width: 450px; + visibility: hidden; + background-color: var(--color-panel); + transform: translate(100%, 0); + } + html .col-menu > *:last-child { + padding-bottom: 20px; + } + html .overlay { + content: ''; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu :is(header, footer, .col-content) { + animation: shift-to-left 0.4s; + } + + .to-has-menu .col-menu { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu :is(header, footer, .col-content) { + animation: unshift-to-left 0.4s; + } + + .from-has-menu .col-menu { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu :is(header, footer, .col-content) { + transform: translate(-25%, 0); + } + .has-menu .col-menu { + visibility: visible; + transform: translate(0, 0); + display: grid; + grid-template-rows: auto 1fr; + max-height: 100vh; + } + .has-menu .tsd-navigation { + max-height: 100%; + } } .tsd-page-title { - padding: 70px 0 20px 0; - margin: 0 0 40px 0; - background: var(--color-panel); - box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); + padding: 70px 0 20px 0; + margin: 0 0 40px 0; + background: var(--color-panel); + box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); } .tsd-page-title h1 { - margin: 0; + margin: 0; } .tsd-breadcrumb { - margin: 0; - padding: 0; - color: var(--color-text-aside); + margin: 0; + padding: 0; + color: var(--color-text-aside); } .tsd-breadcrumb a { - color: var(--color-text-aside); - text-decoration: none; + color: var(--color-text-aside); + text-decoration: none; } .tsd-breadcrumb a:hover { - text-decoration: underline; + text-decoration: underline; } .tsd-breadcrumb li { - display: inline; + display: inline; } .tsd-breadcrumb li:after { - content: " / "; + content: ' / '; } dl.tsd-comment-tags { - overflow: hidden; + overflow: hidden; } dl.tsd-comment-tags dt { - float: left; - padding: 1px 5px; - margin: 0 10px 0 0; - border-radius: 4px; - border: 1px solid var(--color-comment-tag); - color: var(--color-comment-tag); - font-size: 0.8em; - font-weight: normal; + float: left; + padding: 1px 5px; + margin: 0 10px 0 0; + border-radius: 4px; + border: 1px solid var(--color-comment-tag); + color: var(--color-comment-tag); + font-size: 0.8em; + font-weight: normal; } dl.tsd-comment-tags dd { - margin: 0 0 10px 0; + margin: 0 0 10px 0; } dl.tsd-comment-tags dd:before, dl.tsd-comment-tags dd:after { - display: table; - content: " "; + display: table; + content: ' '; } dl.tsd-comment-tags dd pre, dl.tsd-comment-tags dd:after { - clear: both; + clear: both; } dl.tsd-comment-tags p { - margin: 0; + margin: 0; } .tsd-panel.tsd-comment .lead { - font-size: 1.1em; - line-height: 1.333em; - margin-bottom: 2em; + font-size: 1.1em; + line-height: 1.333em; + margin-bottom: 2em; } .tsd-panel.tsd-comment .lead:last-child { - margin-bottom: 0; + margin-bottom: 0; } .toggle-protected .tsd-is-private { - display: none; + display: none; } .toggle-public .tsd-is-private, .toggle-public .tsd-is-protected, .toggle-public .tsd-is-private-protected { - display: none; + display: none; } .toggle-inherited .tsd-is-inherited { - display: none; + display: none; } .toggle-externals .tsd-is-external { - display: none; + display: none; } #tsd-filter { - position: relative; - display: inline-block; - height: 40px; - vertical-align: bottom; + position: relative; + display: inline-block; + height: 40px; + vertical-align: bottom; } .no-filter #tsd-filter { - display: none; + display: none; } #tsd-filter .tsd-filter-group { - display: inline-block; - height: 40px; - vertical-align: bottom; - white-space: nowrap; + display: inline-block; + height: 40px; + vertical-align: bottom; + white-space: nowrap; } #tsd-filter input { - display: none; + display: none; } @media (max-width: 900px) { - #tsd-filter .tsd-filter-group { - display: block; - position: absolute; - top: 40px; - right: 20px; - height: auto; - background-color: var(--color-panel); - visibility: hidden; - transform: translate(50%, 0); - box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); - } - .has-options #tsd-filter .tsd-filter-group { - visibility: visible; - } - .to-has-options #tsd-filter .tsd-filter-group { - animation: fade-in 0.2s; - } - .from-has-options #tsd-filter .tsd-filter-group { - animation: fade-out 0.2s; - } - #tsd-filter label, - #tsd-filter .tsd-select { - display: block; - padding-right: 20px; - } + #tsd-filter .tsd-filter-group { + display: block; + position: absolute; + top: 40px; + right: 20px; + height: auto; + background-color: var(--color-panel); + visibility: hidden; + transform: translate(50%, 0); + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); + } + .has-options #tsd-filter .tsd-filter-group { + visibility: visible; + } + .to-has-options #tsd-filter .tsd-filter-group { + animation: fade-in 0.2s; + } + .from-has-options #tsd-filter .tsd-filter-group { + animation: fade-out 0.2s; + } + #tsd-filter label, + #tsd-filter .tsd-select { + display: block; + padding-right: 20px; + } } footer { - border-top: 1px solid var(--color-panel-divider); - background-color: var(--color-panel); + border-top: 1px solid var(--color-panel-divider); + background-color: var(--color-panel); } footer:after { - content: ""; - display: table; + content: ''; + display: table; } footer.with-border-bottom { - border-bottom: 1px solid var(--color-panel-divider); + border-bottom: 1px solid var(--color-panel-divider); } footer .tsd-legend-group { - font-size: 0; + font-size: 0; } footer .tsd-legend { - display: inline-block; - width: 25%; - padding: 0; - font-size: 16px; - list-style: none; - line-height: 1.333em; - vertical-align: top; + display: inline-block; + width: 25%; + padding: 0; + font-size: 16px; + list-style: none; + line-height: 1.333em; + vertical-align: top; } @media (max-width: 900px) { - footer .tsd-legend { - width: 50%; - } + footer .tsd-legend { + width: 50%; + } } .tsd-hierarchy { - list-style: square; - padding: 0 0 0 20px; - margin: 0; + list-style: square; + padding: 0 0 0 20px; + margin: 0; } .tsd-hierarchy .target { - font-weight: bold; + font-weight: bold; } .tsd-index-panel .tsd-index-content { - margin-bottom: -30px !important; + margin-bottom: -30px !important; } .tsd-index-panel .tsd-index-section { - margin-bottom: 30px !important; + margin-bottom: 30px !important; } .tsd-index-panel h3 { - margin: 0 -20px 10px -20px; - padding: 0 20px 10px 20px; - border-bottom: 1px solid var(--color-panel-divider); + margin: 0 -20px 10px -20px; + padding: 0 20px 10px 20px; + border-bottom: 1px solid var(--color-panel-divider); } .tsd-index-panel ul.tsd-index-list { - -webkit-column-count: 3; - -moz-column-count: 3; - -ms-column-count: 3; - -o-column-count: 3; - column-count: 3; - -webkit-column-gap: 20px; - -moz-column-gap: 20px; - -ms-column-gap: 20px; - -o-column-gap: 20px; - column-gap: 20px; - padding: 0; - list-style: none; - line-height: 1.333em; + -webkit-column-count: 3; + -moz-column-count: 3; + -ms-column-count: 3; + -o-column-count: 3; + column-count: 3; + -webkit-column-gap: 20px; + -moz-column-gap: 20px; + -ms-column-gap: 20px; + -o-column-gap: 20px; + column-gap: 20px; + padding: 0; + list-style: none; + line-height: 1.333em; } @media (max-width: 900px) { - .tsd-index-panel ul.tsd-index-list { - -webkit-column-count: 1; - -moz-column-count: 1; - -ms-column-count: 1; - -o-column-count: 1; - column-count: 1; - } + .tsd-index-panel ul.tsd-index-list { + -webkit-column-count: 1; + -moz-column-count: 1; + -ms-column-count: 1; + -o-column-count: 1; + column-count: 1; + } } @media (min-width: 901px) and (max-width: 1024px) { - .tsd-index-panel ul.tsd-index-list { - -webkit-column-count: 2; - -moz-column-count: 2; - -ms-column-count: 2; - -o-column-count: 2; - column-count: 2; - } + .tsd-index-panel ul.tsd-index-list { + -webkit-column-count: 2; + -moz-column-count: 2; + -ms-column-count: 2; + -o-column-count: 2; + column-count: 2; + } } .tsd-index-panel ul.tsd-index-list li { - -webkit-page-break-inside: avoid; - -moz-page-break-inside: avoid; - -ms-page-break-inside: avoid; - -o-page-break-inside: avoid; - page-break-inside: avoid; + -webkit-page-break-inside: avoid; + -moz-page-break-inside: avoid; + -ms-page-break-inside: avoid; + -o-page-break-inside: avoid; + page-break-inside: avoid; } .tsd-index-panel a, .tsd-index-panel .tsd-parent-kind-module a { - color: var(--color-ts); + color: var(--color-ts); } .tsd-index-panel .tsd-parent-kind-interface a { - color: var(--color-ts-interface); + color: var(--color-ts-interface); } .tsd-index-panel .tsd-parent-kind-enum a { - color: var(--color-ts-enum); + color: var(--color-ts-enum); } .tsd-index-panel .tsd-parent-kind-class a { - color: var(--color-ts-class); + color: var(--color-ts-class); } .tsd-index-panel .tsd-kind-module a { - color: var(--color-ts); + color: var(--color-ts); } .tsd-index-panel .tsd-kind-interface a { - color: var(--color-ts-interface); + color: var(--color-ts-interface); } .tsd-index-panel .tsd-kind-enum a { - color: var(--color-ts-enum); + color: var(--color-ts-enum); } .tsd-index-panel .tsd-kind-class a { - color: var(--color-ts-class); + color: var(--color-ts-class); } .tsd-index-panel .tsd-is-private a { - color: var(--color-ts-private); + color: var(--color-ts-private); } .tsd-flag { - display: inline-block; - padding: 1px 5px; - border-radius: 4px; - color: var(--color-comment-tag-text); - background-color: var(--color-comment-tag); - text-indent: 0; - font-size: 14px; - font-weight: normal; + display: inline-block; + padding: 1px 5px; + border-radius: 4px; + color: var(--color-comment-tag-text); + background-color: var(--color-comment-tag); + text-indent: 0; + font-size: 14px; + font-weight: normal; } .tsd-anchor { - position: absolute; - top: -100px; + position: absolute; + top: -100px; } .tsd-member { - position: relative; + position: relative; } .tsd-member .tsd-anchor + h3 { - margin-top: 0; - margin-bottom: 0; - border-bottom: none; + margin-top: 0; + margin-bottom: 0; + border-bottom: none; } .tsd-member [data-tsd-kind] { - color: var(--color-ts); + color: var(--color-ts); } -.tsd-member [data-tsd-kind="Interface"] { - color: var(--color-ts-interface); +.tsd-member [data-tsd-kind='Interface'] { + color: var(--color-ts-interface); } -.tsd-member [data-tsd-kind="Enum"] { - color: var(--color-ts-enum); +.tsd-member [data-tsd-kind='Enum'] { + color: var(--color-ts-enum); } -.tsd-member [data-tsd-kind="Class"] { - color: var(--color-ts-class); +.tsd-member [data-tsd-kind='Class'] { + color: var(--color-ts-class); } -.tsd-member [data-tsd-kind="Private"] { - color: var(--color-ts-private); +.tsd-member [data-tsd-kind='Private'] { + color: var(--color-ts-private); } .tsd-navigation { - margin: 0 0 0 40px; + margin: 0 0 0 40px; } .tsd-navigation a { - display: block; - padding-top: 2px; - padding-bottom: 2px; - border-left: 2px solid transparent; - color: var(--color-text); - text-decoration: none; - transition: border-left-color 0.1s; + display: block; + padding-top: 2px; + padding-bottom: 2px; + border-left: 2px solid transparent; + color: var(--color-text); + text-decoration: none; + transition: border-left-color 0.1s; } .tsd-navigation a:hover { - text-decoration: underline; + text-decoration: underline; } .tsd-navigation ul { - margin: 0; - padding: 0; - list-style: none; + margin: 0; + padding: 0; + list-style: none; } .tsd-navigation li { - padding: 0; + padding: 0; } .tsd-navigation.primary { - padding-bottom: 40px; + padding-bottom: 40px; } .tsd-navigation.primary a { - display: block; - padding-top: 6px; - padding-bottom: 6px; + display: block; + padding-top: 6px; + padding-bottom: 6px; } .tsd-navigation.primary ul li a { - padding-left: 5px; + padding-left: 5px; } .tsd-navigation.primary ul li li a { - padding-left: 25px; + padding-left: 25px; } .tsd-navigation.primary ul li li li a { - padding-left: 45px; + padding-left: 45px; } .tsd-navigation.primary ul li li li li a { - padding-left: 65px; + padding-left: 65px; } .tsd-navigation.primary ul li li li li li a { - padding-left: 85px; + padding-left: 85px; } .tsd-navigation.primary ul li li li li li li a { - padding-left: 105px; + padding-left: 105px; } .tsd-navigation.primary > ul { - border-bottom: 1px solid var(--color-panel-divider); + border-bottom: 1px solid var(--color-panel-divider); } .tsd-navigation.primary li { - border-top: 1px solid var(--color-panel-divider); + border-top: 1px solid var(--color-panel-divider); } .tsd-navigation.primary li.current > a { - font-weight: bold; + font-weight: bold; } .tsd-navigation.primary li.label span { - display: block; - padding: 20px 0 6px 5px; - color: var(--color-menu-label); + display: block; + padding: 20px 0 6px 5px; + color: var(--color-menu-label); } .tsd-navigation.primary li.globals + li > span, .tsd-navigation.primary li.globals + li > a { - padding-top: 20px; + padding-top: 20px; } .tsd-navigation.secondary { - max-height: calc(100vh - 1rem - 40px); - overflow: auto; - position: sticky; - top: calc(0.5rem + 40px); - transition: 0.3s; + max-height: calc(100vh - 1rem - 40px); + overflow: auto; + position: sticky; + top: calc(0.5rem + 40px); + transition: 0.3s; } .tsd-navigation.secondary.tsd-navigation--toolbar-hide { - max-height: calc(100vh - 1rem); - top: 0.5rem; + max-height: calc(100vh - 1rem); + top: 0.5rem; } .tsd-navigation.secondary ul { - transition: opacity 0.2s; + transition: opacity 0.2s; } .tsd-navigation.secondary ul li a { - padding-left: 25px; + padding-left: 25px; } .tsd-navigation.secondary ul li li a { - padding-left: 45px; + padding-left: 45px; } .tsd-navigation.secondary ul li li li a { - padding-left: 65px; + padding-left: 65px; } .tsd-navigation.secondary ul li li li li a { - padding-left: 85px; + padding-left: 85px; } .tsd-navigation.secondary ul li li li li li a { - padding-left: 105px; + padding-left: 105px; } .tsd-navigation.secondary ul li li li li li li a { - padding-left: 125px; + padding-left: 125px; } .tsd-navigation.secondary ul.current a { - border-left-color: var(--color-panel-divider); + border-left-color: var(--color-panel-divider); } .tsd-navigation.secondary li.focus > a, .tsd-navigation.secondary ul.current li.focus > a { - border-left-color: var(--color-menu-divider-focus); + border-left-color: var(--color-menu-divider-focus); } .tsd-navigation.secondary li.current { - margin-top: 20px; - margin-bottom: 20px; - border-left-color: var(--color-panel-divider); + margin-top: 20px; + margin-bottom: 20px; + border-left-color: var(--color-panel-divider); } .tsd-navigation.secondary li.current > a { - font-weight: bold; + font-weight: bold; } @media (min-width: 901px) { - .menu-sticky-wrap { - position: static; - } + .menu-sticky-wrap { + position: static; + } } .tsd-panel { - margin: 20px 0; - padding: 20px; - background-color: var(--color-panel); - box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); + margin: 20px 0; + padding: 20px; + background-color: var(--color-panel); + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } .tsd-panel:empty { - display: none; + display: none; } .tsd-panel > h1, .tsd-panel > h2, .tsd-panel > h3 { - margin: 1.5em -20px 10px -20px; - padding: 0 20px 10px 20px; - border-bottom: 1px solid var(--color-panel-divider); + margin: 1.5em -20px 10px -20px; + padding: 0 20px 10px 20px; + border-bottom: 1px solid var(--color-panel-divider); } .tsd-panel > h1.tsd-before-signature, .tsd-panel > h2.tsd-before-signature, .tsd-panel > h3.tsd-before-signature { - margin-bottom: 0; - border-bottom: 0; + margin-bottom: 0; + border-bottom: 0; } .tsd-panel table { - display: block; - width: 100%; - overflow: auto; - margin-top: 10px; - word-break: normal; - word-break: keep-all; - border-collapse: collapse; + display: block; + width: 100%; + overflow: auto; + margin-top: 10px; + word-break: normal; + word-break: keep-all; + border-collapse: collapse; } .tsd-panel table th { - font-weight: bold; + font-weight: bold; } .tsd-panel table th, .tsd-panel table td { - padding: 6px 13px; - border: 1px solid var(--color-panel-divider); + padding: 6px 13px; + border: 1px solid var(--color-panel-divider); } .tsd-panel table tr { - background: var(--color-background); + background: var(--color-background); } .tsd-panel table tr:nth-child(even) { - background: var(--color-secondary-background); + background: var(--color-secondary-background); } .tsd-panel-group { - margin: 60px 0; + margin: 60px 0; } .tsd-panel-group > h1, .tsd-panel-group > h2, .tsd-panel-group > h3 { - padding-left: 20px; - padding-right: 20px; + padding-left: 20px; + padding-right: 20px; } #tsd-search { - transition: background-color 0.2s; + transition: background-color 0.2s; } #tsd-search .title { - position: relative; - z-index: 2; + position: relative; + z-index: 2; } #tsd-search .field { - position: absolute; - left: 0; - top: 0; - right: 40px; - height: 40px; + position: absolute; + left: 0; + top: 0; + right: 40px; + height: 40px; } #tsd-search .field input { - box-sizing: border-box; - position: relative; - top: -50px; - z-index: 1; - width: 100%; - padding: 0 10px; - opacity: 0; - outline: 0; - border: 0; - background: transparent; - color: var(--color-text); + box-sizing: border-box; + position: relative; + top: -50px; + z-index: 1; + width: 100%; + padding: 0 10px; + opacity: 0; + outline: 0; + border: 0; + background: transparent; + color: var(--color-text); } #tsd-search .field label { - position: absolute; - overflow: hidden; - right: -40px; + position: absolute; + overflow: hidden; + right: -40px; } #tsd-search .field input, #tsd-search .title { - transition: opacity 0.2s; + transition: opacity 0.2s; } #tsd-search .results { - position: absolute; - visibility: hidden; - top: 40px; - width: 100%; - margin: 0; - padding: 0; - list-style: none; - box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); + position: absolute; + visibility: hidden; + top: 40px; + width: 100%; + margin: 0; + padding: 0; + list-style: none; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } #tsd-search .results li { - padding: 0 10px; - background-color: var(--color-background); + padding: 0 10px; + background-color: var(--color-background); } #tsd-search .results li:nth-child(even) { - background-color: var(--color-panel); + background-color: var(--color-panel); } #tsd-search .results li.state { - display: none; + display: none; } #tsd-search .results li.current, #tsd-search .results li:hover { - background-color: var(--color-panel-divider); + background-color: var(--color-panel-divider); } #tsd-search .results a { - display: block; + display: block; } #tsd-search .results a:before { - top: 10px; + top: 10px; } #tsd-search .results span.parent { - color: var(--color-text-aside); - font-weight: normal; + color: var(--color-text-aside); + font-weight: normal; } #tsd-search.has-focus { - background-color: var(--color-panel-divider); + background-color: var(--color-panel-divider); } #tsd-search.has-focus .field input { - top: 0; - opacity: 1; + top: 0; + opacity: 1; } #tsd-search.has-focus .title { - z-index: 0; - opacity: 0; + z-index: 0; + opacity: 0; } #tsd-search.has-focus .results { - visibility: visible; + visibility: visible; } #tsd-search.loading .results li.state.loading { - display: block; + display: block; } #tsd-search.failure .results li.state.failure { - display: block; + display: block; } .tsd-signature { - margin: 0 0 1em 0; - padding: 10px; - border: 1px solid var(--color-panel-divider); - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - font-size: 14px; - overflow-x: auto; + margin: 0 0 1em 0; + padding: 10px; + border: 1px solid var(--color-panel-divider); + font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; + font-size: 14px; + overflow-x: auto; } .tsd-signature.tsd-kind-icon { - padding-left: 30px; + padding-left: 30px; } .tsd-signature.tsd-kind-icon:before { - top: 10px; - left: 10px; + top: 10px; + left: 10px; } .tsd-panel > .tsd-signature { - margin-left: -20px; - margin-right: -20px; - border-width: 1px 0; + margin-left: -20px; + margin-right: -20px; + border-width: 1px 0; } .tsd-panel > .tsd-signature.tsd-kind-icon { - padding-left: 40px; + padding-left: 40px; } .tsd-panel > .tsd-signature.tsd-kind-icon:before { - left: 20px; + left: 20px; } .tsd-signature-symbol { - color: var(--color-text-aside); - font-weight: normal; + color: var(--color-text-aside); + font-weight: normal; } .tsd-signature-type { - font-style: italic; - font-weight: normal; + font-style: italic; + font-weight: normal; } .tsd-signatures { - padding: 0; - margin: 0 0 1em 0; - border: 1px solid var(--color-panel-divider); + padding: 0; + margin: 0 0 1em 0; + border: 1px solid var(--color-panel-divider); } .tsd-signatures .tsd-signature { - margin: 0; - border-width: 1px 0 0 0; - transition: background-color 0.1s; + margin: 0; + border-width: 1px 0 0 0; + transition: background-color 0.1s; } .tsd-signatures .tsd-signature:first-child { - border-top-width: 0; + border-top-width: 0; } .tsd-signatures .tsd-signature.current { - background-color: var(--color-panel-divider); + background-color: var(--color-panel-divider); } .tsd-signatures.active > .tsd-signature { - cursor: pointer; + cursor: pointer; } .tsd-panel > .tsd-signatures { - margin-left: -20px; - margin-right: -20px; - border-width: 1px 0; + margin-left: -20px; + margin-right: -20px; + border-width: 1px 0; } .tsd-panel > .tsd-signatures .tsd-signature.tsd-kind-icon { - padding-left: 40px; + padding-left: 40px; } .tsd-panel > .tsd-signatures .tsd-signature.tsd-kind-icon:before { - left: 20px; + left: 20px; } .tsd-panel > a.anchor + .tsd-signatures { - border-top-width: 0; - margin-top: -20px; + border-top-width: 0; + margin-top: -20px; } ul.tsd-descriptions { - position: relative; - overflow: hidden; - padding: 0; - list-style: none; + position: relative; + overflow: hidden; + padding: 0; + list-style: none; } ul.tsd-descriptions.active > .tsd-description { - display: none; + display: none; } ul.tsd-descriptions.active > .tsd-description.current { - display: block; + display: block; } ul.tsd-descriptions.active > .tsd-description.fade-in { - animation: fade-in-delayed 0.3s; + animation: fade-in-delayed 0.3s; } ul.tsd-descriptions.active > .tsd-description.fade-out { - animation: fade-out-delayed 0.3s; - position: absolute; - display: block; - top: 0; - left: 0; - right: 0; - opacity: 0; - visibility: hidden; + animation: fade-out-delayed 0.3s; + position: absolute; + display: block; + top: 0; + left: 0; + right: 0; + opacity: 0; + visibility: hidden; } ul.tsd-descriptions h4, ul.tsd-descriptions .tsd-index-panel h3, .tsd-index-panel ul.tsd-descriptions h3 { - font-size: 16px; - margin: 1em 0 0.5em 0; + font-size: 16px; + margin: 1em 0 0.5em 0; } ul.tsd-parameters, ul.tsd-type-parameters { - list-style: square; - margin: 0; - padding-left: 20px; + list-style: square; + margin: 0; + padding-left: 20px; } ul.tsd-parameters > li.tsd-parameter-signature, ul.tsd-type-parameters > li.tsd-parameter-signature { - list-style: none; - margin-left: -20px; + list-style: none; + margin-left: -20px; } ul.tsd-parameters h5, ul.tsd-type-parameters h5 { - font-size: 16px; - margin: 1em 0 0.5em 0; + font-size: 16px; + margin: 1em 0 0.5em 0; } ul.tsd-parameters .tsd-comment, ul.tsd-type-parameters .tsd-comment { - margin-top: -0.5em; + margin-top: -0.5em; } .tsd-sources { - font-size: 14px; - color: var(--color-text-aside); - margin: 0 0 1em 0; + font-size: 14px; + color: var(--color-text-aside); + margin: 0 0 1em 0; } .tsd-sources a { - color: var(--color-text-aside); - text-decoration: underline; + color: var(--color-text-aside); + text-decoration: underline; } .tsd-sources ul, .tsd-sources p { - margin: 0 !important; + margin: 0 !important; } .tsd-sources ul { - list-style: none; - padding: 0; + list-style: none; + padding: 0; } .tsd-page-toolbar { - position: fixed; - z-index: 1; - top: 0; - left: 0; - width: 100%; - height: 40px; - color: var(--color-toolbar-text); - background: var(--color-toolbar); - border-bottom: 1px solid var(--color-panel-divider); - transition: transform 0.3s linear; + position: fixed; + z-index: 1; + top: 0; + left: 0; + width: 100%; + height: 40px; + color: var(--color-toolbar-text); + background: var(--color-toolbar); + border-bottom: 1px solid var(--color-panel-divider); + transition: transform 0.3s linear; } .tsd-page-toolbar a { - color: var(--color-toolbar-text); - text-decoration: none; + color: var(--color-toolbar-text); + text-decoration: none; } .tsd-page-toolbar a.title { - font-weight: bold; + font-weight: bold; } .tsd-page-toolbar a.title:hover { - text-decoration: underline; + text-decoration: underline; } .tsd-page-toolbar .table-wrap { - display: table; - width: 100%; - height: 40px; + display: table; + width: 100%; + height: 40px; } .tsd-page-toolbar .table-cell { - display: table-cell; - position: relative; - white-space: nowrap; - line-height: 40px; + display: table-cell; + position: relative; + white-space: nowrap; + line-height: 40px; } .tsd-page-toolbar .table-cell:first-child { - width: 100%; + width: 100%; } .tsd-page-toolbar--hide { - transform: translateY(-100%); + transform: translateY(-100%); } .tsd-select .tsd-select-list li:before, .tsd-select .tsd-select-label:before, .tsd-widget:before { - content: ""; - display: inline-block; - width: 40px; - height: 40px; - margin: 0 -8px 0 0; - background-image: url(./widgets.png); - background-repeat: no-repeat; - text-indent: -1024px; - vertical-align: bottom; - filter: var(--icon-filter); + content: ''; + display: inline-block; + width: 40px; + height: 40px; + margin: 0 -8px 0 0; + background-image: url(./widgets.png); + background-repeat: no-repeat; + text-indent: -1024px; + vertical-align: bottom; + filter: var(--icon-filter); } @media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) { - .tsd-select .tsd-select-list li:before, - .tsd-select .tsd-select-label:before, - .tsd-widget:before { - background-image: url(./widgets@2x.png); - background-size: 320px 40px; - } + .tsd-select .tsd-select-list li:before, + .tsd-select .tsd-select-label:before, + .tsd-widget:before { + background-image: url(./widgets@2x.png); + background-size: 320px 40px; + } } .tsd-widget { - display: inline-block; - overflow: hidden; - opacity: 0.8; - height: 40px; - transition: opacity 0.1s, background-color 0.2s; - vertical-align: bottom; - cursor: pointer; + display: inline-block; + overflow: hidden; + opacity: 0.8; + height: 40px; + transition: opacity 0.1s, background-color 0.2s; + vertical-align: bottom; + cursor: pointer; } .tsd-widget:hover { - opacity: 0.9; + opacity: 0.9; } .tsd-widget.active { - opacity: 1; - background-color: var(--color-panel-divider); + opacity: 1; + background-color: var(--color-panel-divider); } .tsd-widget.no-caption { - width: 40px; + width: 40px; } .tsd-widget.no-caption:before { - margin: 0; + margin: 0; } .tsd-widget.search:before { - background-position: 0 0; + background-position: 0 0; } .tsd-widget.menu:before { - background-position: -40px 0; + background-position: -40px 0; } .tsd-widget.options:before { - background-position: -80px 0; + background-position: -80px 0; } .tsd-widget.options, .tsd-widget.menu { - display: none; + display: none; } @media (max-width: 900px) { - .tsd-widget.options, - .tsd-widget.menu { - display: inline-block; - } + .tsd-widget.options, + .tsd-widget.menu { + display: inline-block; + } } -input[type="checkbox"] + .tsd-widget:before { - background-position: -120px 0; +input[type='checkbox'] + .tsd-widget:before { + background-position: -120px 0; } -input[type="checkbox"]:checked + .tsd-widget:before { - background-position: -160px 0; +input[type='checkbox']:checked + .tsd-widget:before { + background-position: -160px 0; } .tsd-select { - position: relative; - display: inline-block; - height: 40px; - transition: opacity 0.1s, background-color 0.2s; - vertical-align: bottom; - cursor: pointer; + position: relative; + display: inline-block; + height: 40px; + transition: opacity 0.1s, background-color 0.2s; + vertical-align: bottom; + cursor: pointer; } .tsd-select .tsd-select-label { - opacity: 0.6; - transition: opacity 0.2s; + opacity: 0.6; + transition: opacity 0.2s; } .tsd-select .tsd-select-label:before { - background-position: -240px 0; + background-position: -240px 0; } .tsd-select.active .tsd-select-label { - opacity: 0.8; + opacity: 0.8; } .tsd-select.active .tsd-select-list { - visibility: visible; - opacity: 1; - transition-delay: 0s; + visibility: visible; + opacity: 1; + transition-delay: 0s; } .tsd-select .tsd-select-list { - position: absolute; - visibility: hidden; - top: 40px; - left: 0; - margin: 0; - padding: 0; - opacity: 0; - list-style: none; - box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); - transition: visibility 0s 0.2s, opacity 0.2s; + position: absolute; + visibility: hidden; + top: 40px; + left: 0; + margin: 0; + padding: 0; + opacity: 0; + list-style: none; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); + transition: visibility 0s 0.2s, opacity 0.2s; } .tsd-select .tsd-select-list li { - padding: 0 20px 0 0; - background-color: var(--color-background); + padding: 0 20px 0 0; + background-color: var(--color-background); } .tsd-select .tsd-select-list li:before { - background-position: 40px 0; + background-position: 40px 0; } .tsd-select .tsd-select-list li:nth-child(even) { - background-color: var(--color-panel); + background-color: var(--color-panel); } .tsd-select .tsd-select-list li:hover { - background-color: var(--color-panel-divider); + background-color: var(--color-panel-divider); } .tsd-select .tsd-select-list li.selected:before { - background-position: -200px 0; + background-position: -200px 0; } @media (max-width: 900px) { - .tsd-select .tsd-select-list { - top: 0; - left: auto; - right: 100%; - margin-right: -5px; - } - .tsd-select .tsd-select-label:before { - background-position: -280px 0; - } + .tsd-select .tsd-select-list { + top: 0; + left: auto; + right: 100%; + margin-right: -5px; + } + .tsd-select .tsd-select-label:before { + background-position: -280px 0; + } } img { - max-width: 100%; + max-width: 100%; } .tsd-anchor-icon { - margin-left: 10px; - vertical-align: middle; - color: var(--color-text); + margin-left: 10px; + vertical-align: middle; + color: var(--color-text); } .tsd-anchor-icon svg { - width: 1em; - height: 1em; - visibility: hidden; + width: 1em; + height: 1em; + visibility: hidden; } .tsd-anchor-link:hover > .tsd-anchor-icon svg { - visibility: visible; + visibility: visible; } diff --git a/docs/classes/Sern.Handler.html b/docs/classes/Sern.Handler.html index 1f7c5633..1ce9aded 100644 --- a/docs/classes/Sern.Handler.html +++ b/docs/classes/Sern.Handler.html @@ -1,29 +1,992 @@ -Handler | sern-handler
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Handler

Index

Constructors

Properties

wrapper: Wrapper

Accessors

  • get client(): Client<boolean>
  • readonly

    Returns Client<boolean>

    the discord.js client (DiscordJS#Client));

    -
  • get commandDir(): string
  • get prefix(): string
  • get privateServers(): { id: string; test: boolean }[]
  • readonly

    Returns { id: string; test: boolean }[]

    []} Private server ID for testing or personal use

    -

Methods

  • commandResult(module: CommandVal, message: Message<boolean>): Promise<undefined | possibleOutput<string>>
  • Parameters

    • module: CommandVal
      -

      Command file information

      -
    • message: Message<boolean>
      -

      The message object

      -

    Returns Promise<undefined | possibleOutput<string>>

    Takes return value and replies it, if possible input

    -
  • findModuleFrom<T>(ctx: T): undefined | CommandVal
  • Type parameters

    • T: CommandInteraction<CacheType> | Message<boolean>

    Parameters

    • ctx: T
      -

      name of possible command

      -

    Returns undefined | CommandVal

  • interactionResult(module: CommandVal, interaction: CommandInteraction<CacheType>): Promise<undefined | possibleOutput<string>>
  • Parameters

    • module: CommandVal
      -

      Command file information

      -
    • interaction: CommandInteraction<CacheType>
      -

      The Discord.js command interaction (DiscordJS#CommandInteraction))

      -

    Returns Promise<undefined | possibleOutput<string>>

    Takes return value and replies it, if possible input

    -
  • registerModules(modArr: { absPath: string; mod: Module<unknown>; name: string }[]): Promise<void>
  • -

    This function chains Files.buildData

    -

    Parameters

    • modArr: { absPath: string; mod: Module<unknown>; name: string }[]
      -

      module information

      -

    Returns Promise<void>

  • reloadSlash(cmdName: string, description: string, options: ApplicationCommandOptionData[]): Promise<void>
  • Parameters

    • cmdName: string
      -

      name of command

      -
    • description: string
      -

      description of command

      -
    • options: ApplicationCommandOptionData[]
      -

      any options for the slash command

      -

    Returns Promise<void>

Generated using TypeDoc

\ No newline at end of file + + + + + + Handler - SernHandler + + + + + + + + +
+
+
+
+ +
+
+ Options +
+
+ All +
    +
  • Public
  • +
  • Public/Protected
  • +
  • All
  • +
+
+ +
+
+ Menu +
+
+
+
+
+
+ +

Class Handler

+
+
+
+
+
+
+
+

Hierarchy

+
    +
  • Handler
  • +
+
+
+

Index

+
+
+
+

Constructors

+ +
+
+

Properties

+ +
+
+

Accessors

+ +
+
+

Methods

+ +
+
+
+
+
+

Constructors

+
+ + + +
    +
  • + +

    Parameters

    +
      +
    • +
      + wrapper: + Wrapper +
      +
      +
      +

      The data that is required to run sern handler

      +
      +
      +
    • +
    +

    + Returns Handler +

    +
  • +
+
+
+
+

Properties

+
+ + +
+ wrapper: + Wrapper +
+ +
+
+
+

Accessors

+
+ + +
    +
  • + get client(): Client<boolean> +
  • +
+
    +
  • + +
    +
    +
    readonly
    +
    +
    +
    +

    + Returns Client<boolean> +

    +

    the discord.js client (DiscordJS#Client));

    +
  • +
+
+
+ + +
    +
  • + get commandDir(): string +
  • +
+
    +
  • + +
    +
    +
    readonly
    +
    +
    +
    +

    Returns string

    +

    Directory of the commands folder

    +
  • +
+
+
+ + +
    +
  • + get prefix(): string +
  • +
+
    +
  • + +
    +
    +
    readonly
    +
    +
    +
    +

    Returns string

    +

    The prefix used for legacy commands

    +
  • +
+
+
+ + +
    +
  • + get privateServers(): { id: string; test: boolean }[] +
  • +
+
    +
  • + +
    +
    +
    readonly
    +
    +
    +
    +

    + Returns { id: string; test: boolean }[] +

    +

    []} Private server ID for testing or personal use

    +
  • +
+
+
+
+

Methods

+
+ + +
    +
  • + commandResult(module: CommandVal, message: Message<boolean>): Promise<undefined | possibleOutput<string>> +
  • +
+
    +
  • + +

    Parameters

    +
      +
    • +
      module: CommandVal
      +
      +
      +

      Command file information

      +
      +
      +
    • +
    • +
      + message: Message<boolean> +
      +
      +
      +

      The message object

      +
      +
      +
    • +
    +

    + Returns Promise<undefined | possibleOutput<string>> +

    +

    Takes return value and replies it, if possible input

    +
  • +
+
+
+ + +
    +
  • + findModuleFrom<T>(ctx: T): undefined | CommandVal +
  • +
+
    +
  • + +

    Type parameters

    +
      +
    • +

      + T: CommandInteraction<CacheType> | Message<boolean> +

      +
    • +
    +

    Parameters

    +
      +
    • +
      ctx: T
      +
      +
      +

      name of possible command

      +
      +
      +
    • +
    +

    + Returns undefined | CommandVal +

    +
    +
  • +
+
+
+ + +
    +
  • + interactionResult(module: CommandVal, interaction: CommandInteraction<CacheType>): Promise<undefined | possibleOutput<string>> +
  • +
+
    +
  • + +

    Parameters

    +
      +
    • +
      module: CommandVal
      +
      +
      +

      Command file information

      +
      +
      +
    • +
    • +
      + interaction: CommandInteraction<CacheType> +
      +
      +
      +

      The Discord.js command interaction (DiscordJS#CommandInteraction))

      +
      +
      +
    • +
    +

    + Returns Promise<undefined | possibleOutput<string>> +

    +

    Takes return value and replies it, if possible input

    +
  • +
+
+
+ + +
    +
  • + registerModules(modArr: { absPath: string; mod: Module<unknown>; name: string }[]): Promise<void> +
  • +
+
    +
  • + +
    +
    +

    This function chains Files.buildData

    +
    +
    +

    Parameters

    +
      +
    • +
      + modArr: { absPath: string; mod: Module<unknown>; name: string }[] +
      +
      +
      +

      module information

      +
      +
      +
    • +
    +

    + Returns Promise<void> +

    +
  • +
+
+
+ + +
    +
  • + reloadSlash(cmdName: string, description: string, options: ApplicationCommandOptionData[]): Promise<void> +
  • +
+
    +
  • + +

    Parameters

    +
      +
    • +
      cmdName: string
      +
      +
      +

      name of command

      +
      +
      +
    • +
    • +
      description: string
      +
      +
      +

      description of command

      +
      +
      +
    • +
    • +
      + options: ApplicationCommandOptionData[] +
      +
      +
      +

      any options for the slash command

      +
      +
      +
    • +
    +

    + Returns Promise<void> +

    +
  • +
+
+
+
+ +
+
+ +
+

Generated using TypeDoc

+
+
+ + + diff --git a/docs/enums/Sern.CommandType.html b/docs/enums/Sern.CommandType.html index 47542977..4f09714a 100644 --- a/docs/enums/Sern.CommandType.html +++ b/docs/enums/Sern.CommandType.html @@ -1 +1,204 @@ -CommandType | sern-handler
Options
All
  • Public
  • Public/Protected
  • All
Menu

Enumeration CommandType

Index

Enumeration members

Enumeration members

SLASH = 2
TEXT = 1

Generated using TypeDoc

\ No newline at end of file + + + + + + CommandType - SernHandler + + + + + + + + +
+
+
+
+ +
+
+ Options +
+
+ All +
    +
  • Public
  • +
  • Public/Protected
  • +
  • All
  • +
+
+ +
+
+ Menu +
+
+
+
+
+
+ +

Enumeration CommandType

+
+
+
+
+
+
+
+

Index

+
+
+
+

Enumeration members

+ +
+
+
+
+
+

Enumeration members

+
+ + +
SLASH = 2
+ +
+
+ + +
TEXT = 1
+ +
+
+
+ +
+
+ +
+

Generated using TypeDoc

+
+
+ + + diff --git a/docs/index.html b/docs/index.html index 8c881568..88639543 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,56 +1,168 @@ -sern-handler
Options
All
  • Public
  • Public/Protected
  • All
Menu

sern-handler

- -

Sern Handler

-
- -NPM version NPM downloads Builds Passing + + + + + + SernHandler + + + + + + + + +
+
+
+
+ +
+
+ Options +
+
+ All +
    +
  • Public
  • +
  • Public/Protected
  • +
  • All
  • +
+
+ +
+
+ Menu +
+
+
+
+
+

sern-handler

+
+
+
+
+
+
+ +

Sern Handler

+
+ + NPM version + NPM downloads + Builds Passing -

Sern can automate and streamline development of your discord bot with new version compatibility and full customization.

- +

+ Sern can automate and streamline development of your discord bot with new version compatibility and full + customization. +

+ - -

Installation

-
-
npm install sern-handler
+            
+              

Installation

+
+
npm install sern-handler
 
-
yarn add sern-handler
+            
yarn add sern-handler
 
-
pnpm add sern-handler
+            
pnpm add sern-handler
 
- -

Basic Usage

-
+ +

Basic Usage

+
- -

index.js

-
-
import { Client, Intents } from 'discord.js';
import { Sern } from 'sern-handler';
import { prefix, token } from '../src/secrets.json';

const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MEMBERS
]
});

new Sern.Handler({
client,
prefix,
commands : 'dist/commands',
privateServers : [
{
test : true,
id: 'server-id'
}
],
init: async (handler) => {
// Optional function to initialize anything else on bot startup
},
});


client.login(token); + +

index.js

+
+
import { Client, Intents } from 'discord.js';
import { Sern } from 'sern-handler';
import { prefix, token } from '../src/secrets.json';

const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MEMBERS
]
});

new Sern.Handler({
client,
prefix,
commands : 'dist/commands',
privateServers : [
{
test : true,
id: 'server-id'
}
],
init: async (handler) => {
// Optional function to initialize anything else on bot startup
},
});


client.login(token);
- -

ping.js

-
-
import { Sern, Types } from 'sern-handler';
import { Ok } from 'ts-results';

export default {
alias: [],
desc : 'A ping pong command',
visibility : 'private',
test : false,
type: Sern.CommandType.SLASH | Sern.CommandType.TEXT,
execute : async ({ message, interaction }, args) => {
interaction.reply({ content: 'Pong! });
}
}; + +

ping.js

+
+
import { Sern, Types } from 'sern-handler';
import { Ok } from 'ts-results';

export default {
alias: [],
desc : 'A ping pong command',
visibility : 'private',
test : false,
type: Sern.CommandType.SLASH | Sern.CommandType.TEXT,
execute : async ({ message, interaction }, args) => {
interaction.reply({ content: 'Pong! });
}
};
-

See documentation for TypeScript examples and more

+

See documentation for TypeScript examples and more

- -

Links link

-
- + +

Links link

+
+ - -

Contribute

-
-
    -
  • Pull up on issues and tell me if there are bugs
  • -
  • All kinds of contributions are welcomed!
  • -
-

Settings

Theme

Generated using TypeDoc

\ No newline at end of file + +

Contribute

+
+
    +
  • + Pull up on issues and tell me if there are bugs +
  • +
  • All kinds of contributions are welcomed!
  • +
+
+
+ +
+
+
+
+

Settings

+

+ Theme + +

+
+
+
+

Generated using TypeDoc

+
+
+ + + diff --git a/docs/interfaces/Sern.Module.html b/docs/interfaces/Sern.Module.html index 71934dad..2f2e2b74 100644 --- a/docs/interfaces/Sern.Module.html +++ b/docs/interfaces/Sern.Module.html @@ -1,8 +1,559 @@ -Module | sern-handler
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Module<T>

-

An object that gets imported and acts as a command.

-
property

{string} desc

-
property

{Visibility} visibility

-
property

{CommandType} type

-
property

{(eventParams : Context, args : Ok<T=string>) => Awaitable<possibleOutput | void>)} execute

-
prop

{(ctx: Context, args: Arg) => Utils.ArgType} parse

-

Type parameters

  • T = string

Hierarchy

  • Module

Index

Properties

alias: string[]
desc: string
test: boolean
visibility: Visibility

Methods

Legend

  • Property
  • Method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file + + + + + + Module | sern-handler + + + + + + + + +
+
+
+
+ +
+
+ Options +
+
+ All +
    +
  • Public
  • +
  • Public/Protected
  • +
  • All
  • +
+
+ +
+
+ Menu +
+
+
+
+
+
+ +

Interface Module<T>

+
+
+
+
+
+
+
+
+
+

An object that gets imported and acts as a command.

+
+
+
property
+

{string} desc

+
property
+

{Visibility} visibility

+
property
+

{CommandType} type

+
property
+
+

+ {(eventParams : Context, args : Ok<T=string>) => Awaitable<possibleOutput | void>} + execute +

+
+
prop
+
+
+
+
+
+

Type parameters

+
    +
  • +

    T = string

    +
  • +
+
+
+

Hierarchy

+
    +
  • Module
  • +
+
+
+

Index

+
+
+
+

Properties

+ +
+
+

Methods

+ +
+
+
+
+
+

Properties

+
+ + +
+ alias: string[] +
+ +
+
+ + +
+ desc: string +
+ +
+
+ + +
+ test: boolean +
+ +
+
+ + +
+ type: + CommandType +
+ +
+
+ + +
+ visibility: + Visibility +
+ +
+
+
+

Methods

+
+ + + + +
+
+ + + + +
+
+
+ +
+
+
+
+

Legend

+
+
    +
  • Property
  • +
  • Method
  • +
+
+

Settings

+

+ Theme + +

+
+
+
+

Generated using TypeDoc

+
+
+ + + diff --git a/docs/interfaces/Sern.Wrapper.html b/docs/interfaces/Sern.Wrapper.html index 01312d3d..7fe8f9d3 100644 --- a/docs/interfaces/Sern.Wrapper.html +++ b/docs/interfaces/Sern.Wrapper.html @@ -1,8 +1,409 @@ -Wrapper | sern-handler
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Wrapper

-

An object to be passed into Sern.Handler constructor.

-
property

{readonly Client} client

-
property

{readonly string} prefix

-
property

{readonly string} commands

-
prop

{(handler : Handler) => void)} init

-
property

{readonly {test: boolean, id: string}[]} privateServers

-

Hierarchy

  • Wrapper

Index

Properties

client: Client<boolean>
commands: string
prefix: string
privateServers: { id: string; test: boolean }[]

Methods

Legend

  • Property
  • Method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file + + + + + + Wrapper | sern-handler + + + + + + + + +
+
+
+
+ +
+
+ Options +
+
+ All +
    +
  • Public
  • +
  • Public/Protected
  • +
  • All
  • +
+
+ +
+
+ Menu +
+
+
+
+
+
+ +

Interface Wrapper

+
+
+
+
+
+
+
+
+
+

An object to be passed into Sern.Handler constructor.

+
+
+
property
+

{readonly Client} client

+
property
+

{readonly string} prefix

+
property
+

{readonly string} commands

+
prop
+

{(handler : Handler) => void)} init

+
property
+

{readonly {test: boolean, id: string}[]} privateServers

+
+
+
+
+

Hierarchy

+
    +
  • Wrapper
  • +
+
+
+

Index

+
+
+
+

Properties

+ +
+
+

Methods

+ +
+
+
+
+
+

Properties

+
+ + +
+ client: Client<boolean> +
+ +
+
+ + +
+ commands: string +
+ +
+
+ + +
+ prefix: string +
+ +
+
+ + +
+ privateServers: + { id: string; test: boolean }[] +
+ +
+
+
+

Methods

+
+ + +
    +
  • + init(handler: Handler): void +
  • +
+ +
+
+
+ +
+
+
+
+

Legend

+
+
    +
  • Property
  • +
  • Method
  • +
+
+

Settings

+

+ Theme + +

+
+
+
+

Generated using TypeDoc

+
+
+ + + diff --git a/docs/modules.html b/docs/modules.html index 3d28a777..44bf4f6b 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1 +1,115 @@ -sern-handler
Options
All
  • Public
  • Public/Protected
  • All
Menu

sern-handler

Settings

Theme

Generated using TypeDoc

\ No newline at end of file + + + + + + SernHandler + + + + + + + + +
+
+
+
+ +
+
+ Options +
+
+ All +
    +
  • Public
  • +
  • Public/Protected
  • +
  • All
  • +
+
+ +
+
+ Menu +
+
+
+
+
+

sern-handler

+
+
+
+
+
+
+

Index

+
+
+
+

Namespaces

+ +
+
+
+
+
+ +
+
+
+
+

Settings

+

+ Theme + +

+
+
+
+

Generated using TypeDoc

+
+
+ + + diff --git a/docs/modules/Sern.html b/docs/modules/Sern.html index 98d3b902..ac7c905b 100644 --- a/docs/modules/Sern.html +++ b/docs/modules/Sern.html @@ -1 +1,155 @@ -Sern | sern-handler
Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Sern

Settings

Theme

Generated using TypeDoc

\ No newline at end of file + + + + + + Sern | sern-handler + + + + + + + + +
+
+
+
+ +
+
+ Options +
+
+ All +
    +
  • Public
  • +
  • Public/Protected
  • +
  • All
  • +
+
+ +
+
+ Menu +
+
+
+
+
+
+ +

Namespace Sern

+
+
+
+
+
+
+
+

Index

+
+
+
+

Enumerations

+ +
+
+

Classes

+ +
+
+

Interfaces

+ +
+
+
+
+
+ +
+
+
+
+

Settings

+

+ Theme + +

+
+
+
+

Generated using TypeDoc

+
+
+ + + diff --git a/docs/modules/Types.html b/docs/modules/Types.html index 00e931cb..2ae10487 100644 --- a/docs/modules/Types.html +++ b/docs/modules/Types.html @@ -1 +1,533 @@ -Types | sern-handler
Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Types

Index

Type aliases

Arg: ParseType<{ slash: SlashOptions; text: string }>
Context: { interaction: Option<CommandInteraction>; message: Option<Message> }

Type declaration

  • interaction: Option<CommandInteraction>
  • message: Option<Message>
Nullable<T>: T | null

Type parameters

  • T

ParseType<T>: { [ K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never }[keyof T]

Type parameters

  • T

SlashOptions: Omit<CommandInteractionOptionResolver, "getMessage" | "getFocused">
Visibility: "private" | "public"
execute: Module<unknown>["execute"]
possibleOutput<T>: T | (MessagePayload & MessageOptions)

Type parameters

  • T = string

Settings

Theme

Generated using TypeDoc

\ No newline at end of file + + + + + + Types | sern-handler + + + + + + + + +
+
+
+
+ +
+
+ Options +
+
+ All +
    +
  • Public
  • +
  • Public/Protected
  • +
  • All
  • +
+
+ +
+
+ Menu +
+
+
+
+
+
+ +

Namespace Types

+
+
+
+
+
+
+
+

Index

+
+
+
+

Type aliases

+ +
+
+
+
+
+

Type aliases

+
+ + +
+ Arg: + ParseType<{ slash: SlashOptions; text: string }> +
+ +
+
+ + +
+ Context: + { interaction: Option<CommandInteraction>; message: Option<Message> } +
+ +
+

Type declaration

+
    +
  • +
    + interaction: Option<CommandInteraction> +
    +
  • +
  • +
    + message: Option<Message> +
    +
  • +
+
+
+
+ + +
+ Nullable<T>: + T | null +
+ +

Type parameters

+
    +
  • T

  • +
+
+
+ + +
+ ParseType<T>: + { [ K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never + }[keyof T] +
+ +

Type parameters

+
    +
  • T

  • +
+
+
+ + +
+ SlashOptions: + Omit<CommandInteractionOptionResolver, "getMessage" | "getFocused"> +
+ +
+
+ + +
+ Visibility: + "private" | "public" +
+ +
+
+ + +
+ execute: + Module<unknown>["execute"] +
+ +
+
+ + +
+ possibleOutput<T>: + T | (MessagePayload & MessageOptions) +
+ +

Type parameters

+
    +
  • +

    T = string

    +
  • +
+
+
+
+ +
+
+
+
+

Settings

+

+ Theme + +

+
+
+
+

Generated using TypeDoc

+
+
+ + + diff --git a/docs/modules/Utils.html b/docs/modules/Utils.html index b4b76565..74c2dfdb 100644 --- a/docs/modules/Utils.html +++ b/docs/modules/Utils.html @@ -1,25 +1,659 @@ -Utils | sern-handler
Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Utils

Index

Type aliases

ArgType<T>: Result<T, possibleOutput>
-

Wrapper type taking Ok(T) or Err(possibleOutput) e.g Result<T, possibleOutput

-

Type parameters

  • T

Functions

  • parseBool(arg: string, onFailure?: possibleOutput<string>, regexes?: { noRegex: RegExp; yesRegex: RegExp }): ArgType<boolean>
  • toArr(arg: string, sep?: string): ArgType<string[]>

Settings

Theme

Generated using TypeDoc

\ No newline at end of file + + + + + + Utils | sern-handler + + + + + + + + +
+
+
+
+ +
+
+ Options +
+
+ All +
    +
  • Public
  • +
  • Public/Protected
  • +
  • All
  • +
+
+ +
+
+ Menu +
+
+
+
+
+
+ +

Namespace Utils

+
+
+
+
+
+
+
+

Index

+
+
+
+

Type aliases

+ +
+
+

Functions

+ +
+
+
+
+
+

Type aliases

+
+ + +
+ ArgType<T>: + Result<T, possibleOutput> +
+ +
+
+

+ Wrapper type taking Ok(T) or Err(possibleOutput) e.g + Result<T, possibleOutput +

+
+
+

Type parameters

+
    +
  • T

  • +
+
+
+
+

Functions

+
+ + +
    +
  • + parseBool(arg: string, onFailure?: possibleOutput<string>, regexes?: { noRegex: RegExp; yesRegex: RegExp }): ArgType<boolean> +
  • +
+
    +
  • + +

    Parameters

    +
      +
    • +
      arg: string
      +
      +
      +

      command arguments

      +
      +
      +
    • +
    • +
      + onFailure: + possibleOutput<string> = ... +
      +
      +
      +

      If cannot parse arg into boolean.

      +
      +
      +
    • +
    • +
      + regexes: { noRegex: RegExp; yesRegex: RegExp } = ... +
      +
        +
      • +
        + noRegex: RegExp +
        +
      • +
      • +
        + yesRegex: RegExp +
        +
      • +
      +
    • +
    +

    + Returns + ArgType<boolean> +

    +
    +

    attemps to parse args as a boolean

    +
    +
  • +
+
+
+ + + + +
+
+ + +
    +
  • + toArr(arg: string, sep?: string): ArgType<string[]> +
  • +
+ +
+
+ + + + +
+
+ + + + +
+
+
+ +
+
+
+
+

Settings

+

+ Theme + +

+
+
+
+

Generated using TypeDoc

+
+
+ + + diff --git a/package-lock.json b/package-lock.json index 81891b50..4d7419a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1934,42 +1934,40 @@ } }, "node_modules/@discordjs/builders": { - "version": "0.13.0-dev.1647259738.2297c2b", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.13.0-dev.1647259738.2297c2b.tgz", - "integrity": "sha512-SywFeczvI8p3US9k2gD2Iza4jPgDpKzuwA8ISrhWF9gPyECxUpgndgW5iZ1M8PhNKjtdZ9Gwn+P7mDpWgpGwZA==", + "version": "0.14.0-dev.1653091712-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.14.0-dev.1653091712-fdeac9d.tgz", + "integrity": "sha512-7/esDI5KkDBI8sxSNFmPYNQXMUTbopD4FkjBAm+nQmp5Xxda1xFjWvi3oJ7QC8l/IVanUAD47xxrb8lhckMRzA==", "dependencies": { - "@sindresorhus/is": "^4.4.0", - "discord-api-types": "^0.27.3", + "@sapphire/shapeshift": "^3.0.0", + "@sindresorhus/is": "^4.6.0", + "discord-api-types": "^0.33.0", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1", - "zod": "^3.11.6" + "ts-mixer": "^6.0.1", + "tslib": "^2.3.1" }, "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/collection": { - "version": "0.6.0-dev.1647259738.2297c2b", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.6.0-dev.1647259738.2297c2b.tgz", - "integrity": "sha512-A+c2qy2HCzVDD3MAoIsL+MKPJhI+jCrcZbIIc6nRZcnCKT544qlI2Sr972sw1bzOj97HD/m4Qd0ElUeQzkHsbQ==", + "version": "0.7.0-dev.1653091708-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1653091708-fdeac9d.tgz", + "integrity": "sha512-21gKkNVlqWMTf5kkZ2uAkfe8kU149w/JXC9Vpu7nNEir6A5AHNPULtd+1FssvXYAfoEnzus7/gZC6pYD5eX/gQ==", "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/rest": { - "version": "0.4.0-dev.1647259762.2297c2b", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.4.0-dev.1647259762.2297c2b.tgz", - "integrity": "sha512-Pt1InmNvdDKSO8/vZg7K2VLB05iOdtScM9jHczLd3NsMWd66DDOzNorKQUjc84nL80RkZ7CCELy/eOn0uwrN4A==", - "dependencies": { - "@discordjs/collection": "^0.6.0-dev", - "@sapphire/async-queue": "^1.2.0", - "@sapphire/snowflake": "^3.1.0", - "@types/node-fetch": "^2.5.12", - "discord-api-types": "^0.27.0", - "form-data": "^4.0.0", - "node-fetch": "^2.6.7", - "tslib": "^2.3.1" + "version": "0.5.0-dev.1653091732-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.5.0-dev.1653091732-fdeac9d.tgz", + "integrity": "sha512-2XIobHE+C0X/LFJC205CSeiHKvt0aBRqYb5dwAoq6VsZAprmvL+Mma0V2bKWInaOCmrr85X+XlEgQf+H22CK+A==", + "dependencies": { + "@discordjs/collection": "^0.7.0-dev", + "@sapphire/async-queue": "^1.3.1", + "@sapphire/snowflake": "^3.2.1", + "discord-api-types": "^0.33.0", + "tslib": "^2.3.1", + "undici": "^5.2.0" }, "engines": { "node": ">=16.9.0" @@ -2460,18 +2458,27 @@ } }, "node_modules/@sapphire/async-queue": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.0.tgz", - "integrity": "sha512-z+CDw5X4UgIEpZL8KM+ThVx1i8V60HBg0l/oFewTNbQQeRDJHdVxHyJykv+SF1H+Rc8EkMS81VTWo95jVYgO/g==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", + "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" } }, + "node_modules/@sapphire/shapeshift": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.0.0.tgz", + "integrity": "sha512-LTVj/a70UDzjOFaViMGpVzSzKYD2pBk0TmZIHnBf4vnytV7TK/L6XVN6hslq7R+qwRZyL/mzIldu6mAV6r7vzA==", + "engines": { + "node": ">=v15.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/@sapphire/snowflake": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.0.tgz", - "integrity": "sha512-tfHzY+6/5bbHdB+uNqsEQ5rhjaZAoFUrqP/l1S5jwxMdKeSCIiGkJjcE99/WGGdzyWGjTNgNVX/dt4Me/FdMlg==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", + "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" @@ -2644,28 +2651,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.10.tgz", "integrity": "sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog==" }, - "node_modules/@types/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", - "dependencies": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, - "node_modules/@types/node-fetch/node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", @@ -3077,7 +3062,8 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "node_modules/babel-jest": { "version": "27.5.1", @@ -3467,6 +3453,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -4147,6 +4134,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, "engines": { "node": ">=0.4.0" } @@ -4201,24 +4189,25 @@ } }, "node_modules/discord-api-types": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.27.3.tgz", - "integrity": "sha512-HOG64DTpZ7CB5EU9eKbjHD50H5qG1pxKG8pmFfHUMKjKvEWeLBHfw0c9xF1cruiYLnBb3+n7m3jBWxZ3H1hcgQ==" + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.0.tgz", + "integrity": "sha512-RS1dMM6xuMhdHwQJ0T+XuCD7v1tKnyZ89Eq6q/DbOJWMbIh3ihgAzDhcF70QsFCtk9a5Gn9XU29S7eoEXuwQ5w==" }, "node_modules/discord.js": { - "version": "14.0.0-dev.1647259751.2297c2b", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.0-dev.1647259751.2297c2b.tgz", - "integrity": "sha512-3VgjiwAcJEEjzchvqFofClncISEivPawX7zeLT+7Kabqm7GIj+p5tfD8MIBbJPm/chcNDc/k2IN1uL154bKV7g==", - "dependencies": { - "@discordjs/builders": "^0.13.0-dev", - "@discordjs/collection": "^0.6.0-dev", - "@discordjs/rest": "^0.4.0-dev", - "@sapphire/snowflake": "^3.1.0", - "@types/ws": "^8.2.2", - "discord-api-types": "^0.27.3", + "version": "14.0.0-dev.1653091711-fdeac9d", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.0-dev.1653091711-fdeac9d.tgz", + "integrity": "sha512-wXx4tuWUcIadzWkfHgB190AUif5YXSA8udZ16F/S1kH37QeKGUsBGlAyn2WRmw/3oP2QA2FUIcJUQCGdcUExPg==", + "dependencies": { + "@discordjs/builders": "^0.14.0-dev", + "@discordjs/collection": "^0.7.0-dev", + "@discordjs/rest": "^0.5.0-dev", + "@sapphire/snowflake": "^3.2.1", + "@types/ws": "^8.5.3", + "discord-api-types": "^0.33.0", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", - "undici": "^4.14.1", + "tslib": "^2.3.1", + "undici": "^5.2.0", "ws": "^8.5.0" }, "engines": { @@ -4883,19 +4872,6 @@ "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/fs-access": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", @@ -6919,6 +6895,7 @@ "version": "1.51.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "dev": true, "engines": { "node": ">= 0.6" } @@ -6927,6 +6904,7 @@ "version": "2.1.34", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "dev": true, "dependencies": { "mime-db": "1.51.0" }, @@ -7002,25 +6980,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -8463,11 +8422,6 @@ "node": ">=6" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, "node_modules/trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", @@ -8658,9 +8612,9 @@ } }, "node_modules/undici": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-4.15.1.tgz", - "integrity": "sha512-h8LJybhMKD09IyQZoQadNtIR/GmugVhTOVREunJrpV6RStriKBFdSVoFzEzTihwXi/27DIBO+Z0OGF+Mzfi0lA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.2.0.tgz", + "integrity": "sha512-XY6+NS3WH9b3TKOHeNz2CjR+qrVz/k4fO9g3etPpLozRvULoQmZ1+dk9JbIz40ehn27xzFk4jYVU2MU3Nle62A==", "engines": { "node": ">=12.18" } @@ -8817,11 +8771,6 @@ "makeerror": "1.0.12" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, "node_modules/whatwg-encoding": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", @@ -8837,15 +8786,6 @@ "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", "dev": true }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -9071,14 +9011,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zod": { - "version": "3.13.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.13.4.tgz", - "integrity": "sha512-LZRucWt4j/ru5azOkJxCfpR87IyFDn8h2UODdqvXzZLb3K7bb9chUrUIGTy3BPsr8XnbQYfQ5Md5Hu2OYIo1mg==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } } }, "dependencies": { @@ -10440,36 +10372,34 @@ } }, "@discordjs/builders": { - "version": "0.13.0-dev.1647259738.2297c2b", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.13.0-dev.1647259738.2297c2b.tgz", - "integrity": "sha512-SywFeczvI8p3US9k2gD2Iza4jPgDpKzuwA8ISrhWF9gPyECxUpgndgW5iZ1M8PhNKjtdZ9Gwn+P7mDpWgpGwZA==", + "version": "0.14.0-dev.1653091712-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.14.0-dev.1653091712-fdeac9d.tgz", + "integrity": "sha512-7/esDI5KkDBI8sxSNFmPYNQXMUTbopD4FkjBAm+nQmp5Xxda1xFjWvi3oJ7QC8l/IVanUAD47xxrb8lhckMRzA==", "requires": { - "@sindresorhus/is": "^4.4.0", - "discord-api-types": "^0.27.3", + "@sapphire/shapeshift": "^3.0.0", + "@sindresorhus/is": "^4.6.0", + "discord-api-types": "^0.33.0", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1", - "zod": "^3.11.6" + "ts-mixer": "^6.0.1", + "tslib": "^2.3.1" } }, "@discordjs/collection": { - "version": "0.6.0-dev.1647259738.2297c2b", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.6.0-dev.1647259738.2297c2b.tgz", - "integrity": "sha512-A+c2qy2HCzVDD3MAoIsL+MKPJhI+jCrcZbIIc6nRZcnCKT544qlI2Sr972sw1bzOj97HD/m4Qd0ElUeQzkHsbQ==" + "version": "0.7.0-dev.1653091708-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1653091708-fdeac9d.tgz", + "integrity": "sha512-21gKkNVlqWMTf5kkZ2uAkfe8kU149w/JXC9Vpu7nNEir6A5AHNPULtd+1FssvXYAfoEnzus7/gZC6pYD5eX/gQ==" }, "@discordjs/rest": { - "version": "0.4.0-dev.1647259762.2297c2b", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.4.0-dev.1647259762.2297c2b.tgz", - "integrity": "sha512-Pt1InmNvdDKSO8/vZg7K2VLB05iOdtScM9jHczLd3NsMWd66DDOzNorKQUjc84nL80RkZ7CCELy/eOn0uwrN4A==", - "requires": { - "@discordjs/collection": "^0.6.0-dev", - "@sapphire/async-queue": "^1.2.0", - "@sapphire/snowflake": "^3.1.0", - "@types/node-fetch": "^2.5.12", - "discord-api-types": "^0.27.0", - "form-data": "^4.0.0", - "node-fetch": "^2.6.7", - "tslib": "^2.3.1" + "version": "0.5.0-dev.1653091732-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.5.0-dev.1653091732-fdeac9d.tgz", + "integrity": "sha512-2XIobHE+C0X/LFJC205CSeiHKvt0aBRqYb5dwAoq6VsZAprmvL+Mma0V2bKWInaOCmrr85X+XlEgQf+H22CK+A==", + "requires": { + "@discordjs/collection": "^0.7.0-dev", + "@sapphire/async-queue": "^1.3.1", + "@sapphire/snowflake": "^3.2.1", + "discord-api-types": "^0.33.0", + "tslib": "^2.3.1", + "undici": "^5.2.0" } }, "@eslint/eslintrc": { @@ -10852,14 +10782,19 @@ } }, "@sapphire/async-queue": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.0.tgz", - "integrity": "sha512-z+CDw5X4UgIEpZL8KM+ThVx1i8V60HBg0l/oFewTNbQQeRDJHdVxHyJykv+SF1H+Rc8EkMS81VTWo95jVYgO/g==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", + "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==" + }, + "@sapphire/shapeshift": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.0.0.tgz", + "integrity": "sha512-LTVj/a70UDzjOFaViMGpVzSzKYD2pBk0TmZIHnBf4vnytV7TK/L6XVN6hslq7R+qwRZyL/mzIldu6mAV6r7vzA==" }, "@sapphire/snowflake": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.0.tgz", - "integrity": "sha512-tfHzY+6/5bbHdB+uNqsEQ5rhjaZAoFUrqP/l1S5jwxMdKeSCIiGkJjcE99/WGGdzyWGjTNgNVX/dt4Me/FdMlg==" + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", + "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==" }, "@sindresorhus/is": { "version": "4.6.0", @@ -11019,27 +10954,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.10.tgz", "integrity": "sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog==" }, - "@types/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", - "requires": { - "@types/node": "*", - "form-data": "^3.0.0" - }, - "dependencies": { - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - } - } - }, "@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", @@ -11319,7 +11233,8 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "babel-jest": { "version": "27.5.1", @@ -11626,6 +11541,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -12167,7 +12083,8 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "detect-indent": { "version": "6.0.0", @@ -12204,24 +12121,25 @@ } }, "discord-api-types": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.27.3.tgz", - "integrity": "sha512-HOG64DTpZ7CB5EU9eKbjHD50H5qG1pxKG8pmFfHUMKjKvEWeLBHfw0c9xF1cruiYLnBb3+n7m3jBWxZ3H1hcgQ==" + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.0.tgz", + "integrity": "sha512-RS1dMM6xuMhdHwQJ0T+XuCD7v1tKnyZ89Eq6q/DbOJWMbIh3ihgAzDhcF70QsFCtk9a5Gn9XU29S7eoEXuwQ5w==" }, "discord.js": { - "version": "14.0.0-dev.1647259751.2297c2b", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.0-dev.1647259751.2297c2b.tgz", - "integrity": "sha512-3VgjiwAcJEEjzchvqFofClncISEivPawX7zeLT+7Kabqm7GIj+p5tfD8MIBbJPm/chcNDc/k2IN1uL154bKV7g==", - "requires": { - "@discordjs/builders": "^0.13.0-dev", - "@discordjs/collection": "^0.6.0-dev", - "@discordjs/rest": "^0.4.0-dev", - "@sapphire/snowflake": "^3.1.0", - "@types/ws": "^8.2.2", - "discord-api-types": "^0.27.3", + "version": "14.0.0-dev.1653091711-fdeac9d", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.0-dev.1653091711-fdeac9d.tgz", + "integrity": "sha512-wXx4tuWUcIadzWkfHgB190AUif5YXSA8udZ16F/S1kH37QeKGUsBGlAyn2WRmw/3oP2QA2FUIcJUQCGdcUExPg==", + "requires": { + "@discordjs/builders": "^0.14.0-dev", + "@discordjs/collection": "^0.7.0-dev", + "@discordjs/rest": "^0.5.0-dev", + "@sapphire/snowflake": "^3.2.1", + "@types/ws": "^8.5.3", + "discord-api-types": "^0.33.0", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", - "undici": "^4.14.1", + "tslib": "^2.3.1", + "undici": "^5.2.0", "ws": "^8.5.0" } }, @@ -12726,16 +12644,6 @@ "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, "fs-access": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", @@ -14274,12 +14182,14 @@ "mime-db": { "version": "1.51.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "dev": true }, "mime-types": { "version": "2.1.34", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "dev": true, "requires": { "mime-db": "1.51.0" } @@ -14340,14 +14250,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -15425,11 +15327,6 @@ "universalify": "^0.1.2" } }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, "trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", @@ -15558,9 +15455,9 @@ "optional": true }, "undici": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-4.15.1.tgz", - "integrity": "sha512-h8LJybhMKD09IyQZoQadNtIR/GmugVhTOVREunJrpV6RStriKBFdSVoFzEzTihwXi/27DIBO+Z0OGF+Mzfi0lA==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.2.0.tgz", + "integrity": "sha512-XY6+NS3WH9b3TKOHeNz2CjR+qrVz/k4fO9g3etPpLozRvULoQmZ1+dk9JbIz40ehn27xzFk4jYVU2MU3Nle62A==" }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", @@ -15692,11 +15589,6 @@ "makeerror": "1.0.12" } }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, "whatwg-encoding": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", @@ -15712,15 +15604,6 @@ "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", "dev": true }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -15885,11 +15768,6 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true - }, - "zod": { - "version": "3.13.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.13.4.tgz", - "integrity": "sha512-LZRucWt4j/ru5azOkJxCfpR87IyFDn8h2UODdqvXzZLb3K7bb9chUrUIGTy3BPsr8XnbQYfQ5Md5Hu2OYIo1mg==" } } } diff --git a/package.json b/package.json index 20e29431..9572ee32 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@sern/handler", - "version": "0.0.1", - "description": "", + "version": "1.0.0-beta", + "description": "A customizable, batteries-included, powerful discord.js framework to automate and streamline bot development.", "main": "dist/index.js", "scripts": { "compile": "tsc", @@ -10,12 +10,19 @@ "format": "eslint src/**/*.ts --fix", "release": "standard-version && git push --follow-tags", "test": "jest --coverage --verbose", - "commit": "cz", - "docs": "typedoc src/index.ts --out docs" + "commit": "cz" }, - "keywords": [], - "author": "", - "license": "ISC", + "keywords": [ + "sern-handler", + "sern", + "handler", + "sern handler", + "wrapper", + "discord.js", + "framework" + ], + "author": "SernDevs", + "license": "MIT", "dependencies": { "discord.js": "^14.0.0-dev.1647259751.2297c2b", "rxjs": "^7.5.5", diff --git a/src/handler/events/interactionCreate.ts b/src/handler/events/interactionCreate.ts index 713ba610..2c8e5c1b 100644 --- a/src/handler/events/interactionCreate.ts +++ b/src/handler/events/interactionCreate.ts @@ -2,82 +2,175 @@ import type { CommandInteraction, Interaction, MessageComponentInteraction, - MessageContextMenuCommandInteraction as MessageCtxInt, - UserContextMenuCommandInteraction as UserCtxInt, + ModalSubmitInteraction, + SelectMenuInteraction, } from 'discord.js'; -import type { SelectMenuInteraction } from 'discord.js'; -import { concatMap, fromEvent, Observable, of, throwError } from 'rxjs'; +import { concatMap, fromEvent, map, Observable, of, throwError } from 'rxjs'; import type Wrapper from '../structures/wrapper'; import * as Files from '../utilities/readFile'; -import { match, P } from 'ts-pattern'; +import { match } from 'ts-pattern'; import { SernError } from '../structures/errors'; import Context from '../structures/context'; -import type { Result } from 'ts-results'; -import { CommandType, controller } from '../sern'; -import type { Args, UnionToTuple } from '../../types/handler'; +import { controller } from '../sern'; import type { Module } from '../structures/module'; -import type { EventPlugin } from '../plugins/plugin'; -import { isButton, isChatInputCommand, isSelectMenu } from '../utilities/predicates'; - +import { + isButton, + isChatInputCommand, + isMessageCtxMenuCmd, + isPromise, + isSelectMenu, + isUserContextMenuCmd, +} from '../utilities/predicates'; +import { filterCorrectModule } from './observableHandling'; +import { CommandType } from '../structures/enums'; +import type { Result } from 'ts-results'; +import type { AutocompleteInteraction } from 'discord.js'; function applicationCommandHandler(mod: Module | undefined, interaction: CommandInteraction) { - if (mod === undefined) { - return throwError(() => SernError.UndefinedModule); - } - const eventPlugins = mod.onEvent; - return match(interaction) - .when(isChatInputCommand, i => { + const mod$ = (cmdTy: T) => of(mod).pipe(filterCorrectModule(cmdTy)); + return ( + match(interaction) + .when(isChatInputCommand, i => { const ctx = Context.wrap(i); - const res = eventPlugins.map(e => { - return (>e).execute( - [ctx, ['slash', i.options]] - , controller); - }) as Awaited>[]; - //Possible unsafe cast - // could result in the promises not being resolved - return of({ type: CommandType.Slash, res, mod, ctx }); - }, - ) - .when( - () => P._, - (ctx: UserCtxInt | MessageCtxInt) => { - //Kinda hackish - const res = eventPlugins.map(e => { - return e.execute( - [ctx] as UnionToTuple - , controller); - }) as Awaited>[]; - return of({ type: mod.type, res, mod, ctx }); - }, - ) - .run(); + return mod$(CommandType.Slash).pipe( + concatMap(m => { + return of( + m.onEvent.map(e => e.execute([ctx, ['slash', i.options]], controller)), + ).pipe( + map(res => ({ + mod, + res, + execute() { + return m.execute(ctx, ['slash', i.options]); + }, + })), + ); + }), + ); + }) + //Todo: refactor so that we dont have to have two separate branches. They're near identical!! + //Only thing that differs is type of interaction + .when(isMessageCtxMenuCmd, ctx => { + return mod$(CommandType.MenuMsg).pipe( + concatMap(m => { + return of(m.onEvent.map(e => e.execute([ctx], controller))).pipe( + map(res => ({ + mod, + res, + execute() { + return m.execute(ctx); + }, + })), + ); + }), + ); + }) + .when(isUserContextMenuCmd, ctx => { + return mod$(CommandType.MenuUser).pipe( + concatMap(m => { + return of(m.onEvent.map(e => e.execute([ctx], controller))).pipe( + map(res => ({ + mod, + res, + execute() { + return m.execute(ctx); + }, + })), + ); + }), + ); + }) + .run() + ); } function messageComponentInteractionHandler( mod: Module | undefined, interaction: MessageComponentInteraction, ) { - if (mod === undefined) { - return throwError(() => SernError.UndefinedModule); - } - const eventPlugins = mod.onEvent; + const mod$ = (ty: T) => of(mod).pipe(filterCorrectModule(ty)); + //Todo: refactor so that we dont have to have two separate branches. They're near identical!! + //Only thing that differs is type of interaction return match(interaction) .when(isButton, ctx => { - const res = eventPlugins.map(e => { - return (>e).execute([ctx], controller); - }) as Awaited>[]; - return of({ type: mod.type, res, mod, ctx }); + return mod$(CommandType.Button).pipe( + concatMap(m => { + return of(m.onEvent.map(e => e.execute([ctx], controller))).pipe( + map(res => ({ + mod, + res, + execute() { + return m.execute(ctx); + }, + })), + ); + }), + ); }) .when(isSelectMenu, (ctx: SelectMenuInteraction) => { - const res = eventPlugins.map(e => { - return (>e).execute([ctx], controller); - }) as Awaited>[]; - return of({ type: mod.type, res, mod, ctx }); + return mod$(CommandType.MenuSelect).pipe( + concatMap(m => { + return of(m.onEvent.map(e => e.execute([ctx], controller))).pipe( + map(res => ({ + mod, + res, + execute() { + return m.execute(ctx); + }, + })), + ); + }), + ); }) .otherwise(() => throwError(() => SernError.NotSupportedInteraction)); } -export const onInteractionCreate = (wrapper: Wrapper) => { +function modalHandler(modul: Module | undefined, ctx: ModalSubmitInteraction) { + return of(modul).pipe( + filterCorrectModule(CommandType.Modal), + concatMap(mod => { + return of(mod.onEvent.map(e => e.execute([ctx], controller))).pipe( + map(res => ({ + mod, + res, + execute() { + return mod.execute(ctx); + }, + })), + ); + }), + ); +} + +function autoCmpHandler(mod: Module | undefined, interaction: AutocompleteInteraction) { + return of(mod).pipe( + filterCorrectModule(CommandType.Slash), + concatMap(mod => { + const choice = interaction.options.getFocused(true); + const selectedOption = mod.options?.find(o => o.autocomplete && o.name === choice.name); + if (selectedOption !== undefined && selectedOption.autocomplete) { + return of( + selectedOption.command.onEvent.map(e => e.execute([interaction], controller)), + ).pipe( + map(res => ({ + mod, + res, + execute() { + return selectedOption.command.execute(interaction); + }, + })), + ); + } + return throwError( + () => + SernError.NotSupportedInteraction + + ` There is probably no autocomplete tag for this option`, + ); + }), + ); +} + +export function onInteractionCreate(wrapper: Wrapper) { const { client } = wrapper; const interactionEvent$ = >fromEvent(client, 'interactionCreate'); @@ -88,21 +181,52 @@ export const onInteractionCreate = (wrapper: Wrapper) => { concatMap(interaction => { if (interaction.isCommand()) { const modul = - Files.ApplicationCommands[interaction.commandType].get(interaction.commandName) ?? - Files.BothCommands.get(interaction.commandName); + Files.ApplicationCommands[interaction.commandType].get( + interaction.commandName, + ) ?? Files.BothCommands.get(interaction.commandName); return applicationCommandHandler(modul, interaction); } if (interaction.isMessageComponent()) { - const modul = Files - .MessageCompCommands[interaction.componentType] - .get(interaction.customId); + const modul = Files.MessageCompCommands[interaction.componentType].get( + interaction.customId, + ); return messageComponentInteractionHandler(modul, interaction); - } else return throwError(() => SernError.NotSupportedInteraction); + } + if (interaction.isModalSubmit()) { + const modul = Files.ModalSubmitCommands.get(interaction.customId); + return modalHandler(modul, interaction); + } + if (interaction.isAutocomplete()) { + const modul = + Files.ApplicationCommands['1'].get(interaction.commandName) ?? + Files.BothCommands.get(interaction.commandName); + return autoCmpHandler(modul, interaction); + } + return throwError(() => SernError.NotSupportedInteraction); }), ) - .subscribe(m => { - m; + .subscribe({ + async next({ mod, res: eventPluginRes, execute }) { + const ePlugArr: Result[] = []; + for await (const res of eventPluginRes) { + if (isPromise(res)) { + ePlugArr.push(res); + } + ePlugArr.push(res as Awaited>); + } + if (ePlugArr.every(e => e.ok)) { + await execute(); + wrapper.sernEmitter?.emit('module.activate', { success: true, module: mod! }); + } else { + wrapper.sernEmitter?.emit('module.activate', { + success: false, + module: mod!, + reason: SernError.PluginFailure, + }); + } + }, + error(err) { + wrapper.sernEmitter?.emit('error', err); + }, }); - - -}; +} diff --git a/src/handler/events/messageEvent.ts b/src/handler/events/messageEvent.ts index bac6f12b..9b5d7ccd 100644 --- a/src/handler/events/messageEvent.ts +++ b/src/handler/events/messageEvent.ts @@ -1,13 +1,14 @@ import type { Message } from 'discord.js'; import { concatMap, from, fromEvent, map, Observable, of } from 'rxjs'; -import { Err } from 'ts-results'; import type { Args } from '../..'; -import { CommandType, controller } from '../sern'; +import { controller } from '../sern'; import Context from '../structures/context'; import type Wrapper from '../structures/wrapper'; import { fmt } from '../utilities/messageHelpers'; import * as Files from '../utilities/readFile'; import { filterCorrectModule, ignoreNonBot } from './observableHandling'; +import { CommandType } from '../structures/enums'; +import { SernError } from '../structures/errors'; export const onMessageCreate = (wrapper: Wrapper) => { const { client, defaultPrefix } = wrapper; @@ -20,9 +21,10 @@ export const onMessageCreate = (wrapper: Wrapper) => { map(message => { const [prefix, ...rest] = fmt(message, defaultPrefix); return { - ctx: Context.wrap(message), //TODO : check for BothCommand + ctx: Context.wrap(message), args: ['text', rest], mod: + Files.TextCommands.text.get(prefix) ?? Files.BothCommands.get(prefix) ?? Files.TextCommands.aliases.get(prefix), }; @@ -31,8 +33,8 @@ export const onMessageCreate = (wrapper: Wrapper) => { const ensureModuleType$ = processMessage$.pipe( concatMap(payload => of(payload.mod).pipe( - filterCorrectModule(CommandType.Text), // fix for BothCommand - map(textCommand => ({ ...payload, mod: textCommand })), + filterCorrectModule(CommandType.Text), + map(mod => ({ ...payload, mod })), ), ), ); @@ -41,9 +43,6 @@ export const onMessageCreate = (wrapper: Wrapper) => { concatMap(({ ctx, args, mod }) => { const res = Promise.all( mod.onEvent.map(ePlug => { - if ((ePlug.modType & mod.type) === 0) { - return Err.EMPTY; - } return ePlug.execute([ctx, args], controller); }), ); @@ -51,11 +50,22 @@ export const onMessageCreate = (wrapper: Wrapper) => { }), ); - processEventPlugins$.subscribe(({ mod, ctx, args, res }) => { - if (res.every(pl => pl.ok)) { - Promise.resolve(mod.execute(ctx, args)).then(() => console.log(mod)); - } else { - console.log(mod, 'failed'); - } + processEventPlugins$.subscribe({ + next({ mod, ctx, args, res }) { + if (res.every(pl => pl.ok)) { + Promise.resolve(mod.execute(ctx, args)).then(() => { + wrapper.sernEmitter?.emit('module.activate', { success: true, module: mod! }); + }); + } else { + wrapper.sernEmitter?.emit('module.activate', { + success: false, + module: mod!, + reason: SernError.PluginFailure, + }); + } + }, + error(e) { + wrapper.sernEmitter?.emit('error', e); + }, }); }; diff --git a/src/handler/events/observableHandling.ts b/src/handler/events/observableHandling.ts index e61b3314..ca744540 100644 --- a/src/handler/events/observableHandling.ts +++ b/src/handler/events/observableHandling.ts @@ -1,21 +1,19 @@ import type { Message } from 'discord.js'; import { Observable, throwError } from 'rxjs'; import { SernError } from '../structures/errors'; -import { isNotFromBot } from '../utilities/messageHelpers'; import type { Module, ModuleDefs } from '../structures/module'; import { correctModuleType } from '../utilities/predicates'; - export function filterCorrectModule(cmdType: T) { return (src: Observable) => new Observable(subscriber => { return src.subscribe({ next(mod) { + if (mod === undefined) { + return throwError(() => SernError.UndefinedModule); + } if (correctModuleType(mod, cmdType)) { - subscriber.next(mod); + subscriber.next(mod!); } else { - if (mod === undefined) { - return throwError(() => SernError.UndefinedModule); - } return throwError(() => SernError.MismatchModule); } }, @@ -30,15 +28,12 @@ export function ignoreNonBot(prefix: string) { new Observable(subscriber => { return src.subscribe({ next(m) { - const passAll = [ - isNotFromBot, - (m: Message) => - m.content - .slice(0, prefix.length) - .localeCompare(prefix, undefined, { sensitivity: 'accent' }) === 0, - ].every(fn => fn(m)); - - if (passAll) { + const messageFromHumanAndHasPrefix = + !m.author.bot && + m.content + .slice(0, prefix.length) + .localeCompare(prefix, undefined, { sensitivity: 'accent' }) === 0; + if (messageFromHumanAndHasPrefix) { subscriber.next(m); } }, @@ -47,4 +42,3 @@ export function ignoreNonBot(prefix: string) { }); }); } - diff --git a/src/handler/events/readyEvent.ts b/src/handler/events/readyEvent.ts index d1d43798..224a2ae2 100644 --- a/src/handler/events/readyEvent.ts +++ b/src/handler/events/readyEvent.ts @@ -1,14 +1,28 @@ -import { concat, concatMap, from, fromEvent, map, Observable, of, skip, take } from 'rxjs'; +import { + concat, + concatMap, + from, + fromEvent, + map, + Observable, + of, + skip, + take, + throwError, +} from 'rxjs'; import { basename } from 'path'; import * as Files from '../utilities/readFile'; import type Wrapper from '../structures/wrapper'; -import { CommandType, controller } from '../sern'; -import type { PluginType } from '../plugins/plugin'; +import { controller } from '../sern'; import type { Result } from 'ts-results'; +import { Err, Ok } from 'ts-results'; import type { Awaitable } from 'discord.js'; +import { ApplicationCommandType, ComponentType } from 'discord.js'; import type { Module } from '../structures/module'; import { match } from 'ts-pattern'; -import { ApplicationCommandType, ComponentType } from 'discord.js'; +import { SernError } from '../structures/errors'; +import type { DefinitelyDefined } from '../../types/handler'; +import { CommandType, PluginType } from '../structures/enums'; export const onReady = (wrapper: Wrapper) => { const { client, commands } = wrapper; @@ -23,21 +37,29 @@ export const onReady = (wrapper: Wrapper) => { }), ); const processPlugins$ = processCommandFiles$.pipe( - concatMap((mod) => { - const cmdPluginsRes = mod.plugins.map(plug => { - return { - ...plug, - name: plug?.name ?? 'Unnamed Plugin', - execute: plug.execute(client, mod, controller), - }; - }); + concatMap(mod => { + if (mod.type === CommandType.Autocomplete) { + return throwError( + () => + SernError.NonValidModuleType + + `. You cannot use command plugins and Autocomplete.`, + ); + } + const cmdPluginsRes = + mod.plugins?.map(plug => { + return { + ...plug, + name: plug?.name ?? 'Unnamed Plugin', + execute: plug.execute(client, mod, controller), + }; + }) ?? []; return of({ mod, cmdPluginsRes }); }), ); ( concat(ready$, processPlugins$) as Observable<{ - mod: Module; + mod: DefinitelyDefined; cmdPluginsRes: { execute: Awaitable>; type: PluginType.Command; @@ -48,46 +70,71 @@ export const onReady = (wrapper: Wrapper) => { ) .pipe( concatMap(pl => - from(Promise.all(pl.cmdPluginsRes.map(async e => ({ ...e, execute: await e.execute })))).pipe( - map(res => ({ ...pl, cmdPluginsRes: res })), - ), + from( + Promise.all( + pl.cmdPluginsRes.map(async e => ({ ...e, execute: await e.execute })), + ), + ).pipe(map(res => ({ ...pl, cmdPluginsRes: res }))), ), ) .subscribe(({ mod, cmdPluginsRes }) => { const loadedPluginsCorrectly = cmdPluginsRes.every(res => res.execute.ok); if (loadedPluginsCorrectly) { - registerModule(mod); + const res = registerModule(mod); + if (res.err) { + throw Error( + SernError.NonValidModuleType + + ', or loading modules was handled incorrectly. ' + + 'Check commands path and command files!', + ); + } + wrapper.sernEmitter?.emit('module.register', { success: true, module: mod }); } else { - console.log(`Failed to load command ${mod.name!}`); - console.log(mod); + wrapper.sernEmitter?.emit('module.register', { + success: false, + module: mod, + reason: SernError.PluginFailure, + }); } }); }; -function registerModule(mod: Module) { - const name = mod.name!; - match(mod) +function registerModule(mod: DefinitelyDefined): Result { + const name = mod.name; + return match(mod) .with({ type: CommandType.Text }, mod => { - mod.alias.forEach(a => Files.TextCommands.aliases.set(a, mod)); + mod.alias?.forEach(a => Files.TextCommands.aliases.set(a, mod)); Files.TextCommands.text.set(name, mod); + return Ok.EMPTY; }) .with({ type: CommandType.Slash }, mod => { Files.ApplicationCommands[ApplicationCommandType.ChatInput].set(name, mod); + return Ok.EMPTY; }) .with({ type: CommandType.Both }, mod => { Files.BothCommands.set(name, mod); - mod.alias.forEach(a => Files.TextCommands.aliases.set(a, mod)); + mod.alias?.forEach(a => Files.TextCommands.aliases.set(a, mod)); + return Ok.EMPTY; }) .with({ type: CommandType.MenuUser }, mod => { Files.ApplicationCommands[ApplicationCommandType.User].set(name, mod); + return Ok.EMPTY; }) .with({ type: CommandType.MenuMsg }, mod => { Files.ApplicationCommands[ApplicationCommandType.Message].set(name, mod); + return Ok.EMPTY; }) .with({ type: CommandType.Button }, mod => { Files.ApplicationCommands[ComponentType.Button].set(name, mod); + return Ok.EMPTY; }) .with({ type: CommandType.MenuSelect }, mod => { Files.MessageCompCommands[ComponentType.SelectMenu].set(name, mod); - }); + return Ok.EMPTY; + }) + .with({ type: CommandType.Modal }, mod => { + Files.ModalSubmitCommands.set(name, mod); + return Ok.EMPTY; + }) + .otherwise(() => Err.EMPTY); } diff --git a/src/handler/plugins/plugin.ts b/src/handler/plugins/plugin.ts index c387b391..27a815ca 100644 --- a/src/handler/plugins/plugin.ts +++ b/src/handler/plugins/plugin.ts @@ -1,8 +1,8 @@ // // Plugins can be inserted on all commands and are emitted // -// 1.) on ready event, where all commands are loaded. -// 2.) on corresponding observable (command triggers) +// 1. on ready event, where all commands are loaded. +// 2. on corresponding observable (command triggers) // // The goal of plugins is to organize commands and // provide extensions to repetitive patterns @@ -13,54 +13,96 @@ import type { Awaitable, Client } from 'discord.js'; import type { Err, Ok, Result } from 'ts-results'; -import type { Module, Override, Wrapper } from '../..'; -import type { CommandType } from '../sern'; -import type { BaseModule, ModuleDefs } from '../structures/module'; - +import type { Module, Override } from '../..'; +import { CommandType } from '../..'; +import type { AutocompleteCommand, BaseModule, ModuleDefs } from '../structures/module'; +import { PluginType } from '../structures/enums'; export interface Controller { next: () => Ok; stop: () => Err; } -export enum PluginType { - Command = 0b01, - Event = 0b10, -} +type BasePlugin = Override< + BaseModule, + { + type: PluginType; + } +>; -type executeCmdPlugin = { execute: (wrapper: Wrapper, controller: Controller) => Result }; +export type CommandPlugin = { + [K in T]: Override< + BasePlugin, + { + type: PluginType.Command; + execute: ( + wrapper: Client, + module: ModuleDefs[T], + controller: Controller, + ) => Awaitable>; + } + >; +}[T]; +export type EventPlugin = { + [K in T]: Override< + BasePlugin, + { + type: PluginType.Event; + execute: ( + event: Parameters, + controller: Controller, + ) => Awaitable>; + } + >; +}[T]; -interface BasePlugin extends Override { - type: PluginType; -} +//Syntactic sugar on hold +// export function plugins( +// ...plug: (EventPlugin | CommandPlugin)[] +// ) { +// return plug; +// } -export type CommandPlugin = { - type: PluginType.Command; -} & Override Awaitable>; - }>; +type ModuleNoPlugins = { + [T in keyof ModuleDefs]: Omit; +}; -//TODO: rn adding the modType check a little hackish. Find better way to determine the -// module type of the event plugin -export type EventPlugin = { - type: PluginType.Event; - modType: T; -} & Override, controller: Controller) => Awaitable>; - }>; -export type EventPluginType = { - [K in CommandType] : EventPlugin +function isEventPlugin( + e: CommandPlugin | EventPlugin, +): e is EventPlugin { + return e.type === PluginType.Event; } - -export function plugins(...plug: CommandPlugin[]): CommandPlugin[]; -export function plugins(...plug: EventPlugin[]): EventPlugin[]; - -export function plugins(...plug: CommandPlugin[] | EventPlugin[]) { - return plug; +function isCommandPlugin( + e: CommandPlugin | EventPlugin, +): e is CommandPlugin { + return !isEventPlugin(e); +} +//TODO: I WANT BETTER TYPINGS AHHHHHHHHHHHHHHH +export function sernModule( + plugin: (CommandPlugin | EventPlugin)[], + mod: ModuleNoPlugins[T], +): Module { + const onEvent = plugin.filter(isEventPlugin); + const plugins = plugin.filter(isCommandPlugin); + if (mod.type === CommandType.Autocomplete) { + throw new Error( + 'You cannot use this function declaration for Autocomplete Interactions! use the raw object for options or' + + 'sernAutoComplete function', + ); + } else + return { + onEvent, + plugins, + ...mod, + } as Module; } -export function sernModule(mod: ModuleDefs[T]): Module { - return mod; +export function sernAutocomplete( + onEvent: EventPlugin[], + mod: Omit, +): Omit { + return { + onEvent, + ...mod, + }; } diff --git a/src/handler/sern.ts b/src/handler/sern.ts index c143fe81..dbe0af9c 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -1,57 +1,34 @@ -import type { DiscordEvent } from '../types/handler'; - -import { ApplicationCommandType, Client } from 'discord.js'; +import type { DiscordEvent, EventEmitterRegister } from '../types/handler'; import type Wrapper from './structures/wrapper'; import { fromEvent } from 'rxjs'; -import { SernError } from './structures/errors'; import { onReady } from './events/readyEvent'; import { onMessageCreate } from './events/messageEvent'; import { onInteractionCreate } from './events/interactionCreate'; -import { match, P } from 'ts-pattern'; import { Err, Ok } from 'ts-results'; +import { isDiscordEvent } from './utilities/predicates'; +import type { Client } from 'discord.js'; export function init(wrapper: Wrapper) { const { events, client } = wrapper; - if (events !== undefined) eventObserver(client, events); + if (events !== undefined) { + eventObserver(client, events); + } onReady(wrapper); onMessageCreate(wrapper); onInteractionCreate(wrapper); } -//TODO : Add event listener for any other generic node js event emitter -function eventObserver(client: Client, events: DiscordEvent[]) { - events.forEach(([event, cb]) => { - if (event === 'ready') throw Error(SernError.ReservedEvent); - fromEvent(client, event, cb).subscribe(); +function eventObserver(client: Client, events: (DiscordEvent | EventEmitterRegister)[]) { + events.forEach(event => { + if (isDiscordEvent(event)) { + fromEvent(client, event[0], event[1]).subscribe(); + } else { + fromEvent(event[0], event[1], event[2]).subscribe(); + } }); } -/** - * @enum { number }; - */ -export enum CommandType { - Text = 0b0000001, - Slash = 0b0000010, - MenuUser = 0b0000100, - MenuMsg = 0b0001000, - Button = 0b0010000, - MenuSelect = 0b0100000, - Both = 0b0000011, -} - -export function cmdTypeToDjs(ty: CommandType) { - return match(ty) - .with(CommandType.Slash, () => ApplicationCommandType.ChatInput) - .with(CommandType.MenuUser, () => ApplicationCommandType.User) - .with(CommandType.MenuMsg, () => ApplicationCommandType.Message) - .with(CommandType.Both, () => ApplicationCommandType.ChatInput) - .with(P._, () => { - throw new Error(SernError.NonValidModuleType); - }) - .exhaustive(); -} - export const controller = { next: () => Ok.EMPTY, stop: () => Err.EMPTY, diff --git a/src/handler/sernEmitter.ts b/src/handler/sernEmitter.ts new file mode 100644 index 00000000..a6282418 --- /dev/null +++ b/src/handler/sernEmitter.ts @@ -0,0 +1,48 @@ +import { EventEmitter } from 'events'; +import type { Module } from './structures/module'; + +type Payload = + | { success: true; module: Module } + | { success: false; module: Module | undefined; reason: string | Error }; + +type SernEventsMapping = { + ['module.register']: [Payload]; + ['module.activate']: [Payload]; + ['error']: [Error | string]; +}; + +export default class SernEmitter extends EventEmitter { + /** + * Listening to sern events with on. This event stays on until a crash or a normal exit + * @param eventName + * @param listener what to do with the data + */ + public override on( + eventName: T, + listener: (...args: SernEventsMapping[T][]) => void, + ): this { + return super.on(eventName, listener); + } + /** + * Listening to sern events with on. This event stays on until a crash or a normal exit + * @param eventName + * @param listener what to do with the data + */ + public override once( + eventName: T, + listener: (...args: SernEventsMapping[T][]) => void, + ): this { + return super.once(eventName, listener); + } + /** + * Listening to sern events with on. This event stays on until a crash or a normal exit + * @param eventName + * @param args the arguments for emitting the { eventName } + */ + public override emit( + eventName: T, + ...args: SernEventsMapping[T] + ): boolean { + return super.emit(eventName, ...args); + } +} diff --git a/src/handler/structures/context.ts b/src/handler/structures/context.ts index 3e6e0229..918c7941 100644 --- a/src/handler/structures/context.ts +++ b/src/handler/structures/context.ts @@ -1,7 +1,7 @@ import type { APIGuildMember } from 'discord-api-types/v9'; import type { - Awaitable, ChatInputCommandInteraction, + Client, Guild, GuildMember, InteractionReplyOptions, @@ -13,6 +13,7 @@ import type { } from 'discord.js'; import { None, Option, Some } from 'ts-results'; import type { Nullish } from '../../types/handler'; +import { ExternallyUsed } from '../utilities/externallyUsed'; function firstSome(...args: Option[]): Nullish { for (const op of args) { @@ -21,9 +22,11 @@ function firstSome(...args: Option[]): Nullish { return null; } -// -//Will need refactoring after applying context in practice -// +//Could I refactor with Either monad? +/** + * Provides values shared between + * Message and ChatInputCommandInteraction + */ export default class Context { private constructor( private oMsg: Option = None, @@ -33,25 +36,26 @@ export default class Context { this.oInterac = oInterac; } - static wrap(wrappable: ChatInputCommandInteraction | Message): Context { - if ('token' in wrappable) { - return new Context(None, Some(wrappable)); - } - return new Context(Some(wrappable), None); - } - - public isEmpty() { - return this.oMsg.none && this.oInterac.none; - } - + /** + * Getting the Message object. Crashes if module type is + * CommandType.Slash or the event fired in a Both command was + * ChatInputCommandInteraction + */ + @ExternallyUsed public get message() { return this.oMsg.unwrap(); } - + /** + * Getting the ChatInputCommandInteraction object. Crashes if module type is + * CommandType.Text or the event fired in a Both command was + * Message + */ + @ExternallyUsed public get interaction() { return this.oInterac.unwrap(); } + @ExternallyUsed public get id(): Snowflake { return firstSome( this.oInterac.map(i => i.id), @@ -59,6 +63,7 @@ export default class Context { )!; } + @ExternallyUsed public get channel(): Nullish { return firstSome( this.oMsg.map(m => m.channel), @@ -66,6 +71,7 @@ export default class Context { ); } + @ExternallyUsed public get user(): User { return firstSome( this.oMsg.map(m => m.author), @@ -73,6 +79,7 @@ export default class Context { )!; } + @ExternallyUsed public get createdTimestamp(): number { return firstSome( this.oMsg.map(m => m.createdTimestamp), @@ -80,6 +87,7 @@ export default class Context { )!; } + @ExternallyUsed public get guild(): Guild { return firstSome( this.oMsg.map(m => m.guild), @@ -87,6 +95,7 @@ export default class Context { )!; } + @ExternallyUsed public get guildId(): Snowflake { return firstSome( this.oMsg.map(m => m.guildId), @@ -97,6 +106,7 @@ export default class Context { /* * interactions can return APIGuildMember if the guild it is emitted from is not cached */ + @ExternallyUsed public get member(): Nullish { return firstSome( this.oMsg.map(m => m.member), @@ -104,44 +114,43 @@ export default class Context { ); } - /* - * Returns the underlying Context but allows for doing other operations - */ - public onInteraction(onInteraction: (interaction: ChatInputCommandInteraction) => Awaitable): Context { - if (this.oInterac.some) { - onInteraction(this.oInterac.val); - return Context.wrap(this.oInterac.val); - } - return this; + @ExternallyUsed + public get client(): Client { + return firstSome( + this.oMsg.map(m => m.client), + this.oInterac.map(i => i.client), + )!; } - public onMessage(onMessage: (message: Message) => Awaitable): Context { - if (this.oMsg.some) { - onMessage(this.oMsg.val); - return Context.wrap(this.oMsg.val); - } - return this; + @ExternallyUsed + public get inGuild(): boolean { + return firstSome( + this.oMsg.map(m => m.inGuild()), + this.oInterac.map(i => i.inGuild()), + )!; } - public takeInteractionValue(extract: (interaction: ChatInputCommandInteraction) => T): Nullish { - if (this.oInterac.none) return null; - return extract(this.oInterac.val); + static wrap(wrappable: ChatInputCommandInteraction | Message): Context { + if ('token' in wrappable) { + return new Context(None, Some(wrappable)); + } + return new Context(Some(wrappable), None); } - public takeMessageValue(extract: (message: Message) => T): Nullish { - if (this.oMsg.none) return null; - return extract(this.oMsg.val); + @ExternallyUsed + public isEmpty() { + return this.oMsg.none && this.oInterac.none; } - public reply(content: Omit | ReplyMessageOptions): Promise { + //TODO: make this queueable + @ExternallyUsed + public reply(content: Omit | ReplyMessageOptions) { return firstSome( - this.oInterac.map(async i => { - await i.reply(content as InteractionReplyOptions); - return new Context(Some((await i.fetchReply()) as Message), Some(i)); + this.oInterac.map(i => { + return i.reply(content as InteractionReplyOptions).then(() => i.fetchReply()); }), - this.oMsg.map(async m => { - const reply = await m.reply(content as ReplyMessageOptions); - return new Context(Some(reply), this.oInterac); + this.oMsg.map(m => { + return m.reply(content as ReplyMessageOptions); }), )!; } diff --git a/src/handler/structures/enums.ts b/src/handler/structures/enums.ts new file mode 100644 index 00000000..9aefe377 --- /dev/null +++ b/src/handler/structures/enums.ts @@ -0,0 +1,21 @@ +/** + * @enum { number }; + */ +enum CommandType { + Text = 0b00000001, + Slash = 0b00000010, + MenuUser = 0b00000100, + MenuMsg = 0b00001000, + Button = 0b00010000, + MenuSelect = 0b00100000, + Modal = 0b01000000, + Autocomplete = 0b10000000, + Both = 0b0000011, +} + +enum PluginType { + Command = 0b01, + Event = 0b10, +} + +export { CommandType, PluginType }; diff --git a/src/handler/structures/errors.ts b/src/handler/structures/errors.ts index 1eacdb1c..f95f2cf7 100644 --- a/src/handler/structures/errors.ts +++ b/src/handler/structures/errors.ts @@ -1,9 +1,7 @@ export enum SernError { - ReservedEvent = 'Cannot register the reserved ready event. Please use the init property.', - NoAlias = 'You cannot provide an array with elements to a slash command.', NonValidModuleType = 'Detected an unknown module type', UndefinedModule = `A module could not be detected at`, MismatchModule = `A module type mismatched with event emitted!`, - NotImplemented = 'This feature has not yet been implemented', NotSupportedInteraction = `This interaction is not supported.`, + PluginFailure = `A plugin failed to call controller.next()`, } diff --git a/src/handler/structures/module.ts b/src/handler/structures/module.ts index edcce537..555e21af 100644 --- a/src/handler/structures/module.ts +++ b/src/handler/structures/module.ts @@ -1,69 +1,129 @@ import type { + ApplicationCommandAttachmentOption, + ApplicationCommandChannelOptionData, + ApplicationCommandChoicesData, + ApplicationCommandNonOptionsData, + ApplicationCommandNumericOptionData, ApplicationCommandOptionData, + ApplicationCommandSubCommandData, + ApplicationCommandSubGroupData, Awaitable, + BaseApplicationCommandOptionsData, ButtonInteraction, MessageContextMenuCommandInteraction, + ModalSubmitInteraction, SelectMenuInteraction, UserContextMenuCommandInteraction, } from 'discord.js'; -import type { Override } from '../../types/handler'; -import type { Args } from '../../types/handler'; -import type { CommandType } from '../sern'; +import type { Args, Override } from '../../types/handler'; import type { CommandPlugin, EventPlugin } from '../plugins/plugin'; import type Context from './context'; +import { CommandType, PluginType } from './enums'; +import type { AutocompleteInteraction } from 'discord.js'; +import type { ApplicationCommandOptionType } from 'discord.js'; export interface BaseModule { + type: CommandType | PluginType; name?: string; description: string; execute: (ctx: Context, args: Args) => Awaitable; } //possible refactoring types into interfaces and not types -export type TextCommand = { - type: CommandType.Text; - onEvent: EventPlugin[]; - plugins: CommandPlugin[]; - alias: string[] | []; -} & BaseModule; - -export type SlashCommand = { - type: CommandType.Slash; - onEvent: EventPlugin[]; - plugins: CommandPlugin[]; - options: ApplicationCommandOptionData[] | []; -} & BaseModule; - -export type BothCommand = { - type: CommandType.Both; - onEvent: EventPlugin[] - plugins: CommandPlugin[] - alias: string[] | []; - options: ApplicationCommandOptionData[] | []; -} & BaseModule; - -export type ContextMenuUser = { - type: CommandType.MenuUser; - onEvent: EventPlugin[]; - plugins: CommandPlugin[]; -} & Override Awaitable }>; - -export type ContextMenuMsg = { - type: CommandType.MenuMsg; - onEvent: EventPlugin[]; - plugins: CommandPlugin[]; -} & Override Awaitable }>; - -export type ButtonCommand = { - type: CommandType.Button; - onEvent: EventPlugin[]; - plugins: CommandPlugin[]; -} & Override Awaitable }>; - -export type SelectMenuCommand = { - type: CommandType.MenuSelect; - onEvent: EventPlugin[]; - plugins: CommandPlugin[]; -} & Override Awaitable }>; +export type TextCommand = Override< + BaseModule, + { + type: CommandType.Text; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + alias?: string[]; + } +>; + +export type SlashCommand = Override< + BaseModule, + { + type: CommandType.Slash; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + options?: SernOptionsData[]; + } +>; + +export type BothCommand = Override< + BaseModule, + { + type: CommandType.Both; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + alias?: string[]; + options?: SernOptionsData[]; + } +>; + +export type ContextMenuUser = Override< + BaseModule, + { + type: CommandType.MenuUser; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + execute: (ctx: UserContextMenuCommandInteraction) => Awaitable; + } +>; + +export type ContextMenuMsg = Override< + BaseModule, + { + type: CommandType.MenuMsg; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + execute: (ctx: MessageContextMenuCommandInteraction) => Awaitable; + } +>; + +export type ButtonCommand = Override< + BaseModule, + { + type: CommandType.Button; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + execute: (ctx: ButtonInteraction) => Awaitable; + } +>; + +export type SelectMenuCommand = Override< + BaseModule, + { + type: CommandType.MenuSelect; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + execute: (ctx: SelectMenuInteraction) => Awaitable; + } +>; + +export type ModalSubmitCommand = Override< + BaseModule, + { + type: CommandType.Modal; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + execute: (ctx: ModalSubmitInteraction) => Awaitable; + } +>; + +// Autocomplete commands are a little different +// They can't have command plugins as they are +// in conjunction with chat input commands +// TODO: possibly in future, allow Autocmp commands in separate files? +export type AutocompleteCommand = Override< + BaseModule, + { + type: CommandType.Autocomplete; + name: string; + onEvent: EventPlugin[]; + execute: (ctx: AutocompleteInteraction) => Awaitable; + } +>; export type Module = | TextCommand @@ -72,7 +132,9 @@ export type Module = | ContextMenuUser | ContextMenuMsg | ButtonCommand - | SelectMenuCommand; + | SelectMenuCommand + | ModalSubmitCommand + | AutocompleteCommand; //https://stackoverflow.com/questions/64092736/alternative-to-switch-statement-for-typescript-discriminated-union // Explicit Module Definitions for mapping @@ -84,4 +146,56 @@ export type ModuleDefs = { [CommandType.MenuUser]: ContextMenuUser; [CommandType.Button]: ButtonCommand; [CommandType.MenuSelect]: SelectMenuCommand; -}; \ No newline at end of file + [CommandType.Modal]: ModalSubmitCommand; + [CommandType.Autocomplete]: AutocompleteCommand; +}; + +//TODO: support deeply nested Autocomplete +// objective: construct union of ApplicationCommandOptionData change any Autocomplete data +// into Sern autocomplete data. + +export type SernAutocompleteData = Override< + BaseApplicationCommandOptionsData, + { + autocomplete: true; + type: + | ApplicationCommandOptionType.String + | ApplicationCommandOptionType.Number + | ApplicationCommandOptionType.Integer; + command: Omit; + } +>; + +/** + * Type that just uses SernAutocompleteData and not regular autocomplete + */ +export type BaseOptions = + | ApplicationCommandChoicesData + | ApplicationCommandNonOptionsData + | ApplicationCommandChannelOptionData + | ApplicationCommandNumericOptionData + | ApplicationCommandAttachmentOption + | SernAutocompleteData; + +export type SernSubCommandData = Override< + Omit, + { + type: ApplicationCommandOptionType.Subcommand; + options?: BaseOptions[]; + } +>; + +export type SernSubCommandGroupData = Override< + Omit, + { + type: ApplicationCommandOptionType.SubcommandGroup; + options?: SernSubCommandData[]; + } +>; + +export type SernOptionsData = + U extends ApplicationCommandSubCommandData + ? SernSubCommandData + : U extends ApplicationCommandSubGroupData + ? SernSubCommandGroupData + : BaseOptions; diff --git a/src/handler/structures/structxports.ts b/src/handler/structures/structxports.ts index 5cc9686f..5396cadd 100644 --- a/src/handler/structures/structxports.ts +++ b/src/handler/structures/structxports.ts @@ -1,5 +1,28 @@ import Context from './context'; -import type { BothCommand, Module, SlashCommand, TextCommand } from './module'; +import type { + BothCommand, + Module, + SlashCommand, + TextCommand, + SernOptionsData, + BaseOptions, + SernAutocompleteData, + SernSubCommandData, + SernSubCommandGroupData, +} from './module'; import type Wrapper from './wrapper'; -export { Context, SlashCommand, TextCommand, BothCommand, Module, Wrapper }; +export * from './enums'; +export { + Context, + SlashCommand, + TextCommand, + BothCommand, + Module, + Wrapper, + SernOptionsData, + BaseOptions, + SernAutocompleteData, + SernSubCommandData, + SernSubCommandGroupData, +}; diff --git a/src/handler/structures/wrapper.ts b/src/handler/structures/wrapper.ts index 4bfc76c3..1e19058c 100644 --- a/src/handler/structures/wrapper.ts +++ b/src/handler/structures/wrapper.ts @@ -1,5 +1,6 @@ import type { Client } from 'discord.js'; -import type { DiscordEvent } from '../../types/handler'; +import type { DiscordEvent, EventEmitterRegister } from '../../types/handler'; +import type SernEmitter from '../sernEmitter'; /** * An object to be passed into Sern.Handler constructor. @@ -7,14 +8,14 @@ import type { DiscordEvent } from '../../types/handler'; * @property {readonly Client} client * @property {readonly string} defaultPrefix * @property {readonly string} commands - * @prop {(handler : Handler) => void)} init * @prop { readonly DiscordEvent[] } events */ interface Wrapper { readonly client: Client; + readonly sernEmitter?: SernEmitter; readonly defaultPrefix?: string; readonly commands: string; - readonly events?: DiscordEvent[]; + readonly events?: (DiscordEvent | EventEmitterRegister)[]; } export default Wrapper; diff --git a/src/handler/utilities/externallyUsed.ts b/src/handler/utilities/externallyUsed.ts new file mode 100644 index 00000000..0f0fe81a --- /dev/null +++ b/src/handler/utilities/externallyUsed.ts @@ -0,0 +1,18 @@ +/** + * This function denotes usage of decorated method is external + * Also, makes method appear 'used' in IDEs + * @param _target + * @param _propertyKey + * @param _descriptor + * @constructor + */ +export function ExternallyUsed( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _target: unknown, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _propertyKey: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _descriptor: PropertyDescriptor, +) { + return void 0; +} diff --git a/src/handler/utilities/markup.ts b/src/handler/utilities/markup.ts index 233bde24..6d0879b6 100644 --- a/src/handler/utilities/markup.ts +++ b/src/handler/utilities/markup.ts @@ -215,7 +215,7 @@ function toTimeString( if (unix === 0n) return '0 milliseconds'; const formatted: Map = new Map(); - const unitList: ObjectEntries = Object.entries(units) as any; + const unitList: ObjectEntries = Object.entries(units) as ObjectEntries; let run = unix; for (const [unit, value] of unitList) { @@ -270,6 +270,10 @@ class FormatInner { this.raw = raw; } + static wrap(raw: string, what: string) { + return `${what}${raw}${what}`; + } + toString() { return this.raw; } @@ -328,10 +332,6 @@ class FormatInner { const ret = this.static.wrap(escaped, Strings[key]); return new this.static(ret); } - - static wrap(raw: string, what: string) { - return `${what}${raw}${what}`; - } } /** diff --git a/src/handler/utilities/predicates.ts b/src/handler/utilities/predicates.ts index a868a7b0..20d12d3a 100644 --- a/src/handler/utilities/predicates.ts +++ b/src/handler/utilities/predicates.ts @@ -1,25 +1,54 @@ import type { Module, ModuleDefs } from '../structures/module'; -import type { ChatInputCommandInteraction, CommandInteraction } from 'discord.js'; -import type { EventPlugin } from '../../../dist'; -import { CommandType } from '../sern'; -import type { EventPluginType } from '../plugins/plugin'; -import type { ButtonInteraction, MessageComponentInteraction, SelectMenuInteraction } from 'discord.js'; - +import type { + Awaitable, + ButtonInteraction, + ChatInputCommandInteraction, + CommandInteraction, + MessageComponentInteraction, + MessageContextMenuCommandInteraction, + SelectMenuInteraction, + UserContextMenuCommandInteraction, +} from 'discord.js'; +import type { DiscordEvent, EventEmitterRegister } from '../..'; export function correctModuleType( plug: Module | undefined, type: T, ): plug is ModuleDefs[T] { - return plug !== undefined && plug.type === type; + // Another way to check if type is equivalent, + // It will check based on flag system instead + return plug !== undefined && (plug.type & type) !== 0; } export function isChatInputCommand(i: CommandInteraction): i is ChatInputCommandInteraction { return i.isChatInputCommand(); } -export function isButton(i : MessageComponentInteraction) : i is ButtonInteraction { +export function isButton(i: MessageComponentInteraction): i is ButtonInteraction { return i.isButton(); } -export function isSelectMenu(i : MessageComponentInteraction) : i is SelectMenuInteraction { + +export function isSelectMenu(i: MessageComponentInteraction): i is SelectMenuInteraction { return i.isSelectMenu(); -} \ No newline at end of file +} + +export function isMessageCtxMenuCmd( + i: CommandInteraction, +): i is MessageContextMenuCommandInteraction { + return i.isMessageContextMenuCommand(); +} + +export function isUserContextMenuCmd( + i: CommandInteraction, +): i is UserContextMenuCommandInteraction { + return i.isUserContextMenuCommand(); +} + +export function isPromise(promiseLike: Awaitable): promiseLike is Promise { + const keys = new Set(Object.keys(promiseLike)); + return keys.has('then') && keys.has('catch'); +} + +export function isDiscordEvent(el: DiscordEvent | EventEmitterRegister): el is DiscordEvent { + return el.length === 2; +} diff --git a/src/handler/utilities/readFile.ts b/src/handler/utilities/readFile.ts index 60b92ea0..47dbdffb 100644 --- a/src/handler/utilities/readFile.ts +++ b/src/handler/utilities/readFile.ts @@ -4,6 +4,7 @@ import { join } from 'path'; import { from, Observable } from 'rxjs'; import type { Module } from '../structures/module'; +//Maybe move this? this probably doesnt belong in utlities/ export const BothCommands = new Map(); export const ApplicationCommands = { [ApplicationCommandType.User]: new Map(), @@ -20,7 +21,7 @@ export const TextCommands = { text: new Map(), aliases: new Map(), }; - +export const ModalSubmitCommands = new Map(); // Courtesy @Townsy45 function readPath(dir: string, arrayOfFiles: string[] = []): string[] { try { @@ -51,7 +52,7 @@ export function buildData(commandDir: string): Observable<{ return from( getCommands(commandDir).map(absPath => { // eslint-disable-next-line @typescript-eslint/no-var-requires - const mod = require(absPath).module; + const mod = require(absPath).default; return { mod, absPath }; }), ); diff --git a/src/index.ts b/src/index.ts index 1948fb52..5fd8db22 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,13 @@ +/* + * --------------------------------------------------------------------- + * Copyright (C) 2022 Sern + * This software is licensed under the MIT License. + * See LICENSE.md in the project root for license information. + * --------------------------------------------------------------------- + */ + + export * as Sern from './handler/sern'; export * from './types/handler'; export * from './handler/structures/structxports'; -export * from './handler/plugins/plugin'; \ No newline at end of file +export * from './handler/plugins/plugin'; diff --git a/src/types/handler.ts b/src/types/handler.ts index bf94fbe0..7791c380 100644 --- a/src/types/handler.ts +++ b/src/types/handler.ts @@ -1,32 +1,38 @@ -import type { - Awaitable, - ClientEvents, - CommandInteractionOptionResolver, - MessageOptions, - MessagePayload, -} from 'discord.js'; - -// Anything that can be sent in a `#send` or `#reply` -export type possibleOutput = T | (MessagePayload & MessageOptions); +import type { Awaitable, ClientEvents, CommandInteractionOptionResolver } from 'discord.js'; +import type { EventEmitter } from 'events'; export type Nullish = T | undefined | null; -// Thanks @cursorsdottsx + +// Thanks to @kelsny export type ParseType = { [K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never; }[keyof T]; export type Args = ParseType<{ text: string[]; slash: SlashOptions }>; -export type DiscordEvent = ParseType<{ [K in keyof ClientEvents]: (...args: ClientEvents[K]) => Awaitable }>; +export type DiscordEvent = ParseType<{ + [K in keyof ClientEvents]: (...args: ClientEvents[K]) => Awaitable; +}>; +export type EventEmitterRegister = [ + emitter: EventEmitter, + k: string, + cb: (...args: unknown[]) => Awaitable, +]; export type SlashOptions = Omit; -//https://dev.to/vborodulin/ts-how-to-override-properties-with-type-intersection-554l +// Source: https://dev.to/vborodulin/ts-how-to-override-properties-with-type-intersection-554l export type Override = Omit & T2; -export type UnionToTuple = T extends readonly [infer V, infer S] - ? V extends V - ? S extends S - ? [V, S] - : [V] - : never - : never; \ No newline at end of file +export type DefinitelyDefined = T & Override; + +type Reconstruct = T extends Omit ? O & Reconstruct : T; + +type IsOptional = { + [K in keyof T]-?: T[K] extends Required[K] ? false : true; +}; + +export type UnionToIntersection = (T extends unknown ? (x: T) => unknown : never) extends ( + x: infer R, +) => unknown + ? R + : never; diff --git a/tests/functions.test.ts b/tests/functions.test.ts index e142bd28..cb57fe21 100644 --- a/tests/functions.test.ts +++ b/tests/functions.test.ts @@ -1,4 +1,5 @@ -import { hasPrefix, fmt, isNotFromBot } from '../src/handler/utilities/messageHelpers'; +import { fmt, hasPrefix, isNotFromBot } from '../src/handler/utilities/messageHelpers'; + describe('FUNCTIONS', () => { test('If hasPrefix is a function', () => { expect(typeof hasPrefix).toBe('function'); @@ -9,5 +10,4 @@ describe('FUNCTIONS', () => { test('if isBot is a function', () => { expect(typeof isNotFromBot).toBe('function'); }); - });