diff --git a/src/elements/Shape.tsx b/src/elements/Shape.tsx index 7b0b4aa4a..8a87f419d 100644 --- a/src/elements/Shape.tsx +++ b/src/elements/Shape.tsx @@ -37,6 +37,14 @@ export interface SVGPoint extends Point { matrixTransform(matrix: SVGMatrix): SVGPoint; } +export interface Rect { + x: number; + y: number; + width: number; + height: number; +} +export interface SVGRect extends Rect {} + export interface Matrix { a: number; b: number; @@ -256,7 +264,10 @@ export default class Shape

extends Component

{ ) => { this.root && this.root.setNativeProps(props); }; - getBBox = (options?: SVGBoundingBoxOptions, callback?: () => void) => { + getBBox = ( + options?: SVGBoundingBoxOptions, + callback?: (box: SVGRect) => void, + ) => { const { fill = true, stroke = true, markers = true, clipped = true } = options || {}; const handle = findNodeHandle(this.root as Component);