# Interface FeatureSource

A source of features.

interface FeatureSource {
attachmentTypes?: string[];
capabilities: Capabilities;
featureActions?: Menu<MenuItemProperties, MenuProperties, MenuItem<MenuItemProperties, MenuProperties>>;
featureSettings: FeatureSettings;
featureSourceActions?: Menu<MenuItemProperties, MenuProperties, MenuItem<MenuItemProperties, MenuProperties>>;
hyperlinks: Collection<Hyperlink>;
iconUrl?: string;
id: string;
isDestroyed: boolean;
isInitialized: boolean;
itemType: string;
onAddFeature?: Action;
onEditFeature?: Action;
queryService?: QueryService;
relationships: Collection<Relationship>;
schema: Schema;
taskSettings: TaskSettings;
title: string;
addAttachment(feature: Feature, attachment: AttachmentProperties | Attachment | File): Promise<Attachment>;
addFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
addFeatures(features: Iterable<Feature, any, any>, options?: FeatureWriteOptions): Promise<void>;
deleteAttachments(feature: Feature, attachments: (string | Attachment)[]): Promise<void>;
deleteFeature(id: string, options?: FeatureWriteOptions): Promise<void>;
deleteFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
deleteFeatures(ids: string[], options?: FeatureWriteOptions): Promise<void>;
deleteFeatures(features: Iterable<Feature, any, any>, options?: FeatureWriteOptions): Promise<void>;
destroy(): Promise<void>;
getAttachments(feature: Feature): Promise<Attachment[]>;
getFeature(id: string, options?: FeatureReadOptions): Promise<Feature>;
getFeatures(ids: string[], options?: FeatureReadOptions): AsyncIterable<Feature, any, any>;
getFullExtent(): Extent;
initialize(): Promise<void>;
toItemUri(): string;
updateFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
updateFeatures(features: Iterable<Feature, any, any>, options?: FeatureWriteOptions): Promise<void>;
}

#### Hierarchy (view full)

- Entity
- Initializable
  - FeatureSource

#### Implemented by

- FeatureSourceBase

#####
Index

### Properties

attachmentTypes?
capabilities
featureActions?
featureSettings
featureSourceActions?
hyperlinks
iconUrl?
id
isDestroyed
isInitialized
itemType
onAddFeature?
onEditFeature?
queryService?
relationships
schema
taskSettings
title

### Methods

addAttachment
addFeature
addFeatures
deleteAttachments
deleteFeature
deleteFeatures
destroy
getAttachments
getFeature
getFeatures
getFullExtent
initialize
toItemUri
updateFeature
updateFeatures

##
Properties

### `Optional` attachmentTypes

attachmentTypes?: string[]

A list of the valid file MIME types that can be uploaded as attachments.

### `Readonly` capabilities

capabilities: Capabilities

Capabilities of the feature source.

### `Optional` featureActions

featureActions?: Menu<MenuItemProperties, MenuProperties, MenuItem<MenuItemProperties, MenuProperties>>

A menu for actions specifically related to features from this source.

### `Readonly` featureSettings

featureSettings: FeatureSettings

Default settings that apply to features originating from this source.

### `Optional` featureSourceActions

featureSourceActions?: Menu<MenuItemProperties, MenuProperties, MenuItem<MenuItemProperties, MenuProperties>>

A menu for actions specifically related to this source.

### `Readonly` hyperlinks

hyperlinks: Collection<Hyperlink>

Hyperlinks associated with the feature source.

### `Optional` iconUrl

iconUrl?: string

URL to an icon that represents this feature source.

### `Readonly` id

id: string

The unique ID for this entity.

Inherited from Entity.id

### `Readonly` isDestroyed

isDestroyed: boolean

Indicates if the item has been destroyed. Once destroyed, it is not safe to invoke any other methods on the object.

Inherited from Initializable.isDestroyed

### `Readonly` isInitialized

isInitialized: boolean

Indicates if the item has been initialized.

Inherited from Initializable.isInitialized

### `Readonly` itemType

itemType: string

The item type for this entity when it participates in an App.

Inherited from Entity.itemType

### `Optional` onAddFeature

onAddFeature?: Action

The action to be executed when a feature is added.

### `Optional` onEditFeature

onEditFeature?: Action

The action to be executed when a feature is edited.

### `Optional` queryService

queryService?: QueryService

An optional query service that the feature source can use to get features.

### `Readonly` relationships

relationships: Collection<Relationship>

Relationships to other feature sources.

### `Readonly` schema

schema: Schema

Metadata about features originating from this source, such as fields, domains, and geometry type.

### `Readonly` taskSettings

taskSettings: TaskSettings

Settings that affect whether a feature source participates in various tasks that are performed on a map.

### `Readonly` title

title: string

A human readable title for the feature source.

##
Methods

### addAttachment

- addAttachment(feature, attachment): Promise<Attachment>

- Adds an attachment to a feature.

  #### Parameters

  - feature: Feature

    The feature to add the attachment to.

  - attachment: AttachmentProperties | Attachment | File

    The attachment to add to the feature.

  #### Returns Promise<Attachment>

### addFeature

- addFeature(feature, options?): Promise<void>

- Adds a new feature to the source. If the source does not support adding features, then an InvalidOperationError will be thrown (see capabilities).

  #### Parameters

  - feature: Feature

    The feature to add.

  - `Optional` options: FeatureWriteOptions

    Additional options that control how the feature is saved.

  #### Returns Promise<void>

### addFeatures

- addFeatures(features, options?): Promise<void>

- Adds a set of features to the source. If the source does not support adding features, then an InvalidOperationError will be thrown (see capabilities).

  #### Parameters

  - features: Iterable<Feature, any, any>

    The features to add.

  - `Optional` options: FeatureWriteOptions

    Additional options that control how the features are saved.

  #### Returns Promise<void>

### deleteAttachments

- deleteAttachments(feature, attachments): Promise<void>

- Deletes attachments from a feature.

  #### Parameters

  - feature: Feature

    The feature to delete attachments from.

  - attachments: (string | Attachment)[]

    The attachments or the IDs of the attachments to delete from the feature.

  #### Returns Promise<void>

### deleteFeature

- deleteFeature(id, options?): Promise<void>

- Deletes a feature from its source. If the source does not support deleting features, then an InvalidOperationError will be thrown (see capabilities).

  #### Parameters

  - id: string

    The ID of the feature to delete.

  - `Optional` options: FeatureWriteOptions

    Additional options that control how the features are deleted.

  #### Returns Promise<void>

- deleteFeature(feature, options?): Promise<void>

- Deletes a feature from its source. If the source does not support deleting features, then an InvalidOperationError will be thrown (see capabilities).

  #### Parameters

  - feature: Feature

    The feature to delete.

  - `Optional` options: FeatureWriteOptions

    Additional options that control how the features are deleted.

  #### Returns Promise<void>

### deleteFeatures

- deleteFeatures(ids, options?): Promise<void>

- Deletes features from their source. If the source does not support deleting features, then an InvalidOperationError will be thrown (see capabilities).

  #### Parameters

  - ids: string[]

    The IDs of the features to delete.

  - `Optional` options: FeatureWriteOptions

    Additional options that control how the features are deleted.

  #### Returns Promise<void>

- deleteFeatures(features, options?): Promise<void>

- Deletes features from their source. If the source does not support deleting features, then an InvalidOperationError will be thrown (see capabilities).

  #### Parameters

  - features: Iterable<Feature, any, any>

    The features to delete.

  - `Optional` options: FeatureWriteOptions

    Additional options that control how the features are deleted.

  #### Returns Promise<void>

### destroy

- destroy(): Promise<void>

- A clean-up function that should get called whenever the item is disposed of.

  #### Returns Promise<void>

  Inherited from Initializable.destroy

### getAttachments

- getAttachments(feature): Promise<Attachment[]>

- Gets any attachments associated with a feature.

  #### Parameters

  - feature: Feature

    The feature to get attachments for.

  #### Returns Promise<Attachment[]>

### getFeature

- getFeature(id, options?): Promise<Feature>

- Gets a feature by ID. If no such feature exists, the promise is rejected with an instance of NotFoundError.

  #### Parameters

  - id: string

    The ID of the feature to retrieve.

  - `Optional` options: FeatureReadOptions

    Additional options that control how the feature is retrieved.

  #### Returns Promise<Feature>

### getFeatures

- getFeatures(ids, options?): AsyncIterable<Feature, any, any>

- Gets a set of features by their IDs.

  #### Parameters

  - ids: string[]

    The IDs of the features to retrieve.

  - `Optional` options: FeatureReadOptions

    Additional Options that control how the features are retrieved.

  #### Returns AsyncIterable<Feature, any, any>

### getFullExtent

- getFullExtent(): Extent

- Returns the full extent of the source that contains all included features.

  #### Returns Extent

### initialize

- initialize(): Promise<void>

- Initializes the item.

  #### Returns Promise<void>

  Inherited from Initializable.initialize

### toItemUri

- toItemUri(): string

- Creates an item:// URI reference to this entity.

  #### Returns string

  Inherited from Entity.toItemUri

### updateFeature

- updateFeature(feature, options?): Promise<void>

- Saves changes to an existing feature. If the source does not support updating features, then an InvalidOperationError will be thrown (see capabilities).

  #### Parameters

  - feature: Feature

    The feature to update.

  - `Optional` options: FeatureWriteOptions

    Additional options that control how the feature is saved.

  #### Returns Promise<void>

### updateFeatures

- updateFeatures(features, options?): Promise<void>

- Saves changes to a existing features. If the source does not support updating features, then an InvalidOperationError will be thrown (see capabilities).

  #### Parameters

  - features: Iterable<Feature, any, any>

    The features to update.

  - `Optional` options: FeatureWriteOptions

    Additional options that control how the features are saved.

  #### Returns Promise<void>