diff --git a/packages/helpers/types.test.types.ts b/packages/helpers/types.test.types.ts index 54398bb..efb82a3 100644 --- a/packages/helpers/types.test.types.ts +++ b/packages/helpers/types.test.types.ts @@ -1,4 +1,4 @@ -import { LooseOmit, LoosePick, typeEquals } from "./types.ts" +import { type LooseOmit, type LoosePick, typeEquals } from "./types.ts" typeEquals, { a: 1 }>(true) typeEquals, { b: 2 }>(true) diff --git a/packages/helpers/types.ts b/packages/helpers/types.ts index 34cfc8a..6d13aae 100644 --- a/packages/helpers/types.ts +++ b/packages/helpers/types.ts @@ -2,7 +2,7 @@ import { raise } from "./raise.ts" export type MaybePromise = T | PromiseLike -export type ValueOf = Type extends readonly (infer Value)[] +export type ValueOf = Type extends ReadonlyArray ? Value : Type[keyof Type] diff --git a/packages/helpers/wait-for.ts b/packages/helpers/wait-for.ts index 83d8d92..f34e7c3 100644 --- a/packages/helpers/wait-for.ts +++ b/packages/helpers/wait-for.ts @@ -1,5 +1,5 @@ import { setTimeout } from "node:timers/promises" -import { MaybePromise } from "./types.ts" +import type { MaybePromise } from "./types.ts" const maxTime = 1000 diff --git a/packages/reacord/library/core/components/embed.tsx b/packages/reacord/library/core/components/embed.tsx index 78f52f9..dc77b50 100644 --- a/packages/reacord/library/core/components/embed.tsx +++ b/packages/reacord/library/core/components/embed.tsx @@ -1,6 +1,6 @@ import { snakeCaseDeep } from "@reacord/helpers/convert-object-property-case" import { omit } from "@reacord/helpers/omit" -import React from "react" +import type React from "react" import { ReacordElement } from "../../internal/element.js" import type { MessageOptions } from "../../internal/message" import { Node } from "../../internal/node.js" @@ -17,7 +17,7 @@ export interface EmbedProps { description?: string url?: string color?: number - fields?: { name: string; value: string; inline?: boolean }[] + fields?: Array<{ name: string; value: string; inline?: boolean }> author?: { name: string; url?: string; iconUrl?: string } thumbnail?: { url: string } image?: { url: string } diff --git a/packages/reacord/library/core/reacord-discord-js.ts b/packages/reacord/library/core/reacord-discord-js.ts index 13269ea..15d4ba1 100644 --- a/packages/reacord/library/core/reacord-discord-js.ts +++ b/packages/reacord/library/core/reacord-discord-js.ts @@ -394,7 +394,7 @@ function getDiscordMessageOptions(reacordOptions: MessageOptions) { })), } - if (!options.content && !options.embeds?.length) { + if (!options.content && !options.embeds.length) { options.content = "_ _" } diff --git a/packages/reacord/library/internal/container.ts b/packages/reacord/library/internal/container.ts index 0a8fcc4..ea6e330 100644 --- a/packages/reacord/library/internal/container.ts +++ b/packages/reacord/library/internal/container.ts @@ -26,7 +26,7 @@ export class Container { } findType( - type: new (...args: NonNullable[]) => U, + type: new (...args: Array>) => U, ): U | undefined { for (const item of this.items) { if (item instanceof type) return item diff --git a/packages/website/src/pages/guides/[slug].astro b/packages/website/src/pages/guides/[slug].astro index ae0e639..638bebc 100644 --- a/packages/website/src/pages/guides/[slug].astro +++ b/packages/website/src/pages/guides/[slug].astro @@ -1,5 +1,5 @@ --- -import { type GetStaticPaths } from "astro" +import type { GetStaticPaths } from "astro" import { getCollection, type CollectionEntry } from "astro:content" import AppFooter from "~/components/app-footer.astro" import Layout from "~/components/layout.astro" diff --git a/packages/website/tailwind.config.ts b/packages/website/tailwind.config.ts index 4edaec4..314eb0a 100644 --- a/packages/website/tailwind.config.ts +++ b/packages/website/tailwind.config.ts @@ -1,4 +1,4 @@ -import { Config } from "tailwindcss" +import type { Config } from "tailwindcss" import config from "../../tailwind.config.ts" export default {