Rename Style~Function path type to Style~StyleFunction

This commit is contained in:
ahocevar
2018-04-27 07:23:42 +02:00
parent 3a365fab56
commit 9bfdf818e4
9 changed files with 29 additions and 29 deletions

View File

@@ -78,13 +78,13 @@ const Feature = function(opt_geometryOrProperties) {
/**
* User provided style.
* @private
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function}
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
*/
this.style_ = null;
/**
* @private
* @type {module:ol/style/Style~Function|undefined}
* @type {module:ol/style/Style~StyleFunction|undefined}
*/
this.styleFunction_ = undefined;
@@ -177,7 +177,7 @@ Feature.prototype.getGeometryName = function() {
/**
* Get the feature's style. Will return what was provided to the
* {@link module:ol/Feature~Feature#setStyle} method.
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} The feature style.
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} The feature style.
* @api
*/
Feature.prototype.getStyle = function() {
@@ -187,7 +187,7 @@ Feature.prototype.getStyle = function() {
/**
* Get the feature's style function.
* @return {module:ol/style/Style~Function|undefined} Return a function
* @return {module:ol/style/Style~StyleFunction|undefined} Return a function
* representing the current style of this feature.
* @api
*/
@@ -237,7 +237,7 @@ Feature.prototype.setGeometry = function(geometry) {
* Set the style for the feature. This can be a single style object, an array
* of styles, or a function that takes a resolution and returns an array of
* styles. If it is `null` the feature has no style (a `null` style).
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} style Style for this feature.
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} style Style for this feature.
* @api
* @fires module:ol/events/Event~Event#event:change
*/
@@ -286,9 +286,9 @@ Feature.prototype.setGeometryName = function(name) {
* Convert the provided object into a feature style function. Functions passed
* through unchanged. Arrays of module:ol/style/Style or single style objects wrapped
* in a new feature style function.
* @param {module:ol/style/Style~Function|!Array.<module:ol/style/Style>|!module:ol/style/Style} obj
* @param {module:ol/style/Style~StyleFunction|!Array.<module:ol/style/Style>|!module:ol/style/Style} obj
* A feature style function, a single style, or an array of styles.
* @return {module:ol/style/Style~Function} A style function.
* @return {module:ol/style/Style~StyleFunction} A style function.
*/
export function createStyleFunction(obj) {
if (typeof obj === 'function') {

View File

@@ -411,7 +411,7 @@ function createNameStyleFunction(foundStyle, name) {
* @param {Array.<module:ol/style/Style>} defaultStyle Default style.
* @param {!Object.<string, (Array.<module:ol/style/Style>|string)>} sharedStyles Shared styles.
* @param {boolean|undefined} showPointNames true to show names for point placemarks.
* @return {module:ol/style/Style~Function} Feature style function.
* @return {module:ol/style/Style~StyleFunction} Feature style function.
*/
function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles, showPointNames) {

View File

@@ -57,7 +57,7 @@ import {createEditingStyle} from '../style/Style.js';
* @property {module:ol/events/condition~Condition} [finishCondition] A function
* that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
* boolean to indicate whether the drawing can be finished.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style]
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* Style for sketch features.
* @property {module:ol/interaction/Draw~GeometryFunction} [geometryFunction]
* Function that is called when a geometry's coordinates are updated.
@@ -437,7 +437,7 @@ inherits(Draw, PointerInteraction);
/**
* @return {module:ol/style/Style~Function} Styles.
* @return {module:ol/style/Style~StyleFunction} Styles.
*/
function getDefaultStyleFunction() {
const styles = createEditingStyle();

View File

@@ -21,12 +21,12 @@ import {createEditingStyle} from '../style/Style.js';
* @typedef {Object} Options
* @property {module:ol/extent~Extent} [extent] Initial extent. Defaults to no
* initial extent.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [boxStyle]
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [boxStyle]
* Style for the drawn extent box. Defaults to
* {@link module:ol/style/Style~createEditing()['Polygon']}
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
* pointer close enough to a segment or vertex for editing.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [pointerStyle]
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [pointerStyle]
* Style for the cursor used to draw the extent. Defaults to
* {@link module:ol/style/Style~createEditing()['Point']}
* @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps
@@ -288,7 +288,7 @@ function handleUpEvent(mapBrowserEvent) {
/**
* Returns the default style for the drawn bbox
*
* @return {module:ol/style/Style~Function} Default Extent style
* @return {module:ol/style/Style~StyleFunction} Default Extent style
*/
function getDefaultExtentStyleFunction() {
const style = createEditingStyle();
@@ -300,7 +300,7 @@ function getDefaultExtentStyleFunction() {
/**
* Returns the default style for the pointer
*
* @return {module:ol/style/Style~Function} Default pointer style
* @return {module:ol/style/Style~StyleFunction} Default pointer style
*/
function getDefaultPointerStyleFunction() {
const style = createEditingStyle();

View File

@@ -72,7 +72,7 @@ const ModifyEventType = {
* features. Default is {@link module:ol/events/condition~always}.
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
* pointer close enough to a segment or vertex for editing.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style]
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* Style used for the features being modified. By default the default edit
* style is used (see {@link module:ol/style}).
* @property {module:ol/source/Vector} [source] The vector source with
@@ -1267,7 +1267,7 @@ Modify.prototype.updateSegmentIndices_ = function(
/**
* @return {module:ol/style/Style~Function} Styles.
* @return {module:ol/style/Style~StyleFunction} Styles.
*/
function getDefaultStyleFunction() {
const style = createEditingStyle();

View File

@@ -61,7 +61,7 @@ const SelectEventType = {
* in the map and should return `true` for layers that you want to be
* selectable. If the option is absent, all visible layers will be considered
* selectable.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style]
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* Style for the selected features. By default the default edit style is used
* (see {@link module:ol/style}).
* @property {module:ol/events/condition~Condition} [removeCondition] A function
@@ -441,7 +441,7 @@ Select.prototype.setMap = function(map) {
/**
* @return {module:ol/style/Style~Function} Styles.
* @return {module:ol/style/Style~StyleFunction} Styles.
*/
function getDefaultStyleFunction() {
const styles = createEditingStyle();

View File

@@ -40,7 +40,7 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
* @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
* means higher priority.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style] Layer style. See
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined.
* @property {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously.
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
@@ -117,14 +117,14 @@ const VectorLayer = function(opt_options) {
/**
* User provided style.
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function}
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
* @private
*/
this.style_ = null;
/**
* Style function for use within the library.
* @type {module:ol/style/Style~Function|undefined}
* @type {module:ol/style/Style~StyleFunction|undefined}
* @private
*/
this.styleFunction_ = undefined;
@@ -210,7 +210,7 @@ VectorLayer.prototype.getSource;
/**
* Get the style for features. This returns whatever was passed to the `style`
* option at construction or to the `setStyle` method.
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function}
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
* Layer style.
* @api
*/
@@ -221,7 +221,7 @@ VectorLayer.prototype.getStyle = function() {
/**
* Get the style function.
* @return {module:ol/style/Style~Function|undefined} Layer style function.
* @return {module:ol/style/Style~StyleFunction|undefined} Layer style function.
* @api
*/
VectorLayer.prototype.getStyleFunction = function() {
@@ -263,7 +263,7 @@ VectorLayer.prototype.setRenderOrder = function(renderOrder) {
* it is `null` the layer has no style (a `null` style), so only features
* that have their own styles will be rendered in the layer. See
* {@link ol.style} for information on the default style.
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function|null|undefined}
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction|null|undefined}
* style Layer style.
* @api
*/

View File

@@ -69,7 +69,7 @@ export const RenderType = {
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
* means higher priority. When set to `true`, a `renderMode` of `'image'` will be overridden with
* `'hybrid'`.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style] Layer style. See
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined.
* @property {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously.
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
@@ -82,7 +82,7 @@ export const RenderType = {
* means no preloading.
* @property {module:ol/render~OrderFunction} [renderOrder] Render order. Function to be used when sorting
* features before rendering. By default features are drawn in the order that they are created.
* @property {(module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function)} [style] Layer style. See
* @property {(module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction)} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined.
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
*/

View File

@@ -15,7 +15,7 @@ import Stroke from '../style/Stroke.js';
* vector layer can be styled.
*
* @typedef {function((module:ol/Feature|module:ol/render/Feature), number):
* (module:ol/style/Style|Array.<module:ol/style/Style>)} Function
* (module:ol/style/Style|Array.<module:ol/style/Style>)} StyleFunction
*/
@@ -324,9 +324,9 @@ Style.prototype.setZIndex = function(zIndex) {
* Convert the provided object into a style function. Functions passed through
* unchanged. Arrays of module:ol/style/Style or single style objects wrapped in a
* new style function.
* @param {module:ol/style/Style~Function|Array.<module:ol/style/Style>|module:ol/style/Style} obj
* @param {module:ol/style/Style~StyleFunction|Array.<module:ol/style/Style>|module:ol/style/Style} obj
* A style function, a single style, or an array of styles.
* @return {module:ol/style/Style~Function} A style function.
* @return {module:ol/style/Style~StyleFunction} A style function.
*/
export function toFunction(obj) {
let styleFunction;