Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Types in statemanager and in search #4539

Merged
merged 6 commits into from
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion contribs/gmf/apps/desktop_alt/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ olUtilInherits(Controller, gmfControllersAbstractDesktopController);


/**
* @param {jQuery.Event} event keydown event.
* @param {JQueryEventObject} event keydown event.
* @export
*/
Controller.prototype.onKeydown = function(event) {
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/examples/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function MainController(gmfThemes, ngeoFeatureOverlayMgr, ngeoNotification) {
};

/**
* @type {TypeaheadOptions}
* @type {Twitter.Typeahead.Options}
* @export
*/
this.searchOptions = {
Expand Down
7 changes: 3 additions & 4 deletions contribs/gmf/externs/gmf-themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@


/**
* @typedef {{
* field: (string),
* value: (string|undefined)
* }} DimensionFilterConfig
* @typedef {Object} DimensionFilterConfig
sbrunner marked this conversation as resolved.
Show resolved Hide resolved
* @property {string} field
* @property {string} [value]
*/


Expand Down
18 changes: 8 additions & 10 deletions contribs/gmf/src/authentication/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,18 @@ import olEventsEventTarget from 'ol/events/Target.js';


/**
* @typedef {{
* functionalities: (AuthenticationFunctionalities|undefined),
* is_password_changed: (boolean|undefined),
* role_id: (number|undefined),
* role_name: (string|undefined),
* username: (string|undefined)
* }} AuthenticationLoginResponse
* @typedef {Object} AuthenticationLoginResponse
* @property {AuthenticationFunctionalities} [functionalities]
* @property {boolean} [is_password_changed]
* @property {number} [role_id]
* @property {string} [role_name]
* @property {string} [username]
*/


/**
* @typedef {{
* success: boolean
* }} AuthenticationDefaultResponse
* @typedef {Object} AuthenticationDefaultResponse
* @property {boolean} success
*/


Expand Down
30 changes: 15 additions & 15 deletions contribs/gmf/src/search/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {appendParams as olUriAppendParams} from 'ol/uri.js';
* @property {Array.<string>} [groupActions] List of allowed actions. The list may contain a
* combination of `add_theme`, `add_group` or `add_layer`
* @property {string} [projection] The geometry's projection for this set of data.
* @property {TypeaheadDataset} [typeaheadDatasetOptions] The optional Typeahead configuration for
* @property {Twitter.Typeahead.Dataset} [typeaheadDatasetOptions] The optional Twitter.Typeahead. configuration for
* this dataset. See: https://github.com/twitter/typeahead.js/blob/master/
* @property {string} url URL of the search service. Must contain a '%QUERY' term that will be
* replaced by the input string.
Expand Down Expand Up @@ -147,7 +147,7 @@ function gmfSearchTemplateUrl($element, $attrs, gmfSearchTemplateUrl) {
*
* @htmlAttribute {string} gmf-search-input-value The input value (read only).
* @htmlAttribute {import("ol/Map.js").default} gmf-search-map The map.
* @htmlAttribute {TypeaheadOptions|undefined} gmf-search-options Addition Typeahead options.
* @htmlAttribute {Twitter.Typeahead.Options|undefined} gmf-search-options Addition Twitter.Typeahead. options.
* @htmlAttribute {SearchComponentDatasource} gmf-search-datasource
* The datasources.
* @htmlAttribute {Object.<string, import("ol/style/Style.js").default>}
Expand Down Expand Up @@ -376,16 +376,16 @@ class SearchController {
this.datasources = [];

/**
* @type {TypeaheadOptions}
* @type {Twitter.Typeahead.Options}
* @export
*/
this.typeaheadOptions;

/**
* @type {TypeaheadOptions}
* @type {Twitter.Typeahead.Options}
* @export
*/
this.options = /** @type {TypeaheadOptions} */ ({
this.options = /** @type {Twitter.Typeahead.Options} */ ({
highlight: true
});

Expand All @@ -396,7 +396,7 @@ class SearchController {
this.featuresStyles;

/**
* @type {Array.<TypeaheadDataset>}
* @type {Array.<Twitter.Typeahead.Dataset>}
* @export
*/
this.datasets = [];
Expand Down Expand Up @@ -618,22 +618,22 @@ class SearchController {
* @param {SearchComponentDatasource} config The config of the dataset.
* @param {(function(GeoJSONFeature): boolean)=} opt_filter A filter function
* based on a GeoJSONFeaturesCollection's array.
* @return {TypeaheadDataset} A typeahead dataset.
* @return {Twitter.Typeahead.Dataset} A typeahead dataset.
* @private
*/
createDataset_(config, opt_filter) {
const gettextCatalog = this.gettextCatalog_;
const componentScope = this.scope_;
const compile = this.compile_;
const bloodhoundEngine = this.createAndInitBloodhound_(config, opt_filter);
const typeaheadDataset = /** @type {TypeaheadDataset} */ ({
const typeaheadDataset = /** @type {Twitter.Typeahead.Dataset} */ ({
limit: Infinity,
source: bloodhoundEngine.ttAdapter(),
display: (suggestion) => {
const feature = /** @type {import("ol/Feature.js").default} */ (suggestion);
return feature.get(config.labelKey);
},
templates: /* TypeaheadTemplates */ ({
templates: /* Twitter.Typeahead.Templates */ ({
header: () => {
if (config.datasetTitle === undefined) {
return '';
Expand Down Expand Up @@ -935,9 +935,9 @@ class SearchController {


/**
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @param {Object|import("ol/Feature.js").default} suggestion Suggestion.
* @param {TypeaheadDataset} dataset Dataset.
* @param {Twitter.Typeahead.Dataset} dataset Dataset.
* @private
*/
select_(event, suggestion, dataset) {
Expand All @@ -959,9 +959,9 @@ class SearchController {


/**
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @param {import("ol/Feature.js").default} feature Feature.
* @param {TypeaheadDataset} dataset Dataset.
* @param {Twitter.Typeahead.Dataset} dataset Dataset.
* @private
*/
selectFromGMF_(event, feature, dataset) {
Expand Down Expand Up @@ -1028,7 +1028,7 @@ class SearchController {


/**
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @private
*/
close_(event) {
Expand All @@ -1039,7 +1039,7 @@ class SearchController {


/**
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @param {string} query Query.
* @param {boolean} empty Empty.
* @private
Expand Down
10 changes: 5 additions & 5 deletions examples/locationsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ function SearchController(ngeoCreateLocationSearchBloodhound) {
ngeoCreateLocationSearchBloodhound, limit);

/**
* @type {TypeaheadOptions}
* @type {Twitter.Typeahead.Options}
* @export
*/
this.options = /** @type {TypeaheadOptions} */ ({
this.options = /** @type {Twitter.Typeahead.Options} */ ({
highlight: true,
hint: undefined,
minLength: undefined
});

/**
* @type {Array.<TypeaheadDataset>}
* @type {Array.<Twitter.Typeahead.Dataset>}
* @export
*/
this.datasets = [{
Expand Down Expand Up @@ -123,9 +123,9 @@ SearchController.prototype.createAndInitBloodhound_ = function(ngeoCreateLocatio


/**
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @param {Object} suggestion Suggestion.
* @param {TypeaheadDataset} dataset Dataset.
* @param {Twitter.Typeahead.Dataset} dataset Dataset.
* @this {app.locationsearch.SearchController}
* @private
*/
Expand Down
6 changes: 3 additions & 3 deletions examples/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ function SearchController($element, $rootScope, $compile, ngeoSearchCreateGeoJSO
ngeoSearchCreateGeoJSONBloodhound);

/**
* @type {TypeaheadOptions}
* @type {Twitter.Typeahead.Options}
* @export
*/
this.options = /** @type {TypeaheadOptions} */ ({
this.options = /** @type {Twitter.Typeahead.Options} */ ({
highlight: true,
hint: undefined,
minLength: undefined
});

/**
* @type {Array.<TypeaheadDataset>}
* @type {Array.<Twitter.Typeahead.Dataset>}
* @export
*/
this.datasets = [{
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"@types/angular": "1.6.53",
"@types/angular-gettext": "2.1.34",
"@types/d3": "5.7.0",
"@types/jquery": "3.3.29",
"@types/proj4": "2.5.0",
"@types/typeahead": "0.11.32",
"angular": "1.7.6",
"angular-animate": "1.7.6",
"angular-dynamic-locale": "0.1.37",
Expand Down
2 changes: 1 addition & 1 deletion src/editing/exportfeaturesComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Controller.prototype.handleElementClick_ = function() {
* Called when a menu item is clicked. Export the features to the selected
* format.
* @param {string} format Format.
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @private
*/
Controller.prototype.handleMenuItemClick_ = function(format, event) {
Expand Down
8 changes: 4 additions & 4 deletions src/grid/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Controller.prototype.sort = function(columnName) {
/**
* Handler for clicks on a row.
* @param {Object} attributes An entry/row.
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @export
*/
Controller.prototype.clickRow = function(attributes, event) {
Expand Down Expand Up @@ -260,7 +260,7 @@ Controller.prototype.selectRange_ = function(attributes) {
/**
* Prevent the default browser behaviour of selecting text
* when selecting multiple rows with SHIFT or CTRL/Meta.
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @export
*/
Controller.prototype.preventTextSelection = function(event) {
Expand All @@ -275,7 +275,7 @@ Controller.prototype.preventTextSelection = function(event) {

/**
* Same as `ol.events.condition.platformModifierKeyOnly`.
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @return {boolean} True if only the platform modifier key is pressed.
* @private
*/
Expand All @@ -288,7 +288,7 @@ Controller.prototype.isPlatformModifierKeyOnly_ = function(event) {

/**
* Same as `ol.events.condition.shiftKeyOnly`.
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @return {boolean} True if only the shift key is pressed.
* @private
*/
Expand Down
2 changes: 1 addition & 1 deletion src/message/popupComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function directive(ngeoPopupTemplateUrl) {
element.addClass('popover');

/**
* @param {jQuery.Event} evt Event.
* @param {JQueryEventObject} evt Event.
*/
scope.close = function(evt) {
if (evt) {
Expand Down
12 changes: 6 additions & 6 deletions src/routing/NominatimInputComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ function Controller($element, $injector, $scope, ngeoNominatimService) {
this.inputValue;

/**
* @type {TypeaheadOptions}
* @type {Twitter.Typeahead.Options}
* @export
*/
this.options = /** @type {TypeaheadOptions} */ ({
this.options = /** @type {Twitter.Typeahead.Options} */ ({
});

/**
* @type {Array.<TypeaheadDataset>}
* @type {Array.<Twitter.Typeahead.Dataset>}
* @export
*/
this.datasets = [/** @type {TypeaheadDataset} */({
this.datasets = [/** @type {Twitter.Typeahead.Dataset} */({
name: 'nominatim',
display: 'name',
source: this.ngeoNominatimService.typeaheadSourceDebounced
Expand All @@ -117,9 +117,9 @@ function Controller($element, $injector, $scope, ngeoNominatimService) {
}

/**
* @param {jQuery.Event} event Event.
* @param {JQueryEventObject} event Event.
* @param {NominatimSearchResult} suggestion Suggestion.
* @param {TypeaheadDataset} dataset Dataset.
* @param {Twitter.Typeahead.Dataset} dataset Dataset.
* @this {import("ngeo/routing/NominatimInputComponent.js").default.Controller}
* @private
*/
Expand Down
17 changes: 8 additions & 9 deletions src/rule/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import ngeoRuleRule from 'ngeo/rule/Rule.js';
/**
* The options for creating a text style.
*
* @typedef {{
* text: (string),
* size: (number|undefined),
* angle: (number|undefined),
* color: (ol.Color|undefined),
* width: (number|undefined),
* offsetX: (number|undefined),
* offsetY: (number|undefined)
* }} TextOptions
* @typedef {Object} TextOptions
* @property {string} text
* @property {number} [size]
* @property {number} [angle]
* @property {ol.Color} [color]
* @property {number} [width]
* @property {number} [offsetX]
* @property {number} [offsetY]
*/

export default class extends ngeoRuleRule {
Expand Down