UNPKG

@novely/solid-renderer

Version:
28 lines (27 loc) 1.61 kB
import type { Stored } from '@novely/core'; import type { Atom } from '@novely/renderer-toolkit'; declare const capitalize: (str: string) => string; declare const isCSSImage: (str: string) => boolean; declare const createImageSync: (src: string) => HTMLImageElement; declare const createImage: (src: string) => Promise<HTMLImageElement | null>; declare const waitForImage: (image: HTMLImageElement) => Promise<boolean>; /** * Draws passed `images` array on a `canvas` */ declare const canvasDrawImages: (canvas: HTMLCanvasElement | undefined, ctx: CanvasRenderingContext2D | undefined, images: HTMLImageElement[]) => Promise<readonly [HTMLCanvasElement, CanvasRenderingContext2D]>; declare const url: <T extends string>(str: T) => `url(${T})`; declare const onKey: (cb: (event: KeyboardEvent) => void, ...keys: string[]) => (e: KeyboardEvent) => void; declare const simple: <T extends unknown[], R>(fn: (...args: T) => R) => (...args: T) => R; declare const getDocumentStyles: () => string; /** * A wrapper on `fn` to make it run only once! * @param fn Function that needed to run no more than one time */ declare const once: (fn: () => void) => () => void; declare const createRetrieved: <T>(fn: () => T) => () => T; /** * Like solid-js's from, but has initial value */ declare const from: <T>(producer: Atom<T> | Stored<T>) => import("solid-js").Accessor<T>; declare const removeTagsFromHTML: (html: string) => string; export { createRetrieved, isCSSImage, canvasDrawImages, url, capitalize, onKey, simple, getDocumentStyles, once, from, removeTagsFromHTML, createImageSync, createImage, waitForImage, };