Skip to content

Commit

Permalink
Merge pull request #41 from ulken/fix-complete_types
Browse files Browse the repository at this point in the history
Rework TypeScript definition
  • Loading branch information
maximeh authored Sep 19, 2021
2 parents ab0cb7f + 9500421 commit a1662ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
28 changes: 15 additions & 13 deletions leaflet.bouncemarker.d.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import * as L from 'leaflet';
import "leaflet";

declare module 'leaflet' {

export interface MarkerOptions extends InteractiveLayerOptions {
declare module "leaflet" {
export type BounceOptions = {
duration?: number;
height?: number;
loop?: number;
};

export interface MarkerOptions {
bounceOnAdd?: boolean;

bounceOnAddOptions?: {
duration: number,
height: number,
loop: number,
};

bounceOnAddCallback?: Function;

bounceOnAddOptions?: BounceOptions;
bounceOnAddCallback?: () => void;
}

export interface Marker {
bounce(callback?: () => void): void;
bounce(options: BounceOptions, callback?: () => void): void;
stopBounce(): void;
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.2.1",
"description": "Make a marker bounce when you add it to a map.",
"main": "bouncemarker.js",
"types": "leaflet.bouncemarker.d.ts",
"license": "MIT",
"repository": {
"type": "git",
Expand Down

0 comments on commit a1662ce

Please sign in to comment.