UNPKG

@daiso-tech/core

Version:

The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.

56 lines (55 loc) 1.54 kB
/** * @module Utilities */ import type { Task } from "../../task/_module-exports.js"; import { type Invokable } from "../../utilities/functions/invokable.js"; import type { Promisable } from "../../utilities/types/promiseable.type.js"; /** * * IMPORT_PATH: `"@daiso-tech/core/utilities"` */ export type Lazy<TValue> = Invokable<[], TValue>; /** * * IMPORT_PATH: `"@daiso-tech/core/utilities"` */ export type Lazyable<TValue> = TValue | Lazy<TValue>; /** * * IMPORT_PATH: `"@daiso-tech/core/utilities"` */ export type AsyncLazy_<TValue> = Invokable<[], Promisable<TValue>>; /** * * IMPORT_PATH: `"@daiso-tech/core/utilities"` */ export type AsyncLazy<TValue> = AsyncLazy_<TValue> | Task<TValue>; /** * * IMPORT_PATH: `"@daiso-tech/core/utilities"` */ export type AsyncLazyable<TValue> = TValue | AsyncLazy<TValue>; /** * @internal */ export declare function isLazy<TValue>(lazyable: Lazyable<TValue>): lazyable is Lazy<TValue>; /** * @internal */ export declare function isPromiseLike<TValue>(value: unknown): value is PromiseLike<TValue>; /** * @internal */ export declare function isTask<TValue>(lazyable: AsyncLazyable<TValue>): lazyable is Task<TValue>; /** * @internal */ export declare function isAsyncLazy<TValue>(lazyable: AsyncLazyable<TValue>): lazyable is AsyncLazy<TValue>; /** * @internal */ export declare function resolveLazyable<TValue>(lazyable: Lazyable<TValue>): TValue; /** * @internal */ export declare function resolveAsyncLazyable<TValue>(lazyable: AsyncLazyable<TValue>): Promise<TValue>;