UNPKG

@needle-tools/engine

Version:

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.

36 lines (35 loc) 1.07 kB
import { Context } from "./engine_setup.js"; /** Wait for a number of seconds to pass. * @param seconds * @param context * @returns Generator function * @example * ```typescript * function *myCoroutineFunction() { * yield* WaitForSeconds(1); * } * ``` */ export declare function WaitForSeconds(seconds: number, context?: Context | null): Generator<undefined, void, unknown>; /** Wait for a number of frames to pass. * @param frames * @returns Generator function * @example * ```typescript * function *myCoroutineFunction() { * yield* WaitForFrames(10); * } * ``` */ export declare function WaitForFrames(frames: number): Generator<undefined, void, unknown>; /** Wait for a promise to resolve. * @param promise * @returns Generator function * @example * ```typescript * function *myCoroutineFunction() { * yield* WaitForPromise(fetch("https://jsonplaceholder.typicode.com/todos/1")); * } * ``` */ export declare function WaitForPromise(promise: Promise<any>): Generator<undefined, void, unknown>;