/** * @license * Copyright Akveo. All Rights Reserved. * Licensed under the MIT License. See License.txt in the project root for license information. */ import React from 'react'; import { CustomSchemaType, SchemaType, ThemeStyleType } from '@eva-design/dss'; import { ThemeProviderProps } from '../theme/themeProvider.component'; interface EvaRuntimeProcessingProps { mapping: SchemaType; customMapping?: CustomSchemaType; } interface EvaBuildtimeProcessingProps { styles: ThemeStyleType; } type EvaProcessingProps = EvaRuntimeProcessingProps | EvaBuildtimeProcessingProps; export type ApplicationProviderProps = EvaProcessingProps & ThemeProviderProps; export type ApplicationProviderElement = React.ReactElement; interface State { styles: ThemeStyleType; } /** * Overall application container. * * @extends React.Component * * @property {ReactNode} children - Overall application component. * Usually, a router or nested providers. * * @property {SchemaType} mapping - Mapping for UI Kitten components. * This is designed to be provided from any `@eva-design/*` package. * If provided, will be merged with *customMapping* and compiled into styles during the runtime. * Can be improved with build-time processing with `@wirthus/ui-kitten-metro-config` package. * * @property {CustomSchemaType} customMapping - Customized mapping. * * @property {ThemeType} theme - Current theme. * Designed to be provided from any `@eva-design/*` package. * * @property {ThemeStyleType} styles - Styles compiled by bootstrapping Eva packages. * If provided, will replace runtime styles processing. * Usually, can be provided by `@wirthus/ui-kitten-metro-config` package. * * @overview-example Simple Usage * ApplicationProvider is designed to be the root component of the application. * It should be rendered **once**, to provide Eva styles for nested components. * ``` * import React from 'react'; * import { ApplicationProvider, Layout, Text } from '@wirthus/ui-kitten-components'; * import * as eva from '@eva-design/eva'; * * export default () => ( * // <-- {eva.dark} for dark mode * * Welcome to UI Kitten * * * ); * ``` * * @overview-example Ecosystem * Also, it may accept [custom themes](guides/branding) and [icon packages](guides/icon-packages) * to provide a highly customizable, design system based application. * ``` * import React from 'react'; * import { ApplicationProvider, IconRegistry, Layout, Text } from '@wirthus/ui-kitten-components'; * import { EvaIconsPack } from '@wirthus/ui-kitten-eva-icons'; * import * as eva from '@eva-design/eva'; * * export default () => ( * * * * * Welcome to UI Kitten * * * * ); * ``` */ export declare class ApplicationProvider extends React.Component { state: State; private schemaProcessor; constructor(props: ApplicationProviderProps); private createStyles; render(): React.ReactNode; } export {};