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. Protocol-specific operations (GeoServices calculate / validateSQL / replica, for example) live behind protocol() so the top-level API stays free of ArcGIS-typed structures. The deprecated Query.where member is a source-native migration exception; it is not a protocol-neutral filter.

const parcels = dataset.source<{ NAME: string }>("parcels")!;
const result = await parcels.queryAll({ pagination: { limit: 500 } });
for await (const page of parcels.stream({ pagination: { limit: 100 } })) {
console.log(page.features.length);
}
const fs = parcels.protocol("geoservices-feature-service");
// `where` is raw GeoServices SQL on this protocol-specific escape hatch.
await fs?.calculate({ where: "1=1", calcExpression: { field: "AREA", sqlExpression: "ST_Area(SHAPE)" } });
interface Source<T> {
    attachments: AttachmentApi;
    capabilities: Capabilities;
    descriptor: SourceDescriptor<Protocol>;
    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

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>