Skip to content

withOptions

@tsed/config

Usage

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

See /packages/config/src/utils/withOptions.ts.

Overview

ts
function withOptions<Opts>(use: Type<ConfigSource<Opts>>, { name, priority, validationSchema, enabled, refreshOn, watch, ...opts }: InitialConfigSourceOptions & Opts): {
    name: string | undefined;
    priority: number | undefined;
    validationSchema: {
        toJSON(opts: Record<string, unknown>): Record<string, unknown> & {
            required?: string[];
        };
    } | undefined;
    use: Type<ConfigSource<Opts>>;
    watch: boolean | undefined;
    refreshOn: "request" | "response" | undefined;
    enabled: boolean;
    options: Omit<InitialConfigSourceOptions & Opts, "name" | "priority" | "enabled" | "validationSchema" | "watch" | "refreshOn">;
};

name

ts
name: string | undefined;

priority

ts
priority: number | undefined;

validationSchema

ts
validationSchema: {
     toJSON(opts: Record<string, unknown>): Record<string, unknown> & {
         required?: string[];
     };
 } | undefined;

use

ts
use: Type<ConfigSource<Opts>>;

watch

ts
watch: boolean | undefined;

refreshOn

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

enabled

ts
enabled: boolean;

options

ts
options: Omit<InitialConfigSourceOptions & Opts, "name" | "priority" | "enabled" | "validationSchema" | "watch" | "refreshOn">;

Released under the MIT License.