fix: specify type Text.measureSize

This commit is contained in:
kyechan99 2024-07-18 18:46:56 +09:00
parent 7b99aa9813
commit ffc58d248b

View File

@ -392,13 +392,13 @@ export class Text extends Shape<TextConfig> {
* That method can't handle multiline text. * That method can't handle multiline text.
* @method * @method
* @name Konva.Text#measureSize * @name Konva.Text#measureSize
* @param {String} [text] text to measure * @param {String} text text to measure
* @returns {Object} { width , height} of measured text * @returns {Object} { width , height } of measured text
*/ */
measureSize(text) { measureSize(text: string) {
var _context = getDummyContext(), var _context = getDummyContext(),
fontSize = this.fontSize(), fontSize = this.fontSize(),
metrics; metrics: TextMetrics;
_context.save(); _context.save();
_context.font = this._getContextFont(); _context.font = this._getContextFont();