import { SHUTTLE_CONTAINERS } from "../components/Shuttle/globals";

/**
 * A contrived implementation of classNames. This allows
 * react-accessible-shuttle to have zero dependencies.
 */
declare export function classNames(...args: any[]): string;

/**
 * Small warn wrapper.
 * @see https://github.com/i18next/react-i18next/blob/master/src/utils.js
 */
declare export function warn(...args: string[]): void;

/**
 * Warn about issues only once.
 * @see https://github.com/i18next/react-i18next/blob/master/src/utils.js
 */
declare export function warnOnce(...args: string[]): void;

/**
 * Converts the source array to a Set.
 * Needed because IE 11 fails with `new Set([1,2,3])`.
 */
declare export function toSet<T>(source: T[]): Set<T>;

/**
 * Gets the index of the HTMLElement. As an escape hatch, if `data-index` was not passed
 * to the Shuttle.Item we will look through the list to find the item we want.
 */
declare export var getIndexFromItem: (target: HTMLDivElement) => number;
/**
 * Gets the shuttle item from the DOM since consumers can render whatever
 * they want inside the item itself, we might need to look up the DOM tree
 * to get the HTMLElement.
 */
declare export var getShuttleItem: (e: HTMLElement) => HTMLDivElement | null;
declare export var removeDisabledIndexes: (
  collection: HTMLCollection,
  indexes: number[]
) => number[];
/**
 * Gets relevant metadata from the container including
 * if the container is the source or target and the name
 * of the container.
 */
declare export var getContainerMetadata: (
  container: Element
) => {
  source: boolean,
  containerName: SHUTTLE_CONTAINERS,
  ...
};
declare export var isContainer: (container: HTMLDivElement) => boolean;
/**
 * @see https://github.com/then/is-promise/blob/master/index.js
 */
declare export function isPromise(obj: any): boolean;
