@sapphire/framework
Advanced tools
Comparing version 2.0.0-next.7cb9e3da.0 to 2.0.0-next.857eaba3.0
@@ -1,2 +0,2 @@ | ||
/* Version: 2.0.0-next.7cb9e3da.0 - June 7, 2021 10:03:47 */ | ||
/* Version: 2.0.0-next.857eaba3.0 - June 12, 2021 08:55:33 */ | ||
'use strict'; | ||
@@ -47,2 +47,2 @@ | ||
tslib_1.__exportStar(require("./lib/utils/preconditions/PreconditionContainerSingle"), exports); | ||
exports.version = '2.0.0-next.7cb9e3da.0'; | ||
exports.version = '2.0.0-next.857eaba3.0'; |
@@ -11,3 +11,3 @@ "use strict"; | ||
/** | ||
* The argument parser to be used in [[Command]]. | ||
* The argument parser to be used in {@link Command}. | ||
*/ | ||
@@ -149,9 +149,9 @@ class Args { | ||
* console.log(args.getFlags('f')); | ||
* >>> true | ||
* // >>> true | ||
* | ||
* console.log(args.getFlags('g', 'h')); | ||
* >>> true | ||
* // >>> true | ||
* | ||
* console.log(args.getFlags('h')); | ||
* >>> false | ||
* // >>> false | ||
* ``` | ||
@@ -169,9 +169,9 @@ */ | ||
* console.log(args.getOption('a')); | ||
* >>> '1' | ||
* // >>> '1' | ||
* | ||
* console.log(args.getOption('b', 'c')); | ||
* >>> '2' | ||
* // >>> '2' | ||
* | ||
* console.log(args.getOption('d')); | ||
* >>> null | ||
* // >>> null | ||
* ``` | ||
@@ -189,9 +189,9 @@ */ | ||
* console.log(args.getOptions('a')); | ||
* >>> ['1', '1'] | ||
* // >>> ['1', '1'] | ||
* | ||
* console.log(args.getOptions('b', 'c')); | ||
* >>> ['2', '3'] | ||
* // >>> ['2', '3'] | ||
* | ||
* console.log(args.getOptions('d')); | ||
* >>> null | ||
* // >>> null | ||
* ``` | ||
@@ -242,3 +242,3 @@ */ | ||
* Resolves an argument. | ||
* @param arg The argument name or [[IArgument]] instance. | ||
* @param arg The argument name or {@link IArgument} instance. | ||
*/ | ||
@@ -252,3 +252,3 @@ resolveArgument(arg) { | ||
* Converts a callback into an usable argument. | ||
* @param cb The callback to convert into an [[IArgument]]. | ||
* @param cb The callback to convert into an {@link IArgument}. | ||
*/ | ||
@@ -259,3 +259,3 @@ static make(cb, name = '') { | ||
/** | ||
* Constructs an [[Ok]] result. | ||
* Constructs an {@link Ok} result. | ||
* @param value The value to pass. | ||
@@ -267,3 +267,3 @@ */ | ||
/** | ||
* Constructs an [[Err]] result containing an [[ArgumentError]]. | ||
* Constructs an {@link Err} result containing an {@link ArgumentError}. | ||
* @param options The options for the argument error. | ||
@@ -270,0 +270,0 @@ */ |
@@ -18,8 +18,8 @@ "use strict"; | ||
/** | ||
* The base [[Client]] extension that makes Sapphire work. When building a Discord bot with the framework, the developer | ||
* The base {@link Client} extension that makes Sapphire work. When building a Discord bot with the framework, the developer | ||
* must either use this class, or extend it. | ||
* | ||
* Sapphire also automatically detects the folders to scan for pieces, please read | ||
* [[SapphireClient.registerUserDirectories]] for reference. This method is called at the start of the | ||
* [[SapphireClient.login]] method. | ||
* {@link SapphireClient.registerUserDirectories} for reference. This method is called at the start of the | ||
* {@link SapphireClient.login} method. | ||
* | ||
@@ -26,0 +26,0 @@ * @see {@link SapphireClientOptions} for all options available to the Sapphire Client. You can also provide all of discord.js' [ClientOptions](https://discord.js.org/#/docs/main/stable/typedef/ClientOptions) |
@@ -8,3 +8,3 @@ "use strict"; | ||
* The base argument class. This class is abstract and is to be extended by subclasses implementing the methods. In | ||
* Sapphire's workflow, arguments are called when using [[Args]]'s methods (usually used inside [[Command]]s by default). | ||
* Sapphire's workflow, arguments are called when using {@link Args}'s methods (usually used inside {@link Command}s by default). | ||
* | ||
@@ -14,3 +14,3 @@ * @example | ||
* // TypeScript: | ||
* import { Argument, ArgumentResult, PieceContext } from '(at)sapphire/framework'; | ||
* import { Argument, ArgumentResult, PieceContext } from '@sapphire/framework'; | ||
* import { URL } from 'url'; | ||
@@ -36,3 +36,3 @@ * | ||
* // and others have a return type of `URL`. | ||
* declare module 'sapphire/framework/dist/lib/utils/Args' { | ||
* declare module '@sapphire/framework/dist/lib/utils/Args' { | ||
* export interface ArgType { | ||
@@ -47,3 +47,3 @@ * url: URL; | ||
* // JavaScript: | ||
* const { Argument } = require('(at)sapphire/framework'); | ||
* const { Argument } = require('@sapphire/framework'); | ||
* | ||
@@ -75,3 +75,3 @@ * // Define a class extending `Argument`, then export it. | ||
/** | ||
* Constructs an [[ArgumentError]] with a custom type. | ||
* Constructs an {@link ArgumentError} with a custom type. | ||
* @param parameter The parameter that triggered the argument. | ||
@@ -78,0 +78,0 @@ * @param type The identifier for the error. |
@@ -15,3 +15,3 @@ "use strict"; | ||
* // TypeScript: | ||
* import { Event, Events, PieceContext } from '(at)sapphire/framework'; | ||
* import { Event, Events, PieceContext } from '@sapphire/framework'; | ||
* | ||
@@ -26,3 +26,3 @@ * // Define a class extending `CoreEvent`, then export it. | ||
* public run() { | ||
* if (!this.client.id) this.client.id = this.client.user?.id ?? null; | ||
* if (!this.container.client.id) this.container.client.id = this.container.client.user?.id ?? null; | ||
* } | ||
@@ -35,3 +35,3 @@ * } | ||
* // JavaScript: | ||
* const { Event, Events } = require('(at)sapphire/framework'); | ||
* const { Event, Events } = require('@sapphire/framework'); | ||
* | ||
@@ -45,3 +45,3 @@ * // Define a class extending `CoreEvent`, then export it. | ||
* run() { | ||
* if (!this.client.id) this.client.id = this.client.user?.id ?? null; | ||
* if (!this.container.client.id) this.container.client.id = this.container.client.user?.id ?? null; | ||
* } | ||
@@ -48,0 +48,0 @@ * } |
@@ -8,4 +8,4 @@ "use strict"; | ||
* The extended argument class. This class is abstract and is to be extended by subclasses which | ||
* will implement the [[ExtendedArgument#handle]] method. | ||
* Much like the [[Argument]] class, this class handles parsing user-specified command arguments | ||
* will implement the {@link ExtendedArgument#handle} method. | ||
* Much like the {@link Argument} class, this class handles parsing user-specified command arguments | ||
* into typed command parameters. However, this class can be used to expand upon an existing | ||
@@ -18,7 +18,7 @@ * argument in order to process its transformed value rather than just the argument string. | ||
* import { ApplyOptions } from '@sapphire/decorators'; | ||
* import { ArgumentResult, ExtendedArgument, ExtendedArgumentContext, ExtendedArgumentOptions } from '(at)sapphire/framework'; | ||
* import { ArgumentResult, ExtendedArgument, ExtendedArgumentContext, ExtendedArgumentOptions } from '@sapphire/framework'; | ||
* import type { Channel, TextChannel } from 'discord.js'; | ||
* | ||
* // Just like with `Argument`, you can use `export default` or `export =` too. | ||
* @ApplyOptions<ExtendedArgumentOptions>({ | ||
* (at)ApplyOptions<ExtendedArgumentOptions>({ | ||
* name: 'textChannel', | ||
@@ -31,3 +31,3 @@ * baseArgument: 'channel' | ||
* ? this.ok(parsed as TextChannel) | ||
* : this.error(argument, 'ArgumentTextChannelInvalidTextChannel', 'The argument did not resolve to a text channel.'); | ||
* : this.error({ identifier: 'ArgumentTextChannelInvalidTextChannel', message: 'The argument did not resolve to a text channel.' }); | ||
* } | ||
@@ -40,3 +40,3 @@ * } | ||
* // JavaScript: | ||
* const { ExtendedArgument } = require('(at)sapphire/framework'); | ||
* const { ExtendedArgument } = require('@sapphire/framework'); | ||
* | ||
@@ -51,3 +51,3 @@ * module.exports = class TextChannelArgument extends ExtendedArgument { | ||
* ? this.ok(parsed) | ||
* : this.error(argument, 'ArgumentTextChannelInvalidTextChannel', 'The argument did not resolve to a text channel/'); | ||
* : this.error({ identifier: 'ArgumentTextChannelInvalidTextChannel', message: 'The argument did not resolve to a text channel' }); | ||
* } | ||
@@ -54,0 +54,0 @@ * } |
@@ -17,3 +17,3 @@ "use strict"; | ||
/** | ||
* Constructs a [[PreconditionError]] with the precondition parameter set to `this`. | ||
* Constructs a {@link PreconditionError} with the precondition parameter set to `this`. | ||
* @param options The information. | ||
@@ -20,0 +20,0 @@ */ |
@@ -9,3 +9,3 @@ "use strict"; | ||
/** | ||
* A strict-typed store registry. This is available in both [[Client.stores]] and [[Store.injectedContext]]. | ||
* A strict-typed store registry. This is available in both {@link Client.stores} and {@link Store.injectedContext}. | ||
* @since 1.0.0 | ||
@@ -22,3 +22,3 @@ * @example | ||
* // file somewhere: | ||
* declare module '(at)sapphire/framework' { | ||
* declare module '@sapphire/framework' { | ||
* export interface StoreRegistryEntries { | ||
@@ -25,0 +25,0 @@ * routes: RouteStore; |
@@ -5,3 +5,3 @@ "use strict"; | ||
/** | ||
* The logger levels for the [[ILogger]]. | ||
* The logger levels for the {@link ILogger}. | ||
*/ | ||
@@ -11,23 +11,23 @@ var LogLevel; | ||
/** | ||
* The lowest log level, used when calling [[ILogger.trace]]. | ||
* The lowest log level, used when calling {@link ILogger.trace}. | ||
*/ | ||
LogLevel[LogLevel["Trace"] = 10] = "Trace"; | ||
/** | ||
* The debug level, used when calling [[ILogger.debug]]. | ||
* The debug level, used when calling {@link ILogger.debug}. | ||
*/ | ||
LogLevel[LogLevel["Debug"] = 20] = "Debug"; | ||
/** | ||
* The info level, used when calling [[ILogger.info]]. | ||
* The info level, used when calling {@link ILogger.info}. | ||
*/ | ||
LogLevel[LogLevel["Info"] = 30] = "Info"; | ||
/** | ||
* The warning level, used when calling [[ILogger.warn]]. | ||
* The warning level, used when calling {@link ILogger.warn}. | ||
*/ | ||
LogLevel[LogLevel["Warn"] = 40] = "Warn"; | ||
/** | ||
* The error level, used when calling [[ILogger.error]]. | ||
* The error level, used when calling {@link ILogger.error}. | ||
*/ | ||
LogLevel[LogLevel["Error"] = 50] = "Error"; | ||
/** | ||
* The critical level, used when calling [[ILogger.fatal]]. | ||
* The critical level, used when calling {@link ILogger.fatal}. | ||
*/ | ||
@@ -34,0 +34,0 @@ LogLevel[LogLevel["Fatal"] = 60] = "Fatal"; |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* An [[IPreconditionCondition]] which runs all containers similarly to doing (V0 && V1 [&& V2 [&& V3 ...]]). | ||
* An {@link IPreconditionCondition} which runs all containers similarly to doing (V0 && V1 [&& V2 [&& V3 ...]]). | ||
* @since 1.0.0 | ||
@@ -9,0 +9,0 @@ */ |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* An [[IPreconditionCondition]] which runs all containers similarly to doing (V0 || V1 [|| V2 [|| V3 ...]]). | ||
* An {@link IPreconditionCondition} which runs all containers similarly to doing (V0 || V1 [|| V2 [|| V3 ...]]). | ||
* @since 1.0.0 | ||
@@ -9,0 +9,0 @@ */ |
@@ -9,3 +9,3 @@ "use strict"; | ||
/** | ||
* The run mode for a [[PreconditionContainerArray]]. | ||
* The run mode for a {@link PreconditionContainerArray}. | ||
* @since 1.0.0 | ||
@@ -29,3 +29,3 @@ */ | ||
/** | ||
* The condition for a [[PreconditionContainerArray]]. | ||
* The condition for a {@link PreconditionContainerArray}. | ||
*/ | ||
@@ -35,3 +35,3 @@ var PreconditionRunCondition; | ||
/** | ||
* Defines a condition where all the entries must pass. This uses [[PreconditionConditionAnd]]. | ||
* Defines a condition where all the entries must pass. This uses {@link PreconditionConditionAnd}. | ||
* @since 1.0.0 | ||
@@ -41,3 +41,3 @@ */ | ||
/** | ||
* Defines a condition where at least one entry must pass. This uses [[PreconditionConditionOr]]. | ||
* Defines a condition where at least one entry must pass. This uses {@link PreconditionConditionOr}. | ||
* @since 1.0.0 | ||
@@ -51,5 +51,5 @@ */ | ||
/** | ||
* An [[IPreconditionContainer]] that defines an array of multiple [[IPreconditionContainer]]s. | ||
* An {@link IPreconditionContainer} that defines an array of multiple {@link IPreconditionContainer}s. | ||
* | ||
* By default, array containers run either of two conditions: AND and OR ([[PreconditionRunCondition]]), the top level | ||
* By default, array containers run either of two conditions: AND and OR ({@link PreconditionRunCondition}), the top level | ||
* will always default to AND, where the nested one flips the logic (OR, then children arrays are AND, then OR...). | ||
@@ -66,4 +66,4 @@ * | ||
* ``` | ||
* @remark More advanced logic can be accomplished by adding more [[IPreconditionCondition]]s (e.g. other operators), | ||
* see [[PreconditionContainerArray.conditions]] for more information. | ||
* @remark More advanced logic can be accomplished by adding more {@link IPreconditionCondition}s (e.g. other operators), | ||
* see {@link PreconditionContainerArray.conditions} for more information. | ||
* @since 1.0.0 | ||
@@ -121,3 +121,3 @@ */ | ||
/** | ||
* Retrieves a condition from [[PreconditionContainerArray.conditions]], assuming existence. | ||
* Retrieves a condition from {@link PreconditionContainerArray.conditions}, assuming existence. | ||
* @since 1.0.0 | ||
@@ -131,4 +131,4 @@ */ | ||
/** | ||
* The preconditions to be run. Extra ones can be added by augmenting [[PreconditionRunCondition]] and then | ||
* inserting [[IPreconditionCondition]]s. | ||
* The preconditions to be run. Extra ones can be added by augmenting {@link PreconditionRunCondition} and then | ||
* inserting {@link IPreconditionCondition}s. | ||
* @since 1.0.0 | ||
@@ -145,3 +145,3 @@ * @example | ||
* // file somewhere: | ||
* declare module '(at)sapphire/framework' { | ||
* declare module '@sapphire/framework' { | ||
* export enum PreconditionRunCondition { | ||
@@ -148,0 +148,0 @@ * Random = 2 |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* An [[IPreconditionContainer]] which runs a single precondition from [[SapphireClient.preconditions]]. | ||
* An {@link IPreconditionContainer} which runs a single precondition from {@link SapphireClient.preconditions}. | ||
* @since 1.0.0 | ||
@@ -9,0 +9,0 @@ */ |
{ | ||
"name": "@sapphire/framework", | ||
"version": "2.0.0-next.7cb9e3da.0", | ||
"version": "2.0.0-next.857eaba3.0", | ||
"description": "Discord bot framework built on top of @sapphire/lib for advanced and amazing bots.", | ||
@@ -119,5 +119,6 @@ "main": "dist/index.js", | ||
"merge": "^2.1.1", | ||
"trim": "^1.0.1" | ||
"trim": "^1.0.1", | ||
"trim-newlines": "^3.0.1" | ||
}, | ||
"prettier": "@sapphire/prettier-config" | ||
} |
Sorry, the diff of this file is too big to display
274457