Skip to content

Commit

Permalink
refactor(feature-layer): rename *Params -> *Options
Browse files Browse the repository at this point in the history
more consistent naming for interfaces in the feature-layer package

AFFECTS PACKAGES:
@esri/arcgis-rest-feature-layer

BREAKING CHANGE:
renamed IEditFeaturesParams to ISharedEditOptions & ISharedQueryParams to ISharedQueryOptions;
removed IDeleteFeaturesParams
  • Loading branch information
tomwayson committed Apr 17, 2019
1 parent ec366de commit 4adff11
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 28 deletions.
7 changes: 2 additions & 5 deletions packages/arcgis-rest-feature-layer/src/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ import {

import {
ILayerRequestOptions,
IEditFeaturesParams,
ISharedEditOptions,
IEditFeatureResult
} from "./helpers";

/**
* Add features request options. See the [REST Documentation](https://developers.arcgis.com/rest/services-reference/add-features.htm) for more information.
*
* @param url - Feature service url.
* @param features - Array of JSON features to add.
* @param params - Query parameters to be sent to the feature service via the request.
*/
export interface IAddFeaturesRequestOptions
extends IEditFeaturesParams,
extends ISharedEditOptions,
ILayerRequestOptions {
/**
* Array of JSON features to add.
Expand Down
17 changes: 4 additions & 13 deletions packages/arcgis-rest-feature-layer/src/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,18 @@ import {
} from "@esri/arcgis-rest-request";
import {
ILayerRequestOptions,
IEditFeaturesParams,
ISharedEditOptions,
IEditFeatureResult,
ISharedQueryParams
ISharedQueryOptions
} from "./helpers";

/**
* Delete features parameters.
*/
export interface IDeleteFeaturesParams
extends IEditFeaturesParams,
ISharedQueryParams {}

/**
* Delete features request options. See the [REST Documentation](https://developers.arcgis.com/rest/services-reference/delete-features.htm) for more information.
*
* @param url - Feature service url.
* @param objectIds - Array of objectIds to delete.
* @param params - Query parameters to be sent to the feature service via the request.
*/
export interface IDeleteFeaturesRequestOptions
extends IDeleteFeaturesParams,
extends ISharedEditOptions,
ISharedQueryOptions,
ILayerRequestOptions {
/**
* Array of objectIds to delete.
Expand Down
6 changes: 3 additions & 3 deletions packages/arcgis-rest-feature-layer/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface ILayerRequestOptions extends IRequestOptions {
url: string;
}

export interface ISharedQueryParams {
export interface ISharedQueryOptions {
where?: string;
geometry?: IGeometry;
geometryType?: GeometryType;
Expand All @@ -38,9 +38,9 @@ export interface IEditFeatureResult {
}

/**
* Common add and update features parameters.
* Common add, update, and delete features options.
*/
export interface IEditFeaturesParams {
export interface ISharedEditOptions {
/**
* The geodatabase version to apply the edits.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-feature-layer/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
IExtent
} from "@esri/arcgis-rest-request";

import { ILayerRequestOptions, ISharedQueryParams } from "./helpers";
import { ILayerRequestOptions, ISharedQueryOptions } from "./helpers";

/**
* Request options to fetch a feature by id.
Expand Down Expand Up @@ -43,7 +43,7 @@ export interface IStatisticDefinition {
* feature query request options. See [REST Documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) for more information.
*/
export interface IQueryFeaturesRequestOptions
extends ISharedQueryParams,
extends ISharedQueryOptions,
ILayerRequestOptions {
objectIds?: number[];
relationParam?: string;
Expand Down
7 changes: 2 additions & 5 deletions packages/arcgis-rest-feature-layer/src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ import {

import {
ILayerRequestOptions,
IEditFeaturesParams,
ISharedEditOptions,
IEditFeatureResult
} from "./helpers";

/**
* Update features request options. See the [REST Documentation](https://developers.arcgis.com/rest/services-reference/update-features.htm) for more information.
*
* @param url - Feature service url.
* @param features - Array of JSON features to update.
* @param params - Query parameters to be sent to the feature service via the request.
*/
export interface IUpdateFeaturesRequestOptions
extends IEditFeaturesParams,
extends ISharedEditOptions,
ILayerRequestOptions {
/**
* Array of JSON features to update.
Expand Down

0 comments on commit 4adff11

Please sign in to comment.