import createUniqueClassName from './createUniqueClassName'; import DarkModeProps, { Theme } from './DarkModeProps'; import getNodeTextContent from './getNodeTextContent'; import getTheme from './getTheme'; import { type LgIdProps, type LgIdString } from './LgIdProps'; import * as typeIs from './typeIs'; export { /** @deprecated Use the utility exported from `@leafygreen-ui/compound-component` */ filterChildren, /** @deprecated Use the utility exported from `@leafygreen-ui/compound-component` */ findChild, /** @deprecated Use the utility exported from `@leafygreen-ui/compound-component` */ findChildren, /** @deprecated Use the utility exported from `@leafygreen-ui/compound-component` */ hasAnyStaticProperty, /** @deprecated Use the utility exported from `@leafygreen-ui/compound-component` */ hasStaticProperty, /** @deprecated Use the utility exported from `@leafygreen-ui/compound-component` */ isChildWithProperty, } from './childQueries'; export { createSyntheticEvent } from './createSyntheticEvent'; export { deepMapValues } from './deepMapValues'; export { formatCssSize } from './formatCssSize'; export { getClosestFocusableElement } from './getClosestFocusableElement'; export { getMobileMediaQuery } from './getMobileMediaQuery'; export * from './helpers'; export { focusableElementSelector, queryAllFocusableElements, queryFirstFocusableElement, queryLastFocusableElement, } from './queryFocusableElements'; export type { Concat, DeepKeys, DeepPartial, DeepPathValues, DeepPick, DeepUnion, ExclusiveUnion, Exists, Mutable, Only, Optional, PartialRequired, RecursiveRecord, ValuesOf, } from './types'; export { isComponentType, validateChildren } from './validateChildren'; export { createUniqueClassName, getNodeTextContent, getTheme, Theme, typeIs }; export type { DarkModeProps, LgIdProps, LgIdString }; /** * Helper type to extract an HTML element's valid props * * @deprecated - Prefer the built-in React type {@link React.ComponentProps} * */ export type HTMLElementProps = React.PropsWithChildren> & { ref?: [RefType] extends [never] ? never : React.Ref; key?: React.Key | null; }; /** * Helper that constructs a type requiring at least one of the passed keys * to be present in the passed interface. * * Example * ``` * interface ExampleInterface { * alwaysRequired: boolean, * sometimesRequired: boolean, * requiredOtherTimes: boolean, * } * * type ExampleEither = Either * * // The above is equivalent to: * interface SharedInExampleInterface { * alwaysRequired: boolean, * } * * interface FirstIsRequired extends SharedInExampleInterface { * sometimesRequired: boolean, * requiredOtherTimes?: boolean, * } * * interface SecondIsRequired extends SharedInExampleInterface { * sometimesRequired?: boolean, * requiredOtherTimes: boolean, * } * * type EquivalentToExampleEither = FirstIsRequired | SecondIsRequired * ``` */ export type Either = Omit & { [K in Keys]-?: Required> & Partial>>; }[Keys]; /** * Helper that constructs mutually exclusive record types. Refer to tests for usage. */ export type OneOf = (T1 & Partial, never>>) | (T2 & Partial, never>>); /** * Utility for making it easier to couple a React Component to a css selector. * Useful when writing css selectors that rely on interactivity, i.e. :hover. * Example: * const checkBoxWrapper = createDataProp('checkbox-wrapper'); * // Used as selector: * css`&:hover ${checkboxWrapper.selector} { }` * // Used on React Component *
* @param {string} name Name of element we want to reference. * * @deprecated */ export declare function createDataProp(name: string): { prop: { [x: string]: string; }; selector: string; }; /** Object mapping keyCodes to keys */ export declare const keyMap: { readonly ArrowUp: "ArrowUp"; readonly ArrowDown: "ArrowDown"; readonly ArrowLeft: "ArrowLeft"; readonly ArrowRight: "ArrowRight"; readonly Backspace: "Backspace"; readonly BracketLeft: "["; readonly Delete: "Delete"; readonly Enter: "Enter"; readonly Escape: "Escape"; readonly Space: " "; readonly Tab: "Tab"; }; /** * An enum of accepted values for the "aria-current" attribute, used for * indicating current/active state across several contexts. * * The values "false", the empty string, and an ommission of this attribute * are all treated identically by user agents and screen readers. * * W3C Recommendation: https://www.w3.org/TR/wai-aria-1.1/#aria-current */ export declare const AriaCurrentValue: { readonly Page: "page"; readonly Step: "step"; readonly Location: "location"; readonly Date: "date"; readonly Time: "time"; readonly True: "true"; readonly Unset: "false"; }; export type AriaCurrentValue = (typeof AriaCurrentValue)[keyof typeof AriaCurrentValue]; /** * Accepts a type as an argument and makes all of the keys of the type optional */ export type RecursivePartial = { [P in keyof T]?: T[P] extends Array ? Array> : T[P] extends object ? RecursivePartial : T[P] extends infer U | undefined ? RecursivePartial | undefined : T[P] extends infer U | null ? RecursivePartial | null : T[P]; }; /** * Helper function to use the typechecker to catch when * not all cases of a type have been handled. * * Example 1: * let color: 'red' | 'blue' | 'green'; * switch (color) { * case 'red': * ... * break; * case 'blue': * ... * break; * default: * enforceExhaustive(color); * ^^^^^ * Argument of type 'string' is not assignable to parameter of type 'never'. * } * * Example 2: * let key: number | string | symbol; * * if (typeof key === 'string') { * ... * return; * } * * if (typeof key === 'number') { * ... * return; * } * * enforceExhaustive(key); * ^^^ * Argument of type 'symbol' is not assignable to parameter of type 'never'. */ export declare function enforceExhaustive(value: never): never; //# sourceMappingURL=index.d.ts.map