UNPKG

@danilandreev/material-docs

Version:

material-docs - react framework for easy creating documentation site in material design style.

45 lines (38 loc) 1.02 kB
/* * Author: Andrieiev Danil | danssg08@gmail.com | https://github.com/DanilAndreev * Copyright (C) 2020. */ /// <reference types="react" /> import Lang from "../../interfaces/Lang"; export interface LangContext { /** * switchLang - function, designed to change language settings. * @function * @param {Lang} lang * @async */ switchLang(lang: Lang): Promise<void>; /** * lang - currently selected language. * @type Lang */ lang: Lang | null; /** * langs - array of all available langs. * @type Lang[] */ langs: Lang[]; /** * onHelpToTranslate - function, called on help to translate button click. If not defined - button will not be rendered. * @function * @param {Lang} lang */ onHelpToTranslate(lang: Lang): void; } /** * useLang - react hook, designed to provide element with language data. * @function * @return LangContext */ declare const useLang: () => LangContext; export default useLang;