Get rid of olx.js and typedef.js typedefs for ol/events

This commit is contained in:
Andreas Hocevar
2018-03-08 18:45:48 +01:00
parent 95d6251dbb
commit 395b26832a
5 changed files with 22 additions and 40 deletions
+2 -2
View File
@@ -59,7 +59,7 @@ Event.prototype.preventDefault =
/** /**
* @param {Event|ol.events.Event} evt Event * @param {Event|module:ol/events/Event~Event} evt Event
*/ */
export function stopPropagation(evt) { export function stopPropagation(evt) {
evt.stopPropagation(); evt.stopPropagation();
@@ -67,7 +67,7 @@ export function stopPropagation(evt) {
/** /**
* @param {Event|ol.events.Event} evt Event * @param {Event|module:ol/events/Event~Event} evt Event
*/ */
export function preventDefault(evt) { export function preventDefault(evt) {
evt.preventDefault(); evt.preventDefault();
+2 -2
View File
@@ -29,7 +29,7 @@ import Event from '../events/Event.js';
* returns false. * returns false.
* *
* @constructor * @constructor
* @extends {ol.Disposable} * @extends {module:ol/Disposable~Disposable}
*/ */
const EventTarget = function() { const EventTarget = function() {
@@ -75,7 +75,7 @@ EventTarget.prototype.addEventListener = function(type, listener) {
/** /**
* @param {{type: string, * @param {{type: string,
* target: (EventTarget|module:ol/events/EventTarget~EventTarget|undefined)}|ol.events.Event| * target: (EventTarget|module:ol/events/EventTarget~EventTarget|undefined)}|module:ol/events/Event~Event|
* string} event Event or event type. * string} event Event or event type.
* @return {boolean|undefined} `false` if anyone called preventDefault on the * @return {boolean|undefined} `false` if anyone called preventDefault on the
* event object or if any of the listeners returned false. * event object or if any of the listeners returned false.
+1 -1
View File
@@ -9,7 +9,7 @@
export default { export default {
/** /**
* Generic change event. Triggered when the revision counter is increased. * Generic change event. Triggered when the revision counter is increased.
* @event ol.events.Event#change * @event module:ol/events/Event~Event#change
* @api * @api
*/ */
CHANGE: 'change', CHANGE: 'change',
+17 -17
View File
@@ -11,7 +11,7 @@ import {WEBKIT, MAC} from '../has.js';
* Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when * Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when
* additionally the shift-key is pressed). * additionally the shift-key is pressed).
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if only the alt key is pressed. * @return {boolean} True if only the alt key is pressed.
* @api * @api
*/ */
@@ -28,7 +28,7 @@ export const altKeyOnly = function(mapBrowserEvent) {
* Return `true` if only the alt-key and shift-key is pressed, `false` otherwise * Return `true` if only the alt-key and shift-key is pressed, `false` otherwise
* (e.g. when additionally the platform-modifier-key is pressed). * (e.g. when additionally the platform-modifier-key is pressed).
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if only the alt and shift keys are pressed. * @return {boolean} True if only the alt and shift keys are pressed.
* @api * @api
*/ */
@@ -45,7 +45,7 @@ export const altShiftKeysOnly = function(mapBrowserEvent) {
* Return `true` if the map has the focus. This condition requires a map target * Return `true` if the map has the focus. This condition requires a map target
* element with a `tabindex` attribute, e.g. `<div id="map" tabindex="1">`. * element with a `tabindex` attribute, e.g. `<div id="map" tabindex="1">`.
* *
* @param {ol.MapBrowserEvent} event Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} event Map browser event.
* @return {boolean} The map has the focus. * @return {boolean} The map has the focus.
* @api * @api
*/ */
@@ -57,7 +57,7 @@ export const focus = function(event) {
/** /**
* Return always true. * Return always true.
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True. * @return {boolean} True.
* @function * @function
* @api * @api
@@ -68,7 +68,7 @@ export const always = TRUE;
/** /**
* Return `true` if the event is a `click` event, `false` otherwise. * Return `true` if the event is a `click` event, `false` otherwise.
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event is a map `click` event. * @return {boolean} True if the event is a map `click` event.
* @api * @api
*/ */
@@ -83,7 +83,7 @@ export const click = function(mapBrowserEvent) {
* By definition, this includes left-click on windows/linux, and left-click * By definition, this includes left-click on windows/linux, and left-click
* without the ctrl key on Macs. * without the ctrl key on Macs.
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} The result. * @return {boolean} The result.
*/ */
export const mouseActionButton = function(mapBrowserEvent) { export const mouseActionButton = function(mapBrowserEvent) {
@@ -96,7 +96,7 @@ export const mouseActionButton = function(mapBrowserEvent) {
/** /**
* Return always false. * Return always false.
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} False. * @return {boolean} False.
* @function * @function
* @api * @api
@@ -108,7 +108,7 @@ export const never = FALSE;
* Return `true` if the browser event is a `pointermove` event, `false` * Return `true` if the browser event is a `pointermove` event, `false`
* otherwise. * otherwise.
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the browser event is a `pointermove` event. * @return {boolean} True if the browser event is a `pointermove` event.
* @api * @api
*/ */
@@ -120,7 +120,7 @@ export const pointerMove = function(mapBrowserEvent) {
/** /**
* Return `true` if the event is a map `singleclick` event, `false` otherwise. * Return `true` if the event is a map `singleclick` event, `false` otherwise.
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event is a map `singleclick` event. * @return {boolean} True if the event is a map `singleclick` event.
* @api * @api
*/ */
@@ -132,7 +132,7 @@ export const singleClick = function(mapBrowserEvent) {
/** /**
* Return `true` if the event is a map `dblclick` event, `false` otherwise. * Return `true` if the event is a map `dblclick` event, `false` otherwise.
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event is a map `dblclick` event. * @return {boolean} True if the event is a map `dblclick` event.
* @api * @api
*/ */
@@ -145,7 +145,7 @@ export const doubleClick = function(mapBrowserEvent) {
* Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is * Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is
* pressed. * pressed.
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True only if there no modifier keys are pressed. * @return {boolean} True only if there no modifier keys are pressed.
* @api * @api
*/ */
@@ -163,7 +163,7 @@ export const noModifierKeys = function(mapBrowserEvent) {
* ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally * ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally
* the shift-key is pressed). * the shift-key is pressed).
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if only the platform modifier key is pressed. * @return {boolean} True if only the platform modifier key is pressed.
* @api * @api
*/ */
@@ -179,7 +179,7 @@ export const platformModifierKeyOnly = function(mapBrowserEvent) {
* Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when * Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when
* additionally the alt-key is pressed). * additionally the alt-key is pressed).
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if only the shift key is pressed. * @return {boolean} True if only the shift key is pressed.
* @api * @api
*/ */
@@ -196,7 +196,7 @@ export const shiftKeyOnly = function(mapBrowserEvent) {
* Return `true` if the target element is not editable, i.e. not a `<input>`-, * Return `true` if the target element is not editable, i.e. not a `<input>`-,
* `<select>`- or `<textarea>`-element, `false` otherwise. * `<select>`- or `<textarea>`-element, `false` otherwise.
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True only if the target element is not editable. * @return {boolean} True only if the target element is not editable.
* @api * @api
*/ */
@@ -213,14 +213,14 @@ export const targetNotEditable = function(mapBrowserEvent) {
/** /**
* Return `true` if the event originates from a mouse device. * Return `true` if the event originates from a mouse device.
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event originates from a mouse device. * @return {boolean} True if the event originates from a mouse device.
* @api * @api
*/ */
export const mouseOnly = function(mapBrowserEvent) { export const mouseOnly = function(mapBrowserEvent) {
assert(mapBrowserEvent.pointerEvent, 56); // mapBrowserEvent must originate from a pointer event assert(mapBrowserEvent.pointerEvent, 56); // mapBrowserEvent must originate from a pointer event
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType // see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
return /** @type {ol.MapBrowserEvent} */ (mapBrowserEvent).pointerEvent.pointerType == 'mouse'; return /** @type {module:ol/MapBrowserEvent~MapBrowserEvent} */ (mapBrowserEvent).pointerEvent.pointerType == 'mouse';
}; };
@@ -229,7 +229,7 @@ export const mouseOnly = function(mapBrowserEvent) {
* contact with the surface or if the left mouse button is pressed. * contact with the surface or if the left mouse button is pressed.
* @see http://www.w3.org/TR/pointerevents/#button-states * @see http://www.w3.org/TR/pointerevents/#button-states
* *
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event originates from a primary pointer. * @return {boolean} True if the event originates from a primary pointer.
* @api * @api
*/ */
-18
View File
@@ -1,18 +0,0 @@
/**
* Applications do not normally create event instances. They register (and
* unregister) event listener functions, which, when called by the library as
* the result of an event being dispatched, are passed event instances as their
* first argument. Listeners can be registered and unregistered on all objects
* descending from {@link ol.Observable}. All event instances have a `target`
* property, which corresponds to the object on which the event was dispatched.
* By default, `this` within the listener also refers to the target, though
* this can be configured in the listener registration function.
* Some classes have their own event type, which return additional
* properties; see the specific event class page for details.
*
* @namespace ol.events
*/
/**
* @namespace ol.events.condition
*/