diff --git a/types/wordpress__block-editor/hooks/use-typography-props.d.ts b/types/wordpress__block-editor/hooks/use-typography-props.d.ts index 7e70730d739149..b9980ea21007b8 100644 --- a/types/wordpress__block-editor/hooks/use-typography-props.d.ts +++ b/types/wordpress__block-editor/hooks/use-typography-props.d.ts @@ -1,4 +1,5 @@ import { BlockAttributes } from "@wordpress/blocks"; +import { GlobalStylesSettings } from "@wordpress/global-styles-engine"; /** * Provides the CSS class names and inline styles for a block's typography support @@ -6,11 +7,11 @@ import { BlockAttributes } from "@wordpress/blocks"; * * @param attributes Block attributes. * @param fluidTypographySettings If boolean, whether the function should try to convert font sizes to fluid values, - * otherwise an object containing theme fluid typography settings. + * otherwise an object containing theme (typography) settings. * * @return Typography block support derived CSS classes & styles. */ export function getTypographyClassesAndStyles( attributes: BlockAttributes, - fluidTypographySettings: { minFontSize?: string } | boolean, + fluidTypographySettings?: { minFontSize?: string } | GlobalStylesSettings | boolean, ): { className: string; style: Record }; diff --git a/types/wordpress__block-editor/package.json b/types/wordpress__block-editor/package.json index a6efe82a33da4f..1a383461ea76c3 100644 --- a/types/wordpress__block-editor/package.json +++ b/types/wordpress__block-editor/package.json @@ -11,6 +11,7 @@ "@wordpress/components": "^29.12.0", "@wordpress/data": "^10.26.0", "@wordpress/element": "^6.26.0", + "@wordpress/global-styles-engine": "^1.4.0", "@wordpress/keycodes": "^4.26.0", "react-autosize-textarea": "^7.1.0" }, diff --git a/types/wordpress__block-editor/wordpress__block-editor-tests.tsx b/types/wordpress__block-editor/wordpress__block-editor-tests.tsx index 92c27713fa770b..f1f965ad4f86f6 100644 --- a/types/wordpress__block-editor/wordpress__block-editor-tests.tsx +++ b/types/wordpress__block-editor/wordpress__block-editor-tests.tsx @@ -683,6 +683,9 @@ be.getTypographyClassesAndStyles({}, false).style; be.getTypographyClassesAndStyles({}, {}).style; be.getTypographyClassesAndStyles({}, { minFontSize: "33" }).style; +// $ExpectType string +be.getTypographyClassesAndStyles({}).className; + // $ExpectType "HELLO" be.useCachedTruthy("HELLO");