mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-03 07:06:04 +00:00
fix: improve types for getBBox
This commit is contained in:
+12
-1
@@ -37,6 +37,14 @@ export interface SVGPoint extends Point {
|
|||||||
matrixTransform(matrix: SVGMatrix): SVGPoint;
|
matrixTransform(matrix: SVGMatrix): SVGPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Rect {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
}
|
||||||
|
export interface SVGRect extends Rect {}
|
||||||
|
|
||||||
export interface Matrix {
|
export interface Matrix {
|
||||||
a: number;
|
a: number;
|
||||||
b: number;
|
b: number;
|
||||||
@@ -256,7 +264,10 @@ export default class Shape<P> extends Component<P> {
|
|||||||
) => {
|
) => {
|
||||||
this.root && this.root.setNativeProps(props);
|
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 } =
|
const { fill = true, stroke = true, markers = true, clipped = true } =
|
||||||
options || {};
|
options || {};
|
||||||
const handle = findNodeHandle(this.root as Component);
|
const handle = findNodeHandle(this.root as Component);
|
||||||
|
|||||||
Reference in New Issue
Block a user