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

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) {
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) {
evt.preventDefault();

View File

@@ -29,7 +29,7 @@ import Event from '../events/Event.js';
* returns false.
*
* @constructor
* @extends {ol.Disposable}
* @extends {module:ol/Disposable~Disposable}
*/
const EventTarget = function() {
@@ -75,7 +75,7 @@ EventTarget.prototype.addEventListener = function(type, listener) {
/**
* @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.
* @return {boolean|undefined} `false` if anyone called preventDefault on the
* event object or if any of the listeners returned false.

View File

@@ -9,7 +9,7 @@
export default {
/**
* Generic change event. Triggered when the revision counter is increased.
* @event ol.events.Event#change
* @event module:ol/events/Event~Event#change
* @api
*/
CHANGE: 'change',

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
* 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.
* @api
*/
@@ -28,7 +28,7 @@ export const altKeyOnly = function(mapBrowserEvent) {
* Return `true` if only the alt-key and shift-key is pressed, `false` otherwise
* (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.
* @api
*/
@@ -45,7 +45,7 @@ export const altShiftKeysOnly = function(mapBrowserEvent) {
* 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">`.
*
* @param {ol.MapBrowserEvent} event Map browser event.
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} event Map browser event.
* @return {boolean} The map has the focus.
* @api
*/
@@ -57,7 +57,7 @@ export const focus = function(event) {
/**
* Return always true.
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True.
* @function
* @api
@@ -68,7 +68,7 @@ export const always = TRUE;
/**
* 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.
* @api
*/
@@ -83,7 +83,7 @@ export const click = function(mapBrowserEvent) {
* By definition, this includes left-click on windows/linux, and left-click
* 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.
*/
export const mouseActionButton = function(mapBrowserEvent) {
@@ -96,7 +96,7 @@ export const mouseActionButton = function(mapBrowserEvent) {
/**
* Return always false.
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} False.
* @function
* @api
@@ -108,7 +108,7 @@ export const never = FALSE;
* Return `true` if the browser event is a `pointermove` event, `false`
* 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.
* @api
*/
@@ -120,7 +120,7 @@ export const pointerMove = function(mapBrowserEvent) {
/**
* 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.
* @api
*/
@@ -132,7 +132,7 @@ export const singleClick = function(mapBrowserEvent) {
/**
* 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.
* @api
*/
@@ -145,7 +145,7 @@ export const doubleClick = function(mapBrowserEvent) {
* Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is
* 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.
* @api
*/
@@ -163,7 +163,7 @@ export const noModifierKeys = function(mapBrowserEvent) {
* ctrl-key otherwise) is pressed, `false` otherwise (e.g. when 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 platform modifier key is pressed.
* @api
*/
@@ -179,7 +179,7 @@ export const platformModifierKeyOnly = function(mapBrowserEvent) {
* Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when
* 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.
* @api
*/
@@ -196,7 +196,7 @@ export const shiftKeyOnly = function(mapBrowserEvent) {
* Return `true` if the target element is not editable, i.e. not a `<input>`-,
* `<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.
* @api
*/
@@ -213,14 +213,14 @@ export const targetNotEditable = function(mapBrowserEvent) {
/**
* 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.
* @api
*/
export const mouseOnly = function(mapBrowserEvent) {
assert(mapBrowserEvent.pointerEvent, 56); // mapBrowserEvent must originate from a pointer event
// 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.
* @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.
* @api
*/

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
*/