diff --git a/marker-animate-unobtrusive/marker-animate-unobtrusive-amd-tests.ts b/marker-animate-unobtrusive/marker-animate-unobtrusive-amd-tests.ts new file mode 100644 index 0000000000..f86619fc90 --- /dev/null +++ b/marker-animate-unobtrusive/marker-animate-unobtrusive-amd-tests.ts @@ -0,0 +1,5 @@ +import SlidingMarker = require('SlidingMarker'); +import MarkerWithGhost = require('MarkerWithGhost'); + +SlidingMarker.initializeGlobally(); +MarkerWithGhost.initializeGlobally(); diff --git a/marker-animate-unobtrusive/marker-animate-unobtrusive-tests.ts b/marker-animate-unobtrusive/marker-animate-unobtrusive-tests.ts new file mode 100644 index 0000000000..73ad4da4b5 --- /dev/null +++ b/marker-animate-unobtrusive/marker-animate-unobtrusive-tests.ts @@ -0,0 +1,50 @@ +/// +/// + +function test_init() { + SlidingMarker.initializeGlobally(); + MarkerWithGhost.initializeGlobally(); +} + +function test_options() { + var options: SlidingMarkerOptions = { + position: new google.maps.LatLng(0, 0), + easing: "easeInOutSine", + duration: 1000, + animateFunctionAdapter: (marker, destPoint, easing, duration) => {} + }; + var m = new SlidingMarker(options); + var g = new MarkerWithGhost(options); +} + +function test_sliding_marker() { + let googleMarker: google.maps.Marker; + let p: google.maps.LatLng; + let d: number; + let e:jQuery.easing.IEasingType; + + var m = new SlidingMarker(); + googleMarker = m; + + p = m.getPosition(); + m.setDuration(d); + d = m.getDuration(); + m.setEasing(e); + e = m.getEasing(); + p = m.getAnimationPosition(); + m.setPositionNotAnimated(p); +} + +function test_marker_with_ghost() { + let p: google.maps.LatLng; + let d: number; + let e:jQuery.easing.IEasingType; + let slidingMarker: SlidingMarker; + + var g = new MarkerWithGhost(); + slidingMarker = g; + + g.setGhostPosition(p); + p = g.getGhostPosition(); + p = g.getGhostAnimationPosition(); +} diff --git a/marker-animate-unobtrusive/marker-animate-unobtrusive.d.ts b/marker-animate-unobtrusive/marker-animate-unobtrusive.d.ts new file mode 100644 index 0000000000..515791052b --- /dev/null +++ b/marker-animate-unobtrusive/marker-animate-unobtrusive.d.ts @@ -0,0 +1,72 @@ +// Type definitions for marker-animate-unobtrusive 0.2.8 +// Project: https://github.com/terikon/marker-animate-unobtrusive +// Definitions by: Roman Viskin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace jQuery.easing { + type IEasingType = + 'swing' | + 'easeInQuad' | + 'easeOutQuad' | + 'easeInOutQuad' | + 'easeInCubic' | + 'easeOutCubic' | + 'easeInOutCubic' | + 'easeInQuart' | + 'easeOutQuart' | + 'easeInOutQuart' | + 'easeInQuint' | + 'easeOutQuint' | + 'easeInOutQuint' | + 'easeInSine' | + 'easeOutSine' | + 'easeInOutSine' | + 'easeInExpo' | + 'easeOutExpo' | + 'easeInOutExpo' | + 'easeInCirc' | + 'easeOutCirc' | + 'easeInOutCirc' | + 'easeInElastic' | + 'easeOutElastic' | + 'easeInOutElastic' | + 'easeInBack' | + 'easeOutBack' | + 'easeInOutBack' | + 'easeInBounce' | + 'easeOutBounce' | + 'easeInOutBounce'; +} + +interface SlidingMarkerOptions extends google.maps.MarkerOptions { + easing?: jQuery.easing.IEasingType, + duration?: number, + animateFunctionAdapter?: (marker: google.maps.Marker, destPoint: google.maps.LatLng, easing: 'linear' | jQuery.easing.IEasingType, duration: number) => void +} + +declare class SlidingMarker extends google.maps.Marker { + static initializeGlobally(): void; + constructor(opts?: SlidingMarkerOptions); + setDuration(duration: number); + getDuration(): number; + setEasing(easing: jQuery.easing.IEasingType); + getEasing(): jQuery.easing.IEasingType; + getAnimationPosition(): google.maps.LatLng; + setPositionNotAnimated(position: google.maps.LatLng | google.maps.LatLngLiteral): void; +} + +declare class MarkerWithGhost extends SlidingMarker { + setGhostPosition(ghostPosition: google.maps.LatLng | google.maps.LatLngLiteral); + getGhostPosition(): google.maps.LatLng; + getGhostAnimationPosition(): google.maps.LatLng; +} + +declare module "SlidingMarker" { + export = SlidingMarker; +} + +declare module "MarkerWithGhost" { + export = MarkerWithGhost; +}