/* CorejamCoreComponents custom elements bundle */

import type { Components, JSX } from "../types/components";

interface CorejamBaseLink extends Components.CorejamBaseLink, HTMLElement {}
export const CorejamBaseLink: {
  prototype: CorejamBaseLink;
  new (): CorejamBaseLink;
};

interface CorejamBox extends Components.CorejamBox, HTMLElement {}
export const CorejamBox: {
  prototype: CorejamBox;
  new (): CorejamBox;
};

interface CorejamButton extends Components.CorejamButton, HTMLElement {}
export const CorejamButton: {
  prototype: CorejamButton;
  new (): CorejamButton;
};

interface CorejamDataFetcher extends Components.CorejamDataFetcher, HTMLElement {}
export const CorejamDataFetcher: {
  prototype: CorejamDataFetcher;
  new (): CorejamDataFetcher;
};

interface CorejamDataProvider extends Components.CorejamDataProvider, HTMLElement {}
export const CorejamDataProvider: {
  prototype: CorejamDataProvider;
  new (): CorejamDataProvider;
};

interface CorejamFlash extends Components.CorejamFlash, HTMLElement {}
export const CorejamFlash: {
  prototype: CorejamFlash;
  new (): CorejamFlash;
};

interface CorejamFormContainer extends Components.CorejamFormContainer, HTMLElement {}
export const CorejamFormContainer: {
  prototype: CorejamFormContainer;
  new (): CorejamFormContainer;
};

interface CorejamFormInput extends Components.CorejamFormInput, HTMLElement {}
export const CorejamFormInput: {
  prototype: CorejamFormInput;
  new (): CorejamFormInput;
};

interface CorejamFormSelect extends Components.CorejamFormSelect, HTMLElement {}
export const CorejamFormSelect: {
  prototype: CorejamFormSelect;
  new (): CorejamFormSelect;
};

interface CorejamFormSubmit extends Components.CorejamFormSubmit, HTMLElement {}
export const CorejamFormSubmit: {
  prototype: CorejamFormSubmit;
  new (): CorejamFormSubmit;
};

interface CorejamGrid extends Components.CorejamGrid, HTMLElement {}
export const CorejamGrid: {
  prototype: CorejamGrid;
  new (): CorejamGrid;
};

interface CorejamImage extends Components.CorejamImage, HTMLElement {}
export const CorejamImage: {
  prototype: CorejamImage;
  new (): CorejamImage;
};

interface CorejamInit extends Components.CorejamInit, HTMLElement {}
export const CorejamInit: {
  prototype: CorejamInit;
  new (): CorejamInit;
};

interface CorejamModal extends Components.CorejamModal, HTMLElement {}
export const CorejamModal: {
  prototype: CorejamModal;
  new (): CorejamModal;
};

interface CorejamPagination extends Components.CorejamPagination, HTMLElement {}
export const CorejamPagination: {
  prototype: CorejamPagination;
  new (): CorejamPagination;
};

interface CorejamType extends Components.CorejamType, HTMLElement {}
export const CorejamType: {
  prototype: CorejamType;
  new (): CorejamType;
};

interface CorejamUiBase extends Components.CorejamUiBase, HTMLElement {}
export const CorejamUiBase: {
  prototype: CorejamUiBase;
  new (): CorejamUiBase;
};

interface CorejamUiTheme extends Components.CorejamUiTheme, HTMLElement {}
export const CorejamUiTheme: {
  prototype: CorejamUiTheme;
  new (): CorejamUiTheme;
};

/**
 * Utility to define all custom elements within this package using the tag name provided in the component's source. 
 * When defining each custom element, it will also check it's safe to define by:
 *
 * 1. Ensuring the "customElements" registry is available in the global context (window).
 * 2. The component tag name is not already defined.
 *
 * Use the standard [customElements.define()](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define) 
 * method instead to define custom elements individually, or to provide a different tag name.
 */
export declare const defineCustomElements: (opts?: any) => void;

/**
 * Used to manually set the base path where assets can be found.
 * If the script is used as "module", it's recommended to use "import.meta.url",
 * such as "setAssetPath(import.meta.url)". Other options include
 * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
 * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
 * But do note that this configuration depends on how your script is bundled, or lack of
 * bunding, and where your assets can be loaded from. Additionally custom bundling
 * will have to ensure the static assets are copied to its build directory.
 */
export declare const setAssetPath: (path: string) => void;

export interface SetPlatformOptions {
  raf?: (c: FrameRequestCallback) => number;
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
  ce?: (eventName: string, opts?: any) => CustomEvent;
}
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;

export type { Components, JSX };

export * from '../types';
