UNPKG

nuxt

Version:

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.

15 lines • 561 B
//#region src/app/internal/context.d.ts /** Holds the active instance for a given context key. */ export interface NuxtAppContext<T> { /** Return the active instance, throwing when none is set. */ use: () => T; tryUse: () => T | null; set: (instance?: T, replace?: boolean) => void; unset: () => void; call: <R>(instance: T, callback: () => R) => R; callAsync: <R>(instance: T, callback: () => R | Promise<R>) => Promise<R>; } export declare function getContext<T>(key: string, opts: { asyncContext?: boolean; }): NuxtAppContext<T>; //#endregion