import {CSSResultGroup, TemplateResult} from "lit" export interface ViewOptions { shadow?: boolean styles?: CSSResultGroup } export type StateMap = Map // [currentState, previousState] 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 = [ // current value xValue, // setter StateSetter, // getter StateGetter, // previous value 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 )