diff --git a/.changeset/wicked-houses-occur.md b/.changeset/wicked-houses-occur.md new file mode 100644 index 000000000000..61248c948bb1 --- /dev/null +++ b/.changeset/wicked-houses-occur.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes TypeScript type definitions for `Code` component `theme` and `experimentalThemes` props diff --git a/packages/astro/components/Code.astro b/packages/astro/components/Code.astro index 44d81b7144f1..ab2d88696c6c 100644 --- a/packages/astro/components/Code.astro +++ b/packages/astro/components/Code.astro @@ -1,7 +1,7 @@ --- +import type { ThemePresets } from '@astrojs/markdown-remark'; import type { BuiltinLanguage, - BuiltinTheme, LanguageRegistration, SpecialLanguage, ThemeRegistration, @@ -28,12 +28,12 @@ interface Props { * * @default "github-dark" */ - theme?: BuiltinTheme | ThemeRegistration | ThemeRegistrationRaw; + theme?: ThemePresets | ThemeRegistration | ThemeRegistrationRaw; /** * Multiple themes to style with -- alternative to "theme" option. * Supports all themes found above; see https://github.com/antfu/shikiji#lightdark-dual-themes for more information. */ - experimentalThemes?: Record; + experimentalThemes?: Record; /** * Enable word wrapping. * - true: enabled.