import * as CSS from "csstype"; import { Page, RefInstance, Signal } from "./classes.js"; import type { ElementEventHandler, ElementEventMap } from "./dom-objects-event-types.js"; type AnyObject = { [key: string]: any; }; interface Attributes { ref?: [RefInstance, string]; style?: Partial | string; [key: `data-${string}`]: string | undefined; [key: `aria-${string}`]: string | undefined; } type EventAttributes = ElementEventHandler; export type VJS_params_TYPE = (undefined | undefined[] | string | string[] | HTMLElement | HTMLElement[] | DocumentFragment | DocumentFragment[] | [string, Signal] | Attributes | (E extends keyof ElementEventMap ? EventAttributes : AnyObject) | (() => HTMLElement) | (() => HTMLElement)[] | ((ctx: Comp) => HTMLElement) | ((ctx: Comp) => HTMLElement)[])[]; export type CradovaPageType = { /** * Cradova page * --- * title of the page * . */ title?: string; /** * Cradova page * --- * The component for the page * @param data * @returns void * . */ template: ((ctx: Comp) => HTMLElement) | (() => HTMLElement) | (() => DocumentFragment); }; export type browserPageType = importType | Promise | (() => Promise); export interface Comp extends Function { (ctx: Comp, ...args: any[]): HTMLElement; useReducer: (reducer: (state: S, action: A) => S, initialArg: S, initializer?: (arg: S) => S) => [S, (action: A) => void]; useState: (initialValue: S) => [S, (newState: S | ((prevState: S) => S)) => void]; useEffect: (effect: () => (() => void) | void, deps?: unknown[]) => void; useMemo: (factory: () => T, deps?: unknown[]) => T; useCallback: any>(callback: T, deps?: unknown[]) => T; useRef: () => RefInstance; } export {};