Interface Source<T>

Protocol-neutral data-source handle. Adapters returned by Dataset.source() implement this interface directly; the existing HonuaFeatureLayer, HonuaMapService, and HonuaOgcFeatureCollection classes are reachable through the typed protocol() escape hatch (alias adapter()).

The canonical surface covers the query family plus edit / related / attachment operations. Operations that are protocol-specific (raw where, raw outFields, GeoServices calculate / validateSQL / replica etc.) live behind protocol() so the top-level API stays free of ArcGIS-typed structures.

const parcels = dataset.source<{ NAME: string }>("parcels")!;
const result = await parcels.queryAll({ where: "STATUS = 'ACTIVE'" });
for await (const page of parcels.stream({ where: "1=1" })) {
console.log(page.features.length);
}
const fs = parcels.protocol("geoservices-feature-service");
await fs?.calculate({ where: "1=1", calcExpression: { field: "AREA", sqlExpression: "ST_Area(SHAPE)" } });
interface Source<T> {
    attachments: AttachmentApi;
    capabilities: Capabilities;
    descriptor: SourceDescriptor;
    adapter<K>(kind: K): undefined | AdapterFor<K>;
    applyEdits(envelope: EditEnvelope<T>): Promise<EditResult>;
    protocol<K>(kind: K): undefined | AdapterFor<K>;
    query(request?: Query<T>): Promise<Result<T>>;
    queryAggregate(request: Query<T> & {
        aggregation: AggregationSpec;
    }): Promise<Result<T>>;
    queryAll(request?: Query<T>): Promise<Result<T>>;
    queryExtent(request?: Query<T>): Promise<{
        count?: number;
        extent: null | HonuaExtent;
    }>;
    queryObjectIds(request?: Query<T>): Promise<readonly FeatureId[]>;
    queryRelated<R>(request: RelatedQuery): Promise<RelatedResult<R>>;
    stream(request?: Query<T>): AsyncGenerator<Result<T>, void, undefined>;
}

Type Parameters

  • T = Record<string, unknown>

Hierarchy (view full)

Properties

attachments: AttachmentApi

Attachment operations namespace; methods throw if attachments is missing.

capabilities: Capabilities
descriptor: SourceDescriptor

Methods

  • Typed escape hatch to the underlying protocol-specific class. Use this when a caller needs raw protocol semantics (e.g. raw where, raw outFields, GeoServices calculate / validateSQL / replica / queryBins / getEstimates) that the canonical surface intentionally does not expose.

    Type Parameters

    Parameters

    • kind: K

    Returns undefined | AdapterFor<K>