import type { Entity, EntityBaseProperties } from "../Entity.js";
import type { Serializable } from "../support/Serializable.js";
import type { Feature, FetchRelatedFeaturesOptions } from "./Feature.js";
import type { FeatureSet } from "./FeatureSet.js";
import type { FeatureSource } from "./FeatureSource.js";
import type { FeatureStream } from "./FeatureStream.js";
import type { RelationshipFactory } from "./support/RelationshipFactory.js";
/**
 * Properties that can be used to initialize a
 * {@link data/_Relationship!Relationship}.
 */
export interface RelationshipProperties extends EntityBaseProperties {
    /**
     * See {@link data/_Relationship!Relationship.title}.
     */
    title?: string;
    /**
     * The Relationship's type.
     */
    $relationshipType?: RelationshipType;
}
/**
 * Describes a relationship between a {@link data/FeatureSource!FeatureSource}
 * and another source.
 */
export interface Relationship extends Entity, Serializable<RelationshipProperties> {
    /**
     * The human-readable name for the relationship.
     */
    title: string;
    /**
     * The feature source that owns this relationship.
     */
    readonly source: FeatureSource;
    /**
     * The feature source with related data, if available.
     */
    readonly relatedSource: FeatureSource;
    /**
     * The cardinality of the relationship.
     */
    readonly cardinality: Cardinality;
    /**
     * The type of relationship.
     */
    readonly relationshipType: RelationshipType;
    /**
     * Gets features that are related to the given feature.
     */
    getRelatedFeatures(feature: Feature, options?: FetchRelatedFeaturesOptions): Promise<FeatureSet>;
    /**
     * Gets features that are related to the each of the given features.
     */
    getAllRelatedFeatures(features: Feature[] | FeatureSet | FeatureStream): Promise<Map<Feature, FeatureSet>>;
}
export declare namespace Relationship {
    /**
     * A custom factory for creating new {@link data/_Relationship!Relationship}
     * instances. If none is defined, a default factory will be used.
     */
    let factory: RelationshipFactory;
    /**
     * Creates the appropriate implementation of
     * {@link data/_Relationship!Relationship} based on the given properties.
     *
     * @param properties The relationship properties.
     */
    function create(properties: RelationshipProperties): Relationship;
}
/**
 * The cardinality of the Relationship.
 */
export type Cardinality = "one-to-one" | "one-to-many" | "many-to-one" | "many-to-many";
/**
 * Converts Geodatabase Relationship Cardinality type to the ESRI JS API
 * Cardinality type.
 *
 * @param type The Geodatabase Relationship Cardinality type.
 */
export declare function toEsriApiCardinality(type: string): Cardinality;
/**
 * Converts ESRI JS API Relationship Cardinality type to the Geodatabase
 * Cardinality type.
 *
 * @param type The ESRI JS API Relationship Cardinality type.
 */
export declare function fromEsriApiCardinality(type: string): GeodatabaseCardinality;
/**
 * Relationship cardinality type values for Geodatabase tables.
 */
export type GeodatabaseCardinality = "esriRelCardinalityOneToOne" | "esriRelCardinalityOneToMany" | "esriRelCardinalityManyToOne" | "esriRelCardinalityManyToMany";
/**
 * The type of the Relationship.
 */
export type RelationshipType = "QueryBasedRelationship" | "ArcGISRelationship" | string;
