From 904c59f2fcbacbd2de6ac59df16e4010ee9deece Mon Sep 17 00:00:00 2001 From: alex bumbu Date: Wed, 8 Mar 2017 21:16:40 +0000 Subject: [PATCH] Update typings --- dist/svg-pan-zoom.d.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dist/svg-pan-zoom.d.ts b/dist/svg-pan-zoom.d.ts index 444bf9f..2e22b3a 100644 --- a/dist/svg-pan-zoom.d.ts +++ b/dist/svg-pan-zoom.d.ts @@ -19,10 +19,11 @@ declare namespace SvgPanZoom { contain?: boolean; // (default true) center?: boolean; // enable or disable viewport centering in SVG (default true) refreshRate?: number | 'auto'; // (default 'auto') - beforeZoom?: (oldScale:number, newScale:number) => boolean; + beforeZoom?: (oldScale:number, newScale:number) => void | boolean; onZoom?: (newScale:number) => void; - beforePan?: (oldPan:Point, newPan:Point) => boolean | PointModifier; + beforePan?: (oldPan:Point, newPan:Point) => void | boolean | PointModifier; onPan?: (newPan:Point) => void; + onUpdatedCTM?: (newCTM:SVGMatrix) => void; customEventsHandler?: CustomEventHandler; // (default null) eventsListenerElement?: SVGElement; // (default null) } @@ -86,9 +87,9 @@ declare namespace SvgPanZoom { */ isPanEnabled(): boolean; - setBeforePan(fn: (point: Point)=> void): Instance; + setBeforePan(fn: (oldPoint: Point, newPoint: Point)=> void | boolean | PointModifier): Instance; - setOnPan(fn: (x: number, y: number)=> void): Instance; + setOnPan(fn: (point: Point)=> void): Instance; /** * Pan to a rendered position @@ -146,7 +147,7 @@ declare namespace SvgPanZoom { setMaxZoom(zoom: number): Instance; - setBeforeZoom(fn: (scale: number) => void): Instance; + setBeforeZoom(fn: (oldScale: number, newScale: number) => void | boolean): Instance; setOnZoom(fn: (scale: number) => void): Instance; @@ -171,6 +172,8 @@ declare namespace SvgPanZoom { */ getZoom(): number; + setOnUpdatedCTM(fn: (newCTM: SVGMatrix) => void): Instance; + /** * Adjust viewport size (only) so it will fit in SVG * Does not center image