UNPKG

@selenite/commons

Version:

This typescript package provides a set of frequently used utilities, types and svelte actions for building projects with Typescript and Svelte.

16 lines (15 loc) 711 B
/** * Utils for working with promises. * * Promises are used in JavaScript to handle asynchronous operations. They are a way to handle the result of an asynchronous operation once it completes. * * You can await the completion of a promise using the `await` keyword. This will pause the execution of the current function until the promise resolves. * @module */ /** * Returns a promise that resolves after a delay. * @param ms - the number of miliseconds to wait before resolving the promise. Defaults to 0. * @returns Promise that resolves after the specified delay. */ export declare function sleep(ms?: number): Promise<unknown>; export declare function animationFrame(n?: number): Promise<void>;