UNPKG

galhui

Version:

UI library using galho framework

23 lines (22 loc) 1.17 kB
import { G } from "galho"; import { Dic, Key, bool, int, str } from "galho/util.js"; /**request animation frame each frame, if fn returns false cancel animation * @returns function that cancel the renderer of current animation */ export declare function anim(fn: () => void | boolean): () => void; export declare const up: (v: str) => string; export declare function arrayToDic<T, U>(arr: Array<T>, callback: (value: T, index: number) => [Key, U]): Dic<U>; /** * map dictionary * @param dic * @param fn */ export declare function filterDic<T>(dic: Dic<T>, fn?: (value: T, key: string) => any): Dic<T>; export declare function filterDic<T extends Dic>(dic: T, fn?: (value: any, key: any) => any): T; export declare function anyProp<T = any>(dic: Dic<T>, fn?: (value: T, key: string) => unknown): boolean; export declare function extend<T extends object, U = Partial<T>>(obj: T, extension: U, override?: bool): T & U; export declare const UUID: (l?: int) => string; export type Input = G<HTMLInputElement>; export type Div = HTMLDivElement; export type Button = HTMLButtonElement; export type InputElement = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;