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": {
|
"files": {
|
||||||
"ignoreUnknown": true,
|
"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": {
|
"formatter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
@ -62,7 +70,8 @@
|
|||||||
"complexity": {
|
"complexity": {
|
||||||
"noForEach": "off",
|
"noForEach": "off",
|
||||||
"noExcessiveCognitiveComplexity": "off",
|
"noExcessiveCognitiveComplexity": "off",
|
||||||
"noUselessConstructor": "off"
|
"noUselessConstructor": "off",
|
||||||
|
"noBannedTypes": "off"
|
||||||
},
|
},
|
||||||
"performance": {
|
"performance": {
|
||||||
"noBarrelFile": "off",
|
"noBarrelFile": "off",
|
||||||
|
@ -149,7 +149,7 @@ export class BaseCommand {
|
|||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
async __runOptions(
|
async __runOptions(
|
||||||
ctx: CommandContext<never, never>,
|
ctx: CommandContext<{}, never>,
|
||||||
resolver: OptionResolverStructure,
|
resolver: OptionResolverStructure,
|
||||||
): Promise<[boolean, OnOptionsReturnObject]> {
|
): Promise<[boolean, OnOptionsReturnObject]> {
|
||||||
if (!this?.options?.length) {
|
if (!this?.options?.length) {
|
||||||
@ -202,12 +202,7 @@ export class BaseCommand {
|
|||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
static __runMiddlewares(
|
static __runMiddlewares(
|
||||||
context:
|
context: CommandContext<{}, never> | ComponentContext | MenuCommandContext<any> | ModalContext | EntryPointContext,
|
||||||
| CommandContext<never, never>
|
|
||||||
| ComponentContext
|
|
||||||
| MenuCommandContext<any>
|
|
||||||
| ModalContext
|
|
||||||
| EntryPointContext,
|
|
||||||
middlewares: (keyof RegisteredMiddlewares)[],
|
middlewares: (keyof RegisteredMiddlewares)[],
|
||||||
global: boolean,
|
global: boolean,
|
||||||
): Promise<{ error?: string; pass?: boolean }> {
|
): Promise<{ error?: string; pass?: boolean }> {
|
||||||
@ -250,12 +245,12 @@ export class BaseCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
__runMiddlewares(context: CommandContext<never, never>) {
|
__runMiddlewares(context: CommandContext<{}, never>) {
|
||||||
return BaseCommand.__runMiddlewares(context, this.middlewares as (keyof RegisteredMiddlewares)[], false);
|
return BaseCommand.__runMiddlewares(context, this.middlewares as (keyof RegisteredMiddlewares)[], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
__runGlobalMiddlewares(context: CommandContext<never, never>) {
|
__runGlobalMiddlewares(context: CommandContext<{}, never>) {
|
||||||
return BaseCommand.__runMiddlewares(
|
return BaseCommand.__runMiddlewares(
|
||||||
context,
|
context,
|
||||||
(context.client.options?.globalMiddlewares ?? []) as (keyof RegisteredMiddlewares)[],
|
(context.client.options?.globalMiddlewares ?? []) as (keyof RegisteredMiddlewares)[],
|
||||||
|
@ -531,7 +531,7 @@ export class HandleCommand {
|
|||||||
|
|
||||||
async runGlobalMiddlewares(
|
async runGlobalMiddlewares(
|
||||||
command: Command | ContextMenuCommand | SubCommand | EntryPointCommand,
|
command: Command | ContextMenuCommand | SubCommand | EntryPointCommand,
|
||||||
context: CommandContext<never, never> | MenuCommandContext<any> | EntryPointContext,
|
context: CommandContext<{}, never> | MenuCommandContext<any> | EntryPointContext,
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
const resultRunGlobalMiddlewares = await BaseCommand.__runMiddlewares(
|
const resultRunGlobalMiddlewares = await BaseCommand.__runMiddlewares(
|
||||||
@ -559,7 +559,7 @@ export class HandleCommand {
|
|||||||
|
|
||||||
async runMiddlewares(
|
async runMiddlewares(
|
||||||
command: Command | ContextMenuCommand | SubCommand | EntryPointCommand,
|
command: Command | ContextMenuCommand | SubCommand | EntryPointCommand,
|
||||||
context: CommandContext<never, never> | MenuCommandContext<any> | EntryPointContext,
|
context: CommandContext<{}, never> | MenuCommandContext<any> | EntryPointContext,
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
const resultRunMiddlewares = await BaseCommand.__runMiddlewares(
|
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>>;
|
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 PartialClass<T> = PartialAvoid<Function, T>;
|
||||||
|
|
||||||
export type AtLeastOne<
|
export type AtLeastOne<
|
||||||
|
Loading…
x
Reference in New Issue
Block a user