@honua/sdk-js
    Preparing search index...

    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 = Record<string, unknown>> {
        attachments: AttachmentApi;
        capabilities: Capabilities;
        descriptor: SourceDescriptor;
        adapter<K extends AdapterKind>(kind: K): AdapterFor<K> | undefined;
        applyEdits(envelope: EditEnvelope<T>): Promise<EditResult>;
        protocol<K extends AdapterKind>(kind: K): AdapterFor<K> | undefined;
        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: HonuaExtent | null }>;
        queryObjectIds(request?: Query<T>): Promise<readonly FeatureId[]>;
        queryRelated<R = Record<string, unknown>>(
            request: RelatedQuery,
        ): Promise<RelatedResult<R>>;
        stream(request?: Query<T>): AsyncGenerator<Result<T>, void, undefined>;
    }

    Type Parameters

    • T = Record<string, unknown>

    Hierarchy (View Summary)

    Index

    Properties

    attachments: AttachmentApi

    Attachment operations namespace; methods throw if attachments is missing.

    capabilities: Capabilities
    descriptor: SourceDescriptor

    Methods