Skip to content

Commit

Permalink
Fix TypeScript type definitions for Code component (#10251)
Browse files Browse the repository at this point in the history
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
  • Loading branch information
mingjunlu and florian-lefebvre committed Feb 28, 2024
1 parent bb644ab commit 9b00de0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-houses-occur.md
@@ -0,0 +1,5 @@
---
"astro": patch
---

Fixes TypeScript type definitions for `Code` component `theme` and `experimentalThemes` props
6 changes: 3 additions & 3 deletions packages/astro/components/Code.astro
@@ -1,7 +1,7 @@
---
import type { ThemePresets } from '@astrojs/markdown-remark';
import type {
BuiltinLanguage,
BuiltinTheme,
LanguageRegistration,
SpecialLanguage,
ThemeRegistration,
Expand All @@ -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<string, BuiltinTheme | ThemeRegistration | ThemeRegistrationRaw>;
experimentalThemes?: Record<string, ThemePresets | ThemeRegistration | ThemeRegistrationRaw>;
/**
* Enable word wrapping.
* - true: enabled.
Expand Down

0 comments on commit 9b00de0

Please sign in to comment.