import { type ReactElement } from "react";
import { type UseStateInitializer } from "../types.js";
/**
 * Note: unlike the `dir` DOM attribute, the `"auto"` value is not supported.
 *
 * @remarks \@since 6.0.0
 */
export type Dir = "ltr" | "rtl";
/** @remarks \@since 6.0.0 */
export type DefaultDir = UseStateInitializer<Dir>;
/** @remarks \@since 2.3.0 */
export interface WritingDirectionContext {
    /**
     * The current writing direction that is being inherited.
     */
    dir: Dir;
    /**
     * Toggles the current writing direction for the first parent `Dir` component.
     */
    toggleDir(): void;
}
/**
 * Gets the writing direction context which provides access to the current `dir`
 * and a `toggleDir` function.
 *
 * @example
 * Manually Changing the Writing Direction
 * ```tsx
 * import { useDir } from "@react-md/core";
 *
 * function Example() {
 *   const { dir, toggleDir } = useDir();
 *
 *   return (
 *     <>
 *       <p>{`The current dir is: "${dir}"`}</p>
 *       <button type="button" onClick={toggleDir}>Toggle</button>
 *     </>
 *   );
 * }
 * ```
 *
 * @remarks \@since 6.0.0
 */
export declare function useDir(): Readonly<WritingDirectionContext>;
/** @remarks \@since 6.0.0 */
export interface WritingDirectionProviderProps {
    /**
     * A single ReactElement child. If the `WritingDirection` has a parent
     * `WritingDirection`, the child will have the `dir` prop cloned into this
     * element.
     */
    children: ReactElement<{
        dir?: Dir;
    }>;
    /**
     * The default writing direction for your app or a subtree. To change the
     * current writing direction, use the `useDir` hook to get access to the
     * current `dir` and the `toggleDir` function.
     *
     * @defaultValue `"ltr"`
     * @see {@link DEFAULT_WRITING_DIRECTION}
     */
    defaultDir?: DefaultDir;
}
/**
 * In the browser, this will default to the `<html>`'s `dir` value if one
 * exists. If the `dir` attribute does not exist, it will default to `"ltr"`.
 *
 * In node environments, this will default to `"ltr"`.
 *
 * @remarks \@since 6.0.0
 */
export declare const DEFAULT_WRITING_DIRECTION: () => Dir;
/**
 * **Client Component**
 *
 * The `WritingDirection` component is used to handle the current writing
 * direction within your app as well as conditionally updating the writing
 * direction for small sections in your app. When this component is used for the
 * first time near the root of your React component tree, the current direction
 * will be applied to the root `<html>` element. Otherwise the current dir will
 * be cloned into the child element so it can be passed as a prop.
 *
 * Note: Since the `dir` is cloned into the child element, you need to make sure
 * that the child is either a DOM element or the `dir` prop is passed from your
 * custom component.
 *
 * @example
 * Root Setup
 * ```tsx
 * import { createRoot } from "react-dom/client";
 * import { WritingDirection } from "@react-md/core";
 * import App from "./App.js":
 *
 * const container = document.getElementById("root");
 * const root = createRoot(container);
 *
 * root.render(
 *   <WritingDirection>
 *     <App />
 *   </WritingDirection>
 * );
 * ```
 *
 * @example
 * Supporting RTL Languages
 * ```tsx
 * import { createRoot } from "react-dom/client";
 * import { WritingDirection } from "@react-md/core";
 * import type { Dir } from "@react-md/core";
 * import App from "./App.js":
 *
 * const container = document.getElementById("root");
 * const root = createRoot(container);
 *
 * // see https://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code
 * const SUPPORTED_RTL_LANGUAGES = [
 *   "ar",
 *   "arc",
 *   "ckb",
 *   "dv",
 *   "fa",
 *   "ha",
 *   "he",
 *   "khw",
 *   "ks",
 *   "ps",
 *   "sd",
 *   "ur",
 *   "uz_AF",
 *   "ti",
 * ];
 *
 * const defaultDir = (): Dir => {
 *   if (SUPPORTED_RTL_LANGUAGES.includes(navigator.language)) {
 *     return "rtl"
 *   }
 *
 *   return "ltr";
 * }
 *
 * root.render(
 *   <WritingDirection defaultDir={defaultDir}>
 *     <App />
 *   </WritingDirection>
 * );
 * ```
 *
 * @remarks \@since 6.0.0
 */
export declare function WritingDirectionProvider(props: WritingDirectionProviderProps): ReactElement;
