Skip to content

Commit

Permalink
Merge pull request #238 from ariutta/update-typings
Browse files Browse the repository at this point in the history
Update typings
  • Loading branch information
bumbu authored Mar 15, 2017
2 parents 3b799ec + 904c59f commit 1be71ca
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions dist/svg-pan-zoom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand All @@ -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
Expand Down

0 comments on commit 1be71ca

Please sign in to comment.