API reference
Public types and helpers exported from the library
Everything public Emoteer exposes. Imported from either @emoteer/core (framework-agnostic) or @emoteer/react (re-exported for convenience).
NativeEmoji
The canonical shape of a Unicode emoji, mapped from emojibase.
interface NativeEmoji {
unicode: string; // e.g. '😀'
label: string; // human-readable name
shortcodes: string[]; // without colons, e.g. ['grinning_face']
group: number; // emojibase group (0–9)
hexcode: string; // e.g. '1F600'
tags?: string[]; // optional search tags
}LocalEmote
A developer-defined image-based emote supplied through EmoteProvider.
interface LocalEmote {
id: string; // stable identifier
name: string; // display name, also used as shortcode without colons
src: string; // URL or path to the image
category?: string;
}See Custom emojis for the full integration.
Emote
Discriminated union of the two kinds an Emoteer component can render.
type Emote = NativeEmoji | LocalEmote;
function isLocalEmote(e: Emote): e is LocalEmote; // 'src' in e
function isNativeEmoji(e: Emote): e is NativeEmoji; // 'unicode' in eEvery onSelect callback in EmoteList and EmoteAutocomplete fires with an Emote. Use the helpers to narrow before consuming type-specific fields.
Reaction
The shape consumed by ReactionCounter.
interface Reaction {
emoji: string; // unicode glyph or any string
count: number;
active: boolean;
}Locale
Controls which shortcode dictionary is loaded. BCP 47 tag.
type SupportedLocale =
| 'bn' | 'da' | 'de' | 'en' | 'en-gb' | 'es' | 'es-mx' | 'et' | 'fi'
| 'fr' | 'hi' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'ms' | 'nb' | 'nl'
| 'pl' | 'pt' | 'ru' | 'sv' | 'th' | 'uk' | 'vi' | 'zh' | 'zh-hant';
type Locale = SupportedLocale | (string & {});Unsupported tags fall back to 'en' at runtime.
CloudConfig
Reserved for the forthcoming Emoteer Cloud tier.
interface CloudConfig {
projectId: string;
apiKey: string;
}EmoteProviderProps
Props accepted by EmoteProvider.
interface EmoteProviderProps {
children: React.ReactNode;
natives?: boolean; // load Unicode emojis (default: true)
locals?: LocalEmote[]; // custom emotes
locale?: Locale; // default: 'en'
cloud?: CloudConfig; // reserved
}useEmoteContext
Runtime context exposed by EmoteProvider.
interface EmoteContextValue {
emojis: NativeEmoji[];
locals: LocalEmote[];
emotes: Emote[]; // natives + locals
shortcodeIndex: Map<string, Emote>; // `:name:` → emote
unicodeIndex: Map<string, NativeEmoji>; // glyph → native
isLoading: boolean;
error: Error | null;
}Imports
// Framework-agnostic — safe in any environment
import {
isLocalEmote,
isNativeEmoji,
type NativeEmoji,
type LocalEmote,
type Emote,
type Locale,
type SupportedLocale,
type CloudConfig,
} from '@emoteer/core';
// Re-exported from the React binding
import {
isLocalEmote,
isNativeEmoji,
type Emote,
type EmoteProviderProps,
type Reaction,
} from '@emoteer/react';