UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

15 lines (14 loc) 748 B
import type { ComponentType } from 'react'; import { Schema } from './Schema.js'; import { Projection } from './pages/Projection.js'; import { Selection } from './pages/Selection.js'; type ViewSelection<T, S> = () => S; type ViewSelectionGeneric = () => Projection; export type View<T, Props = any, S extends Projection = Projection> = ComponentType<Props> & { selection: ViewSelectionGeneric; }; export declare function view<T, S extends Projection, Params extends Projection.Infer<S>>(selection: ViewSelection<T, S>, component: ComponentType<Params>): View<T, Params>; export declare namespace View { function getSelection(schema: Schema, summaryView: 'summaryRow' | 'summaryThumb', defaultSelection: Projection): Selection; } export {};