import type DisplayFilterInfo from "../support/DisplayFilterInfo.js";
import type { DisplayFilterInfoProperties } from "../support/DisplayFilterInfo.js";

export interface DisplayFilteredLayerProperties extends Partial<Pick<DisplayFilteredLayer, "displayFilterEnabled">> {
  /**
   * Information related to a display filter associated with a layer. Display filters control which features are visible on the map. They allow you to display a subset of features while retaining access to all features
   * for querying and analysis. Unlike [FeatureLayer#definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression), which filters data at the source level, display filters only affect visibility on the map.
   * Therefore display filters should be ignored when querying data to present to users.
   * Display filters can be disabled for all layers in the map by setting the view's [View#displayFilterEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#displayFilterEnabled) property to `false`.
   *
   * > [!WARNING]
   * >
   * > **Notes:**
   * > To optimize memory usage for rendering, display filters may be appended to the layer's [FeatureLayer#definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) when querying the service.
   * > As a result, the filtered features may not be available on the client for executing layer view [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures).
   * > To determine if all features are available in the view, check the layer view's [FeatureLayerView#hasAllFeaturesInView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#hasAllFeaturesInView)
   * > property when layer view's [FeatureLayerView#dataUpdating](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#dataUpdating) is `false`. If `false`, the layer view does not have all features in the view
   * > and you should query the layer instead.
   *
   * @since 4.32
   * @see [DisplayFilterInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DisplayFilterInfo.html)
   * @see [DisplayFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DisplayFilter.html)
   * @see [View#displayFilterEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#displayFilterEnabled)
   * @see [displayFilterInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-DisplayFilteredLayer.html#displayFilterEnabled)
   * @see [Sample - Scale-dependent DisplayFilter](https://developers.arcgis.com/javascript/latest/sample-code/display-filter/)
   * @example
   * // set a scale-dependent display filter on a layer
   * const layer = new FeatureLayer({
   *   portalItem: {
   *     id: "28dbd58ad90e4a47ab0e0334d2b69427"
   *   },
   *   minScale: 0,
   *   maxScale: 0,
   *   outFields: ["*"],
   *   // set scale-dependent display filters to declutter the display at different scales.
   *   // Show more streams as user zooms in and less as user zooms out.
   *   displayFilterInfo: new DisplayFilterInfo({
   *     mode: "scale",
   *     filters: [
   *       {
   *         title: "streamOrder >= 8",
   *         minScale: 0,
   *         maxScale: 18_489_297.737236,
   *         where: "streamOrder >= 8"
   *       },
   *       {
   *         title: "streamOrder >= 6",
   *         minScale: 18_489_297.737236
   *         maxScale: 9_244_648.868618,
   *         where: "streamOrder >= 6"
   *       },
   *       {
   *         title: "streamOrder >= 4",
   *         minScale: 9_244_648.868618,
   *         maxScale: 577790.5542885
   *         where: "streamOrder >= 4"
   *       },
   *       {
   *         title: "all",
   *         minScale: 577790.5542885,
   *         maxScale: 0
   *       }
   *     ]
   *   })
   * });
   */
  displayFilterInfo?: DisplayFilterInfoProperties | null;
}

/**
 * DisplayFilteredLayer is a mixin that adds [displayFilterEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-DisplayFilteredLayer.html#displayFilterEnabled) and [displayFilterInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-DisplayFilteredLayer.html#displayFilterInfo)
 * properties to a layer.
 *
 * @since 4.32
 */
export abstract class DisplayFilteredLayer {
  constructor(...args: any[]);
  /**
   * Indicates whether the layer's [displayFilterInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-DisplayFilteredLayer.html#displayFilterInfo) is applied when rendering the layer in the view.
   * If `false`, the layer's display filter is ignored and all features are rendered without filtering.
   * To ignore display filters across all layers in the view, set the view's [View#displayFilterEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#displayFilterEnabled)
   * property to `false`.
   *
   * @default true
   * @since 4.32
   */
  accessor displayFilterEnabled: boolean;
  /**
   * Information related to a display filter associated with a layer. Display filters control which features are visible on the map. They allow you to display a subset of features while retaining access to all features
   * for querying and analysis. Unlike [FeatureLayer#definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression), which filters data at the source level, display filters only affect visibility on the map.
   * Therefore display filters should be ignored when querying data to present to users.
   * Display filters can be disabled for all layers in the map by setting the view's [View#displayFilterEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#displayFilterEnabled) property to `false`.
   *
   * > [!WARNING]
   * >
   * > **Notes:**
   * > To optimize memory usage for rendering, display filters may be appended to the layer's [FeatureLayer#definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) when querying the service.
   * > As a result, the filtered features may not be available on the client for executing layer view [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures).
   * > To determine if all features are available in the view, check the layer view's [FeatureLayerView#hasAllFeaturesInView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#hasAllFeaturesInView)
   * > property when layer view's [FeatureLayerView#dataUpdating](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#dataUpdating) is `false`. If `false`, the layer view does not have all features in the view
   * > and you should query the layer instead.
   *
   * @since 4.32
   * @see [DisplayFilterInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DisplayFilterInfo.html)
   * @see [DisplayFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DisplayFilter.html)
   * @see [View#displayFilterEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#displayFilterEnabled)
   * @see [displayFilterInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-DisplayFilteredLayer.html#displayFilterEnabled)
   * @see [Sample - Scale-dependent DisplayFilter](https://developers.arcgis.com/javascript/latest/sample-code/display-filter/)
   * @example
   * // set a scale-dependent display filter on a layer
   * const layer = new FeatureLayer({
   *   portalItem: {
   *     id: "28dbd58ad90e4a47ab0e0334d2b69427"
   *   },
   *   minScale: 0,
   *   maxScale: 0,
   *   outFields: ["*"],
   *   // set scale-dependent display filters to declutter the display at different scales.
   *   // Show more streams as user zooms in and less as user zooms out.
   *   displayFilterInfo: new DisplayFilterInfo({
   *     mode: "scale",
   *     filters: [
   *       {
   *         title: "streamOrder >= 8",
   *         minScale: 0,
   *         maxScale: 18_489_297.737236,
   *         where: "streamOrder >= 8"
   *       },
   *       {
   *         title: "streamOrder >= 6",
   *         minScale: 18_489_297.737236
   *         maxScale: 9_244_648.868618,
   *         where: "streamOrder >= 6"
   *       },
   *       {
   *         title: "streamOrder >= 4",
   *         minScale: 9_244_648.868618,
   *         maxScale: 577790.5542885
   *         where: "streamOrder >= 4"
   *       },
   *       {
   *         title: "all",
   *         minScale: 577790.5542885,
   *         maxScale: 0
   *       }
   *     ]
   *   })
   * });
   */
  get displayFilterInfo(): DisplayFilterInfo | null | undefined;
  set displayFilterInfo(value: DisplayFilterInfoProperties | null | undefined);
}