import type Basemap from "../Basemap.js"; import type BasemapItem from "./support/BasemapItem.js"; import type { AbortOptions } from "../core/promiseUtils.js"; /** * This function is used by the [PortalBasemapsSource.filterFunction](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/PortalBasemapsSource/#filterFunction) property to filter * basemaps after they are fetched from the Portal. * * _Support for asynchronous filter functions was added at version 4.27._ * * @param item - The current Basemap item being assessed in the array. * @param index - The index of the Basemap being assessed. * @param array - The array of basemaps being filtered. * @returns Returns true if the test passes, false otherwise. * @since 5.2 */ export type BasemapFilter = (item: Basemap, index: number, array: Basemap[]) => boolean | Promise; /** * This function is used by the [PortalBasemapsSource.updateBasemapsCallback](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/PortalBasemapsSource/#updateBasemapsCallback) property for * updating basemaps after being fetched and filtered. * * _Support for asynchronous update functions was added at version 4.29._ * * @param items - An array of basemaps that have been fetched and filtered from the Portal. * @returns The array of basemaps to display in the BasemapGallery. * @since 5.2 */ export type UpdateBasemapsCallback = (items: Basemap[]) => Basemap[] | Promise; /** @since 5.2 */ export type BasemapsSourceState = "ready" | "loading" | "not-loaded"; /** * Determines whether a basemap is compatible with a view. * * @param item - The basemap gallery item to check. * @param options - Options for aborting the compatibility check. * @returns A promise that resolves when the basemap is compatible. * @since 5.2 */ export type BasemapCompatibilityFunction = (item: BasemapItem, options?: AbortOptions) => Promise;