import { CSSResultGroup, TemplateResult } from "lit"; export interface ViewOptions { shadow?: boolean; styles?: CSSResultGroup; } export type StateMap = Map; export type SetupMap = Map void>; export type StateSettingFunction = (previousValue: xValue) => xValue; export type ValueOrFunction = xValue | ((previousValue: xValue) => xValue); export type StateSetter = (valueOrFunction: ValueOrFunction) => void; export type StateGetter = () => xValue; export type StateTuple = [ xValue, StateSetter, StateGetter, xValue ]; export interface UseView { state(initial: xValue | (() => xValue)): StateTuple; setup(e: (rerender: () => void) => () => void): void; } export interface Renderer { (...props: xProps): TemplateResult | void; } export interface View extends Renderer { } export type Sauce = ((use: UseView) => Renderer);