@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
76 lines (72 loc) • 3.74 kB
TypeScript
import type { ClonableMixin } from "../../core/Clonable.js";
import type { JSONSupport } from "../../core/JSONSupport.js";
export interface RelationshipProperties extends Partial<Pick<Relationship, "cardinality" | "catalogId" | "composite" | "id" | "keyField" | "keyFieldInRelationshipTable" | "name" | "relatedTableId" | "relationshipTableId" | "role">> {}
/** @since 5.0 */
export type Cardinality = "one-to-one" | "one-to-many" | "many-to-many";
/** @since 5.0 */
export type Role = "origin" | "destination";
/**
* Describes a [layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) relationship with another layer or table.
* These relationships are listed in the ArcGIS Services directory as described
* in the [REST API documentation](https://developers.arcgis.com/rest/services-reference/layer-table.htm).
*
* @since 4.7
* @see [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/)
* @see [ArcGIS REST API - Layer (Feature Service)](https://developers.arcgis.com/rest/services-reference/layer-feature-service-.htm)
*/
export default class Relationship extends RelationshipSuperclass {
constructor(properties?: RelationshipProperties);
/**
* The cardinality which specifies the number of objects in the origin
* [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) related to the
* number of objects in the destination [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/).
* Please see the [Desktop help](https://desktop.arcgis.com/en/arcmap/10.3/manage-data/relationships/relationship-class-properties.htm#GUID-989CB1D1-AC51-4A4C-8D9D-0AB9E647FFFD)
* for additional information on cardinality.
*/
accessor cardinality: Cardinality;
/**
* The globally unique identifier for the relationship. This property is only available on non-hosted feature services (referencing Enterprise geodatabases).
*
* @since 4.32
*/
accessor catalogId: string | null | undefined;
/**
* Indicates whether the relationship is composite. In a composite relationship, a destination
* object cannot exist independently of its origin object.
*
* @since 4.16
*/
accessor composite: boolean;
/**
* The unique ID for the relationship. These ids for the relationships
* the [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) participates
* in are listed in the ArcGIS Services directory.
*/
accessor id: number;
/** The field used to establish the relate within the [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/). */
accessor keyField: string;
/**
* The key field in an attributed relationship class table that matches the [keyField](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Relationship/#keyField).
* This is returned only for attributed relationships.
*
* @since 4.16
*/
accessor keyFieldInRelationshipTable: string;
/** The name of the relationship. */
accessor name: string | null | undefined;
/** The unique ID of the related [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/). */
accessor relatedTableId: number;
/**
* The relationship table id.
*
* @since 4.16
*/
accessor relationshipTableId: number;
/**
* Indicates whether the table participating in the relationship is the `origin` or `destination` table.
*
* @since 4.16
*/
accessor role: Role;
}
declare const RelationshipSuperclass: typeof JSONSupport & typeof ClonableMixin