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)

16 lines (15 loc) 710 B
import { Type } from './Type.js'; import { Cursor } from './pages/Cursor.js'; export interface PageSeedData { type: Type; partial: Record<string, any>; } export type PageSeed<Definition = object, Children extends Record<string, PageSeed> = Record<string, PageSeed<any, any>>> = Children & { [PageSeed.Data]: PageSeedData; }; export declare namespace PageSeed { const Data: unique symbol; function data(page: PageSeed): PageSeedData; function isPageSeed(page: any): page is PageSeed; } export declare function page<Definition, Children extends Record<string, PageSeed<any, any>>>(type: Type<Definition> | Cursor.Partial<Definition>, children?: Children): PageSeed<Definition, Children>;