Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions types/wordpress__block-editor/hooks/use-typography-props.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
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
* attributes.
*
* @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<string, string> };
1 change: 1 addition & 0 deletions types/wordpress__block-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down