import { resolveDictionaryArgument } from '@intlayer/core/dictionaryManipulator'; import type { DeclaredLocales, DictionaryKeys, DictionaryRegistryResult, DictionarySelectorForKey, ExtractSelectorLocale, LocalesValues, } from '@intlayer/types/module_augmentation'; import { createMemo, useContext } from 'solid-js'; import { getIntlayer } from '../getIntlayer'; import type { DeepTransformContent } from '../plugins'; import { IntlayerClientContext, type IntlayerValue } from './IntlayerProvider'; /** * Solid hook that picks one dictionary by its key and returns its reactive content. * * The second argument is either a locale or a selector object: * - `{ item: 2 }` — collection item (omit `item` to get every item as array) * - `{ variant: 'black-friday' }` — named variant (omit for the `default` one) * - `locale` composes with any selector and overrides the context locale * * Supports both direct property access and the accessor call form: * - `content.myField.value` — reactive when used inside JSX or other Solid reactive contexts * - `content()` — backward-compatible accessor form * * @param key - The unique key of the dictionary to retrieve. * @param localeOrSelector - Optional locale or selector. * @returns Reactive content accessible via property access or function call. * * @example * ```tsx * import { useIntlayer } from 'solid-intlayer'; * * const MyComponent = () => { * const content = useIntlayer('my-dictionary-key'); * const faq2 = useIntlayer('faq', { item: 2 }); * * return