import type { GatewayIntentBits, PermissionFlagsBits } from '../../types'; export type ToClass = new (...args: any[]) => { [K in keyof T]: T[K] extends (...args: any[]) => any ? ReturnType extends Promise ? (...args: Parameters) => Promise : ReturnType extends T ? (...args: Parameters) => This : T[K] : T[K]; }; export type StringToNumber = T extends `${infer N extends number}` ? N : never; export type PickPartial = Omit & { [P in K]?: T[P]; }; export type MakeDeepPartial = Omit & { [P in K]?: DeepPartial; }; export type DeepPartial = { [K in keyof T]?: T[K] extends (...args: any[]) => any ? T[K] : T[K] extends Record ? DeepPartial : T[K] extends (infer I)[] ? DeepPartial[] : Partial; }; export type OmitInsert = I extends [] ? Omit & I[number] : Omit & I; export type RequireAtLeastOne = T & { [K in Keys]: Required>; }[Keys]; export type IntentStrings = (keyof typeof GatewayIntentBits)[]; export type PermissionStrings = (keyof typeof PermissionFlagsBits | (typeof PermissionFlagsBits)[keyof typeof PermissionFlagsBits] | bigint)[]; export type RestOrArray = T[] | [T[]]; export interface StructWhen { cached: Prop | undefined; api: State extends 'api' ? Prop : undefined; create: State extends 'create' ? Prop : undefined; } export type StructStates = keyof StructWhen; export type StructPropState = StructWhen[State]; export type PropWhen