Commit Graph

11868 Commits

Author SHA1 Message Date
William Wall 7525c57688 Check the type of the source before using it
This satisfies tsc in addition to making the class more defensive
against source types that it does not support.
2018-09-19 14:39:10 -06:00
William Wall a4aaab5e32 Change bitwise or assignment to boolean assignment
Because `tsc` does not like using bitwise operations on booleans.
2018-09-19 13:00:55 -06:00
Tim Schaub e873949b31 Merge pull request #8671 from fgravin/fgravin_typescript_fixes_2
Fix typescript in FeatureLoader
2018-09-19 12:16:37 -06:00
William Wall adfc174af3 Ensure image is Image or Video before settings src
Canvas elements do not contain the 'src' property.
2018-09-19 12:12:50 -06:00
William Wall 20125ae96c Type check fixes for VectorSource
Added parameter types to event listeners. Fixed return type for
feature collection branch. Removed duplicate template definition.
2018-09-19 11:04:35 -06:00
William Wall 0994362bfe Cast tileGrid to WMTSTileGrid for type check 2018-09-19 10:31:28 -06:00
William Wall 45f2324a4e Get width as number from number|Size
This satisfies tsc in addition to being a bit more defensive from
custom tile grids, even if using them is very uncommon for this
source.
2018-09-19 10:02:33 -06:00
Florent gravin 9c6e14b050 Remove duplicate containsXY fn 2018-09-19 16:51:43 +02:00
Florent gravin 8b83371272 Feature opt_geometryOrProperties cannot be null 2018-09-19 16:48:51 +02:00
Florent gravin 25ade66017 Fix type conflict between Event and events/Event.js 2018-09-19 16:48:51 +02:00
Florent gravin f3fb88905e Use window.setTimeout for correct type checking 2018-09-19 16:48:51 +02:00
Florent gravin e740e7577a Secure type of HTMLImageElement in ImageTile 2018-09-19 16:48:51 +02:00
Florent gravin d062904cc1 Correct ol event type propagation in Geolocation positionError 2018-09-19 16:48:51 +02:00
Florent gravin cd169ede0d Correct cast of Projection in Geometry.transform 2018-09-19 16:48:51 +02:00
Florent gravin bd655b325d Implement Geometry containsXY with correct signature 2018-09-19 16:48:51 +02:00
Florent gravin 7f32ba4216 Use Style instead of import(./style/Style.js).default 2018-09-19 16:47:51 +02:00
Florent gravin 109f16f717 Use Geometry instead of import(./geom/Geometry.js).default 2018-09-19 16:47:51 +02:00
Florent gravin b3127f86be Fix cast for Geometry type 2018-09-19 16:47:51 +02:00
Florent gravin e25d053ba6 Featureloader this reference can also be ol.VectorTile 2018-09-19 16:43:10 +02:00
Frederic Junod 3029a07c1a Fix source type in Raster source
The `sources` is an array of layer or source
2018-09-19 15:34:34 +02:00
Frédéric Junod 978b039ddc Merge pull request #8654 from fredj/import
Remove extra imports in jsdoc
2018-09-19 15:12:10 +02:00
Frédéric Junod 65066a0505 Merge pull request #8655 from fredj/webkit_touch
Remove webkit specific properties from Touch
2018-09-19 15:05:20 +02:00
Frédéric Junod 43bc3020a1 Merge pull request #8663 from schmidtk/ts-vendor-fullscreen
Add vendor-specific TS declarations for the Fullscreen API.
2018-09-19 15:05:05 +02:00
Frédéric Junod 5f63575106 Merge pull request #8658 from fredj/proto_void
Don't define functions in the prototype
2018-09-19 14:53:59 +02:00
Frederic Junod 9c52e0d6d9 Remove extra imports in jsdoc
The symbols are already imported (es6 import)
2018-09-19 14:52:58 +02:00
Tim Schaub 77dbf2fdb0 Merge pull request #8662 from wallw-bits/fix-typecheck-ol-tile
Explicitly define type of 'this'
2018-09-19 06:50:59 -06:00
Tim Schaub ad399246a3 Merge pull request #8664 from schmidtk/ts-listener-fn
Add native Event to ListenerFunction signature.
2018-09-19 06:47:18 -06:00
Frederic Junod 600d156d01 Add missing 'module' annotation 2018-09-19 11:51:34 +02:00
Frederic Junod 54cdaddf3a Don't use Chrome only ALLOW_KEYBOARD_INPUT param 2018-09-19 11:12:27 +02:00
Frederic Junod 31c392b63c Remove containsXY function from ol/geom/SimpleGeometry
The function is already present in the base class (ol/geom/Geometry)
2018-09-19 08:40:14 +02:00
Frederic Junod 7cb85fa975 Don't define functions in the prototype
If `VOID` is used, TypeScript is not able to figure out what the function parameters are.

Before:
```
$ npx tsc | wc -l
    1188
```

After:
```
$ npx tsc | wc -l
    1169
```
2018-09-19 08:40:14 +02:00
Kevin Schmidt f8396d8f35 Fix condition TypeScript errors 2018-09-18 15:29:13 -06:00
Kevin Schmidt 4d26ab751d Add vendor-specific TS declarations for the Fullscreen API.
Fixes #8660.
2018-09-18 13:22:55 -06:00
Kevin Schmidt f819ed137b Add native Event to ListenerFunction signature. 2018-09-18 13:10:36 -06:00
William Wall 1fbefcab64 Explicitly define type of 'this'
I'm not entirely sure that I like this pattern, but there does not
appear to be a better option since TypeScript would recommend:

  function(this: SomeClass, ...)

tsdoc does not appear to support an associated annotation for the
function a la @this {SomeClass}.
2018-09-18 10:38:23 -06:00
Frederic Junod 960b433a2c Remove webkit specific properties from Touch
Remove the following errors from the TypeScript checks:
```
src/ol/pointer/TouchSource.js(231,23): error TS2339: Property 'webkitRadiusX' does not exist on type 'Touch'.
src/ol/pointer/TouchSource.js(232,24): error TS2339: Property 'webkitRadiusY' does not exist on type 'Touch'.
src/ol/pointer/TouchSource.js(233,26): error TS2339: Property 'webkitForce' does not exist on type 'Touch'.
```

The only reference that I've found for these properties is a warning message from Google Chrome:
```
'Touch.webkitRadiusX' is deprecated and will be removed in M47, around November 2015. Please use 'Touch.radiusX' instead.
```
2018-09-18 13:36:38 +02:00
Kevin Schmidt 124fccf127 Fix style TypeScript errors 2018-09-17 12:38:00 -06:00
Andreas Hocevar 7912c5d711 Merge pull request #8638 from ahocevar/fix-haslistener-check
Fix event type in hasListener check
2018-09-15 09:08:55 +02:00
Dmitry Fedorov 7d77d05a57 fix dangling comma 2018-09-14 13:58:13 -07:00
Dmitry Fedorov 028caa4664 fixes for optional key handling 2018-09-14 12:02:37 -07:00
ahocevar 90403421af Fix event type in hasListener check 2018-09-14 18:15:18 +02:00
Frederic Junod ba53b5e8aa Quotes topojson properties 2018-09-14 13:02:30 +02:00
Frederic Junod abc3279752 Use TopoJSON types from @types/topojson 2018-09-14 13:02:30 +02:00
Frédéric Junod 84c689d456 Merge pull request #8619 from fredj/typing
Remove wrong Geometry type in KML format
2018-09-14 12:46:31 +02:00
ahocevar f29e6ac397 Fix more incorrect type imports 2018-09-13 11:42:59 +02:00
ahocevar 79674363e6 Fix imports in TextState 2018-09-13 11:42:59 +02:00
Marc Jansen 143bf731b6 Better type annotations / type casts 2018-09-11 21:59:54 +02:00
Tim Schaub f9f2f981f1 Remove unused method 2018-09-11 10:13:26 -06:00
Tim Schaub 8b45011cd5 Merge pull request #8615 from tschaub/geojson-types
Use GeoJSON types from @types/geojson
2018-09-11 09:57:31 -06:00
Tim Schaub 39c31e62a3 Remove unnecessary type casts 2018-09-11 09:02:33 -06:00