@react-three/uikit
Version:
Build performant 3D user interfaces with react-three-fiber and yoga.
16 lines (15 loc) • 777 B
TypeScript
import { FontFamilies, FontFamilyWeightMap, FontWeight, GlyphLayoutProperties } from '@pmndrs/uikit/internals';
import { ReactNode } from 'react';
export declare function FontFamilyProvider<T extends string = never>(properties: {
[Key in T]: Key extends 'children' ? ReactNode : FontFamilyWeightMap;
}): import("react/jsx-runtime").JSX.Element;
export declare function useFontFamilies(): FontFamilies | undefined;
/**
* @returns a function that measure the text and returns the width and height if the font is already loaded. Else undefined
*/
export declare function useMeasureText(fontFamily?: string, fontWeight?: FontWeight): (properties: Omit<GlyphLayoutProperties, "font"> & {
availableWidth?: number;
}) => Promise<{
width: number;
height: number;
}>;