UNPKG

@sberdevices/plasma-temple

Version:

SberDevices CanvasApp Templates.

34 lines 1.31 kB
import React from 'react'; import { CharacterId } from '@sberdevices/assistant-client'; import { AnyObject } from '../../types'; import { HeaderProps } from '../Header/types'; import { PageComponent as PageComp } from './types'; export interface PageProps<Name extends string> { name: Name; component: PageComp<AnyObject, Name>; fallbackComponent?: React.ReactNode; header?: HeaderProps; ignoreInsets?: boolean; } export declare type GetInitialProps<P, R> = { (context: P): Promise<R>; } | { (context: P): R; }; interface InitialPropsGetter<P, S> { getInitialProps?: GetInitialProps<P, S>; } interface PageLazyParams<C extends PageComp<AnyObject, string>, P extends React.ComponentProps<C> = React.ComponentProps<C>, Pp = Pick<P, 'params'> & { character: CharacterId; }, Ss = P['state']> extends InitialPropsGetter<Pp, Ss> { default: C & InitialPropsGetter<Pp, Ss>; } interface PageLazy { lazy<T extends PageLazyParams<PageComp<AnyObject, any>>>(factory: () => Promise<T>): React.LazyExoticComponent<React.MemoExoticComponent<T['default']>>; } interface PageFunctionComponent extends PageLazy { <N extends keyof AnyObject>(props: PageProps<N>): React.ReactElement; } export declare const Page: PageFunctionComponent; export {}; //# sourceMappingURL=Page.d.ts.map