import React from 'react'; import { type PartialRecord } from '@hitagi/utils/types'; import { type Ability, type GameVersion, type Hero, type ImageResolvers, type Item } from './common'; export type DotaContextValue = { abilities: { values: Ability[]; } & PartialRecord; heroes: { values: Hero[]; } & PartialRecord; items: { values: Item[]; } & PartialRecord; gameVersions: { values: GameVersion[]; } & PartialRecord; imageResolvers: ImageResolvers; }; export declare const DotaContext: React.Context; type DotaProviderProps = { children: React.ReactNode; constants: { abilities?: Ability[]; heroes?: Hero[]; items?: Item[]; gameVersions?: GameVersion[]; }; imageResolvers?: Partial; loading?: boolean; }; /** * `DotaProvider` relies on the [context feature of React](https://reactjs.org/docs/context.html) * to pass the data down to the components, so you need to make sure that * `DotaProvider` is a parent of the components from `@hitagi/dota` package you * are to using. * * Components in `@hitagi/dota` package are flexible, even though they are built * primarily to work with STRATZ API, you're not required to use it; * things can be customized! Constants can be sourced from anywhere, the only * requirement for them is that data should be "shaped" in a certain way. * * See `Ability`, `Hero`, `Item` and `GameVersion` types in `packages/dota/src/Context/common.tsx`; * You don't need to supply everything that those types "ask" for, but only * things that components that you are going to use require to function. * For example if you're planning to display hero images and names in your app - * you can provide only `hero` constants with `id`, `name` and `langauge` properties; * if the only thing you need to display for whatever reason is PatchName - * forget about abilities, heroes and items - provide only `gameVersion` constants. */ export declare function DotaProvider(props: DotaProviderProps): JSX.Element; export {};