UNPKG

@vertigis/viewer-spec

Version:

VertiGIS Viewer Specification

106 lines (105 loc) 3.37 kB
import type { FeatureSource } from "@vertigis/arcgis-extensions/data/FeatureSource.js"; import type { Command } from "../Command.js"; import { CommandRegistry } from "../CommandRegistry.js"; import type { Operation } from "../Operation.js"; import { OperationRegistry } from "../OperationRegistry.js"; import type { GeometryLike, GraphicsLike, LayersLike, ModelRef } from "../common.js"; /** * A query that can be displayed in the query builder, or executed using the * `tasks.query` operation. */ export interface Query { /** * The feature source to query. One of `source` or `layers` is required. */ source?: FeatureSource; /** * Alias of `source`, to facilitate command chaining. If multiple layers are * present, only the first will be used as the source. One of `source` or * `layers` is required. */ layers?: LayersLike; /** * The where clause to query by. */ where?: string; /** * If specified, limits the results to ones that intersect the given * geometry. If both `geometry` and `graphics` are specified, only * `graphics` will be used. */ geometry?: GeometryLike; /** * Alias of `geometry`, to facilitate command chaining. If both `geometry` * and `graphics` are specified, only `graphics` will be used. */ graphics?: GraphicsLike; } /** * Base arguments for commands/operations that target query builder components. */ export interface QueryBuilderArgsBase { /** * The query builder component that will be targeted. If not specified, all * active query builder components in the layout will be targeted. */ queryBuilder?: ModelRef; } /** * Arguments for the "query-builder.set-query" command. */ export interface SetQueryArgs extends QueryBuilderArgsBase, Query { } export declare class QueryBuilderCommands extends CommandRegistry { protected readonly _prefix = "query-builder"; /** * Sets the current query criteria in the query builder and also activates * the component. Web only. * * **Example:** Query within an extent, selecting the layer to query by * title. * * ``` * { * "geometry": { * "xmin": 13871520.850500003, * "ymin": 3910293.086000003, * "xmax": 14574034.873400003, * "ymax": 4686306.161399998, * "spatialReference": { * "wkid": 102100, * "latestWkid": 3857 * } * }, * "layers": { * "title": "Buildings" * }, * "where": "FULL_ADDR = '900 GOVERNMENT ST'" * } * ``` * * @webOnly */ get displayQuery(): Command<SetQueryArgs>; /** * Sets the current query criteria in the query builder. Web only. * * @webOnly */ get setQuery(): Command<SetQueryArgs>; } /** * Arguments for the "query-builder.get-query" operation. */ export interface GetQueryArgs extends Required<QueryBuilderArgsBase> { } export declare class QueryBuilderOperations extends OperationRegistry { protected readonly _prefix = "query-builder"; /** * Gets the currently visible query from the specified query builder * component. Web only. * * @webOnly */ get getQuery(): Operation<GetQueryArgs, Query | undefined>; }