
import type { buttonStyle, RuleViewInfoMap, getAssetTypeFromQuery, getAssetIdsFromQuery, getAssetTypes, getAssetInfos, getAssetsByType, OrRulesRuleChangedEvent, OrRulesRuleUnsupportedEvent, OrRulesRequestSelectionEvent, OrRulesSelectionEvent, OrRulesRequestAddEvent, OrRulesRequestGroupEvent, OrRulesAddEvent, OrRulesRequestDeleteEvent, OrRulesRequestSaveEvent, OrRulesSaveEvent, OrRulesDeleteEvent, OrRulesGroupNameChangeEvent, style, OrRules } from "./lib/index.d.ts";
import type { OrRuleGroupViewer } from "./lib/or-rule-group-viewer.d.ts";
import type { OrRuleTextViewer } from "./lib/or-rule-text-viewer.d.ts";
import type { OrRuleTree } from "./lib/or-rule-tree.d.ts";
import type { OrRuleViewer } from "./lib/or-rule-viewer.d.ts";

/**
 * This type can be used to create scoped tags for your components.
 *
 * Usage:
 *
 * ```ts
 * import type { ScopedElements } from "path/to/library/jsx-integration";
 *
 * declare module "my-library" {
 *   namespace JSX {
 *     interface IntrinsicElements
 *       extends ScopedElements<'test-', ''> {}
 *   }
 * }
 * ```
 *
 * @deprecated Runtime scoped elements result in duplicate types and can confusing for developers. It is recommended to use the `prefix` and `suffix` options to generate new types instead.
 */
export type ScopedElements<
  Prefix extends string = "",
  Suffix extends string = ""
> = {
  [Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`]: CustomElements[Key];
};

type BaseProps<T extends HTMLElement> = {

  /** Content added between the opening and closing tags of the element */
  children?: any;
  /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
  class?: string;
  /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
  className?: string;
  /** Takes an object where the key is the class name(s) and the value is a boolean expression. When true, the class is applied, and when false, it is removed. */
  classList?: Record<string, boolean | undefined>;
  /** Specifies the text direction of the element. */
  dir?: "ltr" | "rtl";
  /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
  exportparts?: string;
  /** For <label> and <output>, lets you associate the label with some control. */
  htmlFor?: string;
  /** Specifies whether the element should be hidden. */
  hidden?: boolean | string;
  /** A unique identifier for the element. */
  id?: string;
  /** Keys tell React which array item each component corresponds to */
  key?: string | number;
  /** Specifies the language of the element. */
  lang?: string;
  /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
  part?: string;
  /** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
  ref?: T | ((e: T) => void);
  /** Adds a reference for a custom element slot */
  slot?: string;
  /** Prop for setting inline styles */
  style?: Record<string, string | number>;
  /** Overrides the default Tab button behavior. Avoid using values other than -1 and 0. */
  tabIndex?: number;
  /** Specifies the tooltip text for the element. */
  title?: string;
  /** Passing 'no' excludes the element content from being translated. */
  translate?: "yes" | "no";
  /** The popover global attribute is used to designate an element as a popover element. */
  popover?: "auto" | "hint" | "manual";
  /** Turns an element element into a popover control button; takes the ID of the popover element to control as its value. */
  popovertarget?: "top" | "bottom" | "left" | "right" | "auto";
  /** Specifies the action to be performed on a popover element being controlled by a control element. */
  popovertargetaction?: "show" | "hide" | "toggle";

} ;

type BaseEvents = {


};



export type OrRulesProps = {
  /**  */
  "readonly"?: OrRules['readonly'];
  /**  */
  "config"?: OrRules['config'];
  /**  */
  "realm"?: OrRules['realm'];
  /**  */
  "language"?: OrRules['language'];


}


export type OrRuleGroupViewerProps = {
  /** Name of the group */
  "group"?: OrRuleGroupViewer['group'];
  /**  */
  "readonly"?: OrRuleGroupViewer['readonly'];

  /**  */
  "onundefined"?: (e: CustomEvent<OrRulesGroupNameChangeEvent>) => void;
}


export type OrRuleTextViewerProps = {
  /**  */
  "readonly"?: OrRuleTextViewer['readonly'];
  /**  */
  "config"?: OrRuleTextViewer['config'];
  /**  */
  "ruleset"?: OrRuleTextViewer['ruleset'];

  /**  */
  "onvalid"?: (e: CustomEvent<OrRulesRuleChangedEvent>) => void;
}


export type OrRuleTreeProps = {
  /** List of rules visible in the tree menu */
  "rules"?: OrRuleTree['rules'];
  /** Rules configuration object, for example to only allow certain ruleset types */
  "config"?: OrRuleTree['config'];
  /** Defines whether only global rulesets should be visible. */
  "global"?: OrRuleTree['global'];
  /** Sets every element in the tree to readonly mode */
  "readonly"?: OrRuleTree['readonly'];
  /**  */
  "nodes"?: OrRuleTree['nodes'];
  /**  */
  "draggable"?: OrRuleTree['draggable'];
  /**  */
  "selection"?: OrRuleTree['selection'];
  /**  */
  "sortOptions"?: OrRuleTree['sortOptions'];
  /**  */
  "sortBy"?: OrRuleTree['sortBy'];
  /**  */
  "groupFirst"?: OrRuleTree['groupFirst'];
  /**  */
  "menuTitle"?: OrRuleTree['menuTitle'];

  /**  */
  "onundefined"?: (e: CustomEvent<OrRulesAddEvent>) => void;
  /**  */
  "ongroupName"?: (e: CustomEvent<OrRulesRequestGroupEvent>) => void;
}


export type OrRuleViewerProps = {
  /**  */
  "ruleset"?: OrRuleViewer['ruleset'];
  /**  */
  "readonly"?: OrRuleViewer['readonly'];
  /**  */
  "disabled"?: OrRuleViewer['disabled'];
  /**  */
  "config"?: OrRuleViewer['config'];
  /**  */
  "modified"?: OrRuleViewer['modified'];
  /**  */
  "view"?: OrRuleViewer['view'];

  /**  */
  "onundefined"?: (e: CustomEvent<OrRulesSaveEvent>) => void;
}

  export type CustomElements = {


  /**
     * 
 * 
 * ## Attributes & Properties
 * 
 * Component attributes and properties that can be applied to the element or by using JavaScript.
 * 
 * - `readonly`: undefined 
 * - `config`: undefined 
 * - `realm`: undefined 
 * - `language`: undefined 
 * 
 * ## Methods
 * 
 * Methods that can be called to access component functionality.
 * 
 * - `refresh() => void`: undefined
  */
    "or-rules": Partial<OrRulesProps & BaseProps<OrRules> & BaseEvents>;


  /**
     * 
 * 
 * ## Attributes & Properties
 * 
 * Component attributes and properties that can be applied to the element or by using JavaScript.
 * 
 * - `group`: Name of the group 
 * - `readonly`: undefined 
 * 
 * ## Events
 * 
 * Events that will be emitted by the component.
 * 
 * - `undefined`: undefined
  */
    "or-rule-group-viewer": Partial<OrRuleGroupViewerProps & BaseProps<OrRuleGroupViewer> & BaseEvents>;


  /**
     * 
 * 
 * ## Attributes & Properties
 * 
 * Component attributes and properties that can be applied to the element or by using JavaScript.
 * 
 * - `readonly`: undefined (property only)
 * - `config`: undefined (property only)
 * - `ruleset`: undefined (property only)
 * 
 * ## Events
 * 
 * Events that will be emitted by the component.
 * 
 * - `valid`: undefined
 * 
 * ## Methods
 * 
 * Methods that can be called to access component functionality.
 * 
 * - `beforeSave() => void`: undefined
 * - `validate() => boolean`: undefined
  */
    "or-rule-text-viewer": Partial<OrRuleTextViewerProps & BaseProps<OrRuleTextViewer> & BaseEvents>;


  /**
     * 
 * 
 * ## Attributes & Properties
 * 
 * Component attributes and properties that can be applied to the element or by using JavaScript.
 * 
 * - `rules`: List of rules visible in the tree menu 
 * - `config`: Rules configuration object, for example to only allow certain ruleset types 
 * - `global`: Defines whether only global rulesets should be visible. 
 * - `readonly`: Sets every element in the tree to readonly mode 
 * - `nodes`: undefined (property only)
 * - `draggable`: undefined (property only)
 * - `selection`: undefined (property only)
 * - `sortOptions`: undefined (property only)
 * - `sortBy`: undefined (property only)
 * - `groupFirst`: undefined (property only)
 * - `menuTitle`: undefined (property only)
 * 
 * ## Events
 * 
 * Events that will be emitted by the component.
 * 
 * - `undefined`: undefined
 * - `groupName`: undefined
 * 
 * ## Methods
 * 
 * Methods that can be called to access component functionality.
 * 
 * - `selectRuleset(ruleset: RulesetUnion, silent = false) => void`: Public function that allows consumers to select a ruleset in the tree.
 * It finds the tree node in the UI, and selects it.
 * - `deselectAllNodes() => void`: undefined
 * - `refresh() => void`: Refreshes the tree content, and re-fetches the list of rules.
  */
    "or-rule-tree": Partial<OrRuleTreeProps & BaseProps<OrRuleTree> & BaseEvents>;


  /**
     * 
 * 
 * ## Attributes & Properties
 * 
 * Component attributes and properties that can be applied to the element or by using JavaScript.
 * 
 * - `ruleset`: undefined 
 * - `readonly`: undefined 
 * - `disabled`: undefined 
 * - `config`: undefined 
 * - `modified`: undefined (property only)
 * - `view`: undefined (property only)
 * - `valid`: undefined (property only) (readonly)
 * 
 * ## Events
 * 
 * Events that will be emitted by the component.
 * 
 * - `undefined`: undefined
  */
    "or-rule-viewer": Partial<OrRuleViewerProps & BaseProps<OrRuleViewer> & BaseEvents>;
  }

export type CustomCssProperties = {

}


declare module 'react' {
  namespace JSX {
    interface IntrinsicElements extends CustomElements {}
  }
  export interface CSSProperties extends CustomCssProperties {}
}

declare module 'preact' {
  namespace JSX {
    interface IntrinsicElements extends CustomElements {}
  }
  export interface CSSProperties extends CustomCssProperties {}
}

declare module '@builder.io/qwik' {
  namespace JSX {
    interface IntrinsicElements extends CustomElements {}
  }
  export interface CSSProperties extends CustomCssProperties {}
}

declare module '@stencil/core' {
  namespace JSX {
    interface IntrinsicElements extends CustomElements {}
  }
  export interface CSSProperties extends CustomCssProperties {}
}

declare module 'hono/jsx' {
  namespace JSX {
    interface IntrinsicElements extends CustomElements {}
  }
  export interface CSSProperties extends CustomCssProperties {}
}

declare module 'react-native' {
  namespace JSX {
    interface IntrinsicElements extends CustomElements {}
  }
  export interface CSSProperties extends CustomCssProperties {}
}

declare global {
  namespace JSX {
    interface IntrinsicElements extends CustomElements {}
  }
  export interface CSSProperties extends CustomCssProperties {}
}
