import type { BunFile } from "bun"; export namespace LatteBun { export interface Template { fill(fillins: LatteBun.templateDescriptor): LatteBun.DataStream; bake(fillins: LatteBun.bakeableTemplateDescriptor): LatteBun.Template; } export type DataChunk = Uint8Array; export type DataStream = ReadableStream; export type DataStreamReader = ReadableStreamDefaultReader; export type templatePickableOnly = string | DataChunk | BunFile; export type templateBakeableOnly = DataStream; /** A datatype that can be filled in live while a site is operating */ export type templateFillable = templatePickableOnly; /** A datatype that can be baked-in to cache a page while a site is operating */ export type templateBakeable = templateBakeableOnly | templatePickableOnly; /** * Used to describe the fill-ins of the template * * {@inheritdoc template} */ export type templateDescriptor = { [_: string]: templateFillable | templateDescriptor }; /** * Used to describe the fill-ins of the template to be baked * * {@inheritdoc bakedTemplate} */ export type bakeableTemplateDescriptor = { [_: string]: templateBakeable | bakeableTemplateDescriptor }; /** * */ export type templateOptions = { create(): DataStream | Promise; }; /** * */ export type markdownOptions = {}; }