import * as React from 'react'; import { GetEmojiUrl } from '../components/emoji/BaseEmojiProps'; import type { EmojiDataInput } from '../hooks/useResolvedEmojiData'; import { CategoryIcons, EmojiClickData, EmojiData, EmojiStyleValue, SkinTonePickerLocation, SkinTones, SkinTonesValue, SuggestionModeValue, ThemeValue } from '../types/exposedTypes'; import { CategoriesConfig, UserCategoryConfig } from './categoryConfig'; import { CustomEmoji } from './customEmojiConfig'; export declare const DEFAULT_SEARCH_PLACEHOLDER = "Search"; export declare const DEFAULT_PICKER_WIDTH = 350; export declare const DEFAULT_PICKER_HEIGHT = 450; export declare const DEFAULT_SEARCH_INPUT_LABEL = "Type to search for an emoji"; export declare const DEFAULT_SEARCH_CLEAR_BUTTON_LABEL = "Clear"; export declare const SEARCH_RESULTS_NO_RESULTS_FOUND = "No results found"; export declare const SEARCH_RESULTS_SUFFIX = " found. Use up and down arrow keys to navigate."; export declare const SEARCH_RESULTS_ONE_RESULT_FOUND: string; export declare const SEARCH_RESULTS_MULTIPLE_RESULTS_FOUND: string; /** * Every user-facing string the picker renders or announces. All keys are * optional on the `labels` prop; anything omitted keeps its English * default. Category names come from `categories` / localized `emojiData`, * and the preview caption from `previewConfig.defaultCaption`. */ export type PickerLabels = { searchPlaceholder: string; /** Accessible name of the search input. */ searchLabel: string; searchClear: string; /** Live-region announcement and visible empty state. */ searchResultsNone: string; searchResultsOne: string; /** `%n` is replaced with the result count. */ searchResultsMany: string; categoryNavigation: string; reactions: string; expandReactions: string; /** Shown by the Loading part while the dataset loads. */ loading: string; loadingError: string; retryLoading: string; skinToneNeutral: string; skinToneLight: string; skinToneMediumLight: string; skinToneMedium: string; skinToneMediumDark: string; skinToneDark: string; }; export declare const DEFAULT_LABELS: PickerLabels; /** * The default style is native, but a caller-supplied image URL resolver is * an explicit request for images: without an explicit `emojiStyle` it keeps * v4's image default (Apple), so the resolver is actually used. */ export declare function resolveEmojiStyle(emojiStyle: EmojiStyleValue | undefined, customImageSource: unknown): EmojiStyleValue; export declare function mergeConfig(rawUserConfig?: PickerConfig): PickerConfigInternal; export declare function resolveSkinTonePickerLocation(location: SkinTonePickerLocation, searchDisabled: boolean, showPreview: boolean): SkinTonePickerLocation; export declare function basePickerConfig(): PickerConfigInternal; export type PickerConfigInternal = { emojiVersion: string | null; searchPlaceHolder: string; searchPlaceholder: string; searchClearButtonLabel: string; defaultSkinTone: SkinTonesValue; skinTonesDisabled: boolean; autoFocusSearch: boolean; /** * Keep focus in the search input while the arrow keys move a highlight * through the grid, so typing continues; Enter selects the highlighted * emoji. Default: arrows move focus into the grid. */ keepSearchFocus: boolean; /** * Turns off skin-tone variations in the grid: no long press, no Space * menu, no variation marker. The active skin tone still applies. */ variationsDisabled: boolean; emojiStyle: EmojiStyleValue; categories: CategoriesConfig; theme: ThemeValue; suggestedEmojisMode: SuggestionModeValue; lazyLoadEmojis: boolean; previewConfig: PreviewConfig; className: string; height: PickerDimensions; width: PickerDimensions; style: React.CSSProperties; getEmojiUrl: GetEmojiUrl; searchDisabled: boolean; skinTonePickerLocation: SkinTonePickerLocation; unicodeToHide: Set; customEmojis: CustomEmoji[]; reactionsDefaultOpen: boolean; reactions: string[]; open: boolean; allowExpandReactions: boolean; hiddenEmojis: string[]; emojiData?: EmojiData; categoryIcons: CategoryIcons; nonce?: string; /** * Controlled search value (raw user text). When present, it is the * accepted visible source of truth; user edits emit `onSearchChange` * proposals instead of committing locally. */ searchValue?: string; /** Uncontrolled initial search value, read once per mounted lifetime. */ defaultSearchValue?: string; /** Emitted synchronously with each committed (uncontrolled) or proposed (controlled) user edit. */ onSearchChange?: (value: string) => void; /** Accessible label for the search input. Defaults to English. */ searchLabel?: string; /** * Caller-defined Suggested category contents/order (unified or custom * IDs). While present, `suggestedEmojisMode` is ignored for contents. */ suggestedEmojis?: string[]; /** Observes compact-reactions vs full-picker transitions. */ onReactionsModeChange?: (reactionsOpen: boolean) => void; /** * Localized user-facing strings. Takes precedence over the individual * `searchPlaceholder` / `searchLabel` / `searchClearButtonLabel` props. */ labels?: Partial; /** * Controlled active skin tone. Pair with `onSkinToneChange`; while * present, `defaultSkinTone` is ignored. */ skinTone?: SkinTonesValue; /** * Emit the picker's CSS inside this cascade layer (e.g. "epr"), for * layered CSS frameworks such as Tailwind v4 whose utilities cannot * beat unlayered CSS. Declare the layer first in your CSS: * `@layer epr, theme, base, components, utilities;`. Default: unlayered. */ cssLayer?: string; /** * Emojis per row. The picker then sizes its width to fit those columns * unless you set a width; a narrower container shows fewer columns. * Default: as many as the width fits. */ columns?: number; }; export type PreviewConfig = { defaultEmoji: string; defaultCaption: string; showPreview: boolean; }; type ConfigExternal = { previewConfig: Partial; onEmojiClick: MouseDownEvent; onReactionClick: MouseDownEvent; onSkinToneChange: OnSkinToneChange; /** * User-supplied allowlist/order/merge input. Bare `Categories` members * are accepted alongside full configs (as in v4 usage and this repo's * own tests); the merged internal representation stays `CategoriesConfig`. */ categories: UserCategoryConfig; /** * Dataset: an object (synchronous, SSR-safe), or a loader such as * `() => import('emoji-picker-react/data/emojis-fr')` to code-split it. * Omitted: the bundled English dataset. */ emojiData: EmojiDataInput; } & Omit; export type PickerConfig = Partial; export type PickerDimensions = string | number; export type MouseDownEvent = (emoji: EmojiClickData, event: MouseEvent, api?: OnEmojiClickApi) => void; export type OnSkinToneChange = (skinTone: SkinTones) => void; /** The `onEmojiClick` / `onReactionClick` callback signature. */ export type EmojiClickHandler = MouseDownEvent; /** The `onSkinToneChange` callback signature. */ export type SkinToneChangeHandler = OnSkinToneChange; /** Third argument of `onEmojiClick` / `onReactionClick`. */ export type OnEmojiClickApi = { /** Return to the compact reactions bar (no-op when reactions are off). */ collapseToReactions: () => void; }; export {};