UNPKG

@etsoo/react

Version:

TypeScript ReactJs UI Independent Framework

62 lines (61 loc) 1.22 kB
import { IAction, IState } from "@etsoo/appscript"; import { IProviderProps, IUpdate } from "./IState"; /** * Page data interface */ export interface IPageData extends IState { /** * Page title */ title?: string; /** * Page subtitle */ subtitle?: string; } /** * Page action type */ export declare enum PageActionType { Data = "DATA", Title = "TITLE" } /** * Page action */ export interface PageAction<D extends IPageData> extends IAction { /** * Action type */ type: PageActionType; /** * Action data */ data: D; } /** * Page provider props */ export type PageProviderProps<D extends IPageData> = IProviderProps<PageAction<D>>; /** * Page calls with the state */ export interface PageCalls<D extends IPageData> extends IUpdate<D, PageAction<D>> { } /** * User state */ export declare class PageState<D extends IPageData> { /** * Context */ readonly context: import("react").Context<PageCalls<D>>; /** * Provider */ readonly provider: import("react").FunctionComponent<import("react").PropsWithChildren<IProviderProps<PageAction<D>>>>; /** * Constructor */ constructor(); }