Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno_nest/src/interfaces/provider.interface.ts>ClassProvider

Refer to nestjs to realize some common functions for Deno, support hono and oak
Go to Latest
interface ClassProvider
import { type ClassProvider } from "https://deno.land/x/deno_nest@v3.7.1/src/interfaces/provider.interface.ts";

Interface defining a Class type provider.

For example:

const configServiceProvider = {
   provide: ConfigService,
   useClass: ProductionConfigService
};

Type Parameters

optional
T = any

Properties

provide: Provide

Injection token

useClass: Type<T>

Type (class name) of provider (instance to be injected).

optional
scope: Scope

Optional enum defining lifetime of the provider that is injected.