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

x/oak_nest/src/interfaces/mod.ts>ClassProvider

Refer to nestjs to realize some common functions for Deno
Go to Latest
interface ClassProvider
import { type ClassProvider } from "https://deno.land/x/oak_nest@v1.13.17/src/interfaces/mod.ts";

Interface defining a Class type provider.

For example:

const configServiceProvider = {
provide: ConfigService,
useClass:
  process.env.NODE_ENV === 'development'
    ? DevelopmentConfigService
    : 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.