import { FeatureLayerJSON, IItem } from '../../types'; /** * Fetches the layers and tables from a given feature service item. * * Attempts to retrieve the feature service layers and tables using the provided authentication token. * If an 'Invalid token' error is encountered, it retries the request without the token. * * @param item - The feature service item to fetch layers and tables from. * @param token - The authentication token to use for the request. * @param bypassCache - Optional flag to bypass any caching mechanisms. Defaults to false. * @returns A promise that resolves to an array of `FeatureLayerJSON` objects representing the layers and tables. * @throws Will throw an error if fetching fails, including after retrying without a token. */ export declare const fetchFeatureServiceLayersAndTables: (item: IItem, token: string, bypassCache?: boolean) => Promise; type FetchFeatureServiceLayersAndTablesParams = { /** * The item representing the feature service to fetch layers and tables from. */ item: IItem; /** * The token for authentication when fetching the feature service layers and tables. * This is required to access secured services, but if an 'Invalid token' error is encountered, the function will automatically retry without the token. */ token: string; /** * Optional flag to bypass any caching mechanisms. Defaults to false. If true, a query timestamp is added to the request to bypass any cached responses. */ bypassCache?: boolean; /** * Optional maximum number of retries if fetching fails. Defaults to 3. */ maxRetries?: number; /** * Optional delay in milliseconds between retry attempts. Defaults to 1000ms (1 second). The delay increases with each attempt (e.g., 1s, 2s, 3s) to provide a simple backoff mechanism. */ retryDelay?: number; }; /** * Helper function that implements retry logic for fetching feature service layers and tables. * It will attempt to fetch the layers and tables, and if it encounters error, it will retry without the token. * If it fails for any reason, it will retry up to a specified number of attempts with a delay between each attempt. * @param params - The parameters for fetching feature service layers and tables, including the item, token, bypassCache flag, maxRetries, and retryDelay. * @param params.item - The item representing the feature service to fetch layers and tables from. * @param params.token - The token for authentication when fetching the feature service layers and tables. * @param params.bypassCache - Optional flag to bypass any caching mechanisms. Defaults to false. If true, a query timestamp is added to the request to bypass any cached responses. * @param params.maxRetries - Optional maximum number of retries if fetching fails. Defaults to 3. * @param params.retryDelay - Optional delay in milliseconds between retry attempts. Defaults to 1000ms (1 second). The delay increases with each attempt (e.g., 1s, 2s, 3s) to provide a simple backoff mechanism. * @returns */ export declare const fetchFeatureServiceLayersAndTablesWithRetries: ({ item, token, bypassCache, maxRetries, retryDelay, }: FetchFeatureServiceLayersAndTablesParams) => Promise; export {};