mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: types
This commit is contained in:
parent
ee135a2667
commit
f288292208
13
biome.json
13
biome.json
@ -8,7 +8,15 @@
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": true,
|
||||
"ignore": ["node_modules/", "build", "lib", "__test__", "package.json", "tsconfig.json", ".vscode"]
|
||||
"ignore": [
|
||||
"node_modules/",
|
||||
"build",
|
||||
"lib",
|
||||
"__test__",
|
||||
"package.json",
|
||||
"tsconfig.json",
|
||||
".vscode"
|
||||
]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
@ -62,7 +70,8 @@
|
||||
"complexity": {
|
||||
"noForEach": "off",
|
||||
"noExcessiveCognitiveComplexity": "off",
|
||||
"noUselessConstructor": "off"
|
||||
"noUselessConstructor": "off",
|
||||
"noBannedTypes": "off"
|
||||
},
|
||||
"performance": {
|
||||
"noBarrelFile": "off",
|
||||
|
@ -149,7 +149,7 @@ export class BaseCommand {
|
||||
|
||||
/** @internal */
|
||||
async __runOptions(
|
||||
ctx: CommandContext<never, never>,
|
||||
ctx: CommandContext<{}, never>,
|
||||
resolver: OptionResolverStructure,
|
||||
): Promise<[boolean, OnOptionsReturnObject]> {
|
||||
if (!this?.options?.length) {
|
||||
@ -202,12 +202,7 @@ export class BaseCommand {
|
||||
|
||||
/** @internal */
|
||||
static __runMiddlewares(
|
||||
context:
|
||||
| CommandContext<never, never>
|
||||
| ComponentContext
|
||||
| MenuCommandContext<any>
|
||||
| ModalContext
|
||||
| EntryPointContext,
|
||||
context: CommandContext<{}, never> | ComponentContext | MenuCommandContext<any> | ModalContext | EntryPointContext,
|
||||
middlewares: (keyof RegisteredMiddlewares)[],
|
||||
global: boolean,
|
||||
): Promise<{ error?: string; pass?: boolean }> {
|
||||
@ -250,12 +245,12 @@ export class BaseCommand {
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
__runMiddlewares(context: CommandContext<never, never>) {
|
||||
__runMiddlewares(context: CommandContext<{}, never>) {
|
||||
return BaseCommand.__runMiddlewares(context, this.middlewares as (keyof RegisteredMiddlewares)[], false);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
__runGlobalMiddlewares(context: CommandContext<never, never>) {
|
||||
__runGlobalMiddlewares(context: CommandContext<{}, never>) {
|
||||
return BaseCommand.__runMiddlewares(
|
||||
context,
|
||||
(context.client.options?.globalMiddlewares ?? []) as (keyof RegisteredMiddlewares)[],
|
||||
|
@ -531,7 +531,7 @@ export class HandleCommand {
|
||||
|
||||
async runGlobalMiddlewares(
|
||||
command: Command | ContextMenuCommand | SubCommand | EntryPointCommand,
|
||||
context: CommandContext<never, never> | MenuCommandContext<any> | EntryPointContext,
|
||||
context: CommandContext<{}, never> | MenuCommandContext<any> | EntryPointContext,
|
||||
) {
|
||||
try {
|
||||
const resultRunGlobalMiddlewares = await BaseCommand.__runMiddlewares(
|
||||
@ -559,7 +559,7 @@ export class HandleCommand {
|
||||
|
||||
async runMiddlewares(
|
||||
command: Command | ContextMenuCommand | SubCommand | EntryPointCommand,
|
||||
context: CommandContext<never, never> | MenuCommandContext<any> | EntryPointContext,
|
||||
context: CommandContext<{}, never> | MenuCommandContext<any> | EntryPointContext,
|
||||
) {
|
||||
try {
|
||||
const resultRunMiddlewares = await BaseCommand.__runMiddlewares(
|
||||
|
@ -211,7 +211,6 @@ export type Clean<T> = DropT<T, never>;
|
||||
|
||||
export type PartialAvoid<U, T> = Identify<KeepT<T, U> & Partial<T>>;
|
||||
|
||||
//biome-ignore lint/complexity/noBannedTypes:
|
||||
export type PartialClass<T> = PartialAvoid<Function, T>;
|
||||
|
||||
export type AtLeastOne<
|
||||
|
Loading…
x
Reference in New Issue
Block a user