Created
September 19, 2018 09:22
-
-
Save nkint/3a6298ebb4bc6e13a888254d20657454 to your computer and use it in GitHub Desktop.
measure-text.d.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'measure-text' { | |
function measureText({ | |
text, | |
fontFamily, | |
fontSize, | |
lineHeight, | |
fontWeight, | |
fontStyle, | |
canvas, | |
}: { | |
text: string | |
fontFamily: string | |
fontSize: string | number | |
lineHeight: number | |
fontWeight?: number | |
fontStyle?: string | |
canvas?: HTMLCanvasElement | |
}): { | |
text: string | |
width: { unit: string; value: number } | |
height: { unit: string; value: number } | |
} | |
export default measureText | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment