import type { Feature, FetchRelatedFeaturesOptions } from "../../data/Feature.js";
import type { FeatureSet } from "../../data/FeatureSet.js";
import type { FeatureSource } from "../../data/FeatureSource.js";
import { RelationshipBase } from "../../data/RelationshipBase.js";
import type { Cardinality, RelationshipProperties, RelationshipType } from "../../data/_Relationship.js";
import type { PropertyDefs } from "../../support/Serializable.js";
import { QueryService } from "./QueryService.js";
/**
 * Properties that can be passed into the constructor for
 * {@link tasks/query/QueryBasedRelationship!QueryBasedRelationship}.
 */
export interface QueryBasedRelationshipProperties extends RelationshipProperties {
    /**
     * See
     * {@link tasks/query/QueryBasedRelationship!QueryBasedRelationship.keyField}.
     */
    keyField: string;
    /**
     * See
     * {@link tasks/query/QueryBasedRelationship!QueryBasedRelationship.relatedKeyField}.
     */
    relatedKeyField: string;
    /**
     * See
     * {@link tasks/query/QueryBasedRelationship!QueryBasedRelationship.cardinality}.
     */
    cardinality?: Cardinality;
    /**
     * See
     * {@link tasks/query/QueryBasedRelationship!QueryBasedRelationship.relatedSource}.
     */
    relatedSource: FeatureSource;
    /**
     * See
     * {@link tasks/query/QueryBasedRelationship!QueryBasedRelationship.queryService}.
     */
    queryService?: QueryService;
    /**
     * See {@link data/_Relationship!RelationshipProperties.$relationshipType}.
     */
    $relationshipType?: RelationshipType;
}
/**
 * A {@link data/_Relationship!Relationship} that works by querying the related
 * source for features.
 */
export declare class QueryBasedRelationship<TProperties extends QueryBasedRelationshipProperties = QueryBasedRelationshipProperties> extends RelationshipBase<TProperties> {
    /**
     * @inheritDoc
     */
    readonly relatedSource: FeatureSource;
    /**
     * @inheritDoc
     */
    readonly cardinality: Cardinality;
    /**
     * The key field in the source.
     */
    readonly keyField: string;
    /**
     * The key field in the related source.
     */
    readonly relatedKeyField: string;
    /**
     * @inheritDoc
     */
    readonly relationshipType: RelationshipType;
    /**
     * The {@link tasks/query/QueryService!QueryService} to use for fetching
     * related features. The service must be configured with a provider that can
     * handle the related source.
     */
    queryService: QueryService;
    constructor(properties: TProperties);
    protected _getSerializableProperties(): PropertyDefs<TProperties>;
    /**
     * @inheritDoc
     */
    protected _getRelatedFeatures(feature: Feature, options?: FetchRelatedFeaturesOptions): Promise<FeatureSet>;
    /**
     * @inheritDoc
     */
    protected _getAllRelatedFeatures(features: Feature[], options?: FetchRelatedFeaturesOptions): Promise<Map<Feature, FeatureSet>>;
}
