Skip to content

ConfigSourceOptions

@tsed/config

Usage

typescript
import { ConfigSourceOptions } from "@tsed/config";

See /packages/config/src/types/interfaces/ConfigSource.ts.

Overview

ts
interface ConfigSourceOptions<Opts = any> {
    name?: string;
    priority?: number;
    enabled?: boolean;
    use: Type<ConfigSource<Opts>>;
    options: Opts;
    validationSchema?: JsonSchema;
    watch?: boolean;
    refreshOn?: "request" | "response";
}

name

ts
name?: string;

The name of the configuration provider.

priority

ts
priority?: number;

The priority of the configuration provider. Higher priority providers will override values from lower priority providers.

enabled

ts
enabled?: boolean;

Whether to enable the configuration provider.

use

ts
use: Type<ConfigSource<Opts>>;

The ConfigSource to use for loading configuration values.

options

ts
options: Opts;

Options for the configuration provider.

validationSchema

ts
validationSchema?: JsonSchema;

The schema to validate the configuration values against.

watch

ts
watch?: boolean;

Enable FileSystem Watch mode. ConfigSource must implement the watch() method.

refreshOn

ts
refreshOn?: "request" | "response";

Refresh strategy. Ts.ED can refresh ConfigSource during the "$onRequest" or "$onResponse" hook.

Note: refresh data during $onRequest can degrade performance depending on the ConfigSource type. We recommend to refresh data during the $onResponse hook (action are asynchronous).

Released under the MIT License.