From 6c82b95ea29bc8d93d3f05c9f5e045c744f26199 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 30 Jan 2022 15:50:03 +0100 Subject: [PATCH] refactor(config): introduce new interface MediaBackendConfig This interface is needed to help to use types in some cases, where it didn't work before. Signed-off-by: Philip Molares --- src/config/media.config.ts | 50 ++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/config/media.config.ts b/src/config/media.config.ts index 542bfd3ca..62b11fc8d 100644 --- a/src/config/media.config.ts +++ b/src/config/media.config.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,29 +10,31 @@ import { BackendType } from '../media/backends/backend-type.enum'; import { buildErrorMessage } from './utils'; export interface MediaConfig { - backend: { - use: BackendType; - filesystem: { - uploadPath: string; - }; - s3: { - accessKeyId: string; - secretAccessKey: string; - bucket: string; - endPoint: string; - }; - azure: { - connectionString: string; - container: string; - }; - imgur: { - clientID: string; - }; - webdav: { - connectionString: string; - uploadDir: string; - publicUrl: string; - }; + backend: MediaBackendConfig; +} + +export interface MediaBackendConfig { + use: BackendType; + filesystem: { + uploadPath: string; + }; + s3: { + accessKeyId: string; + secretAccessKey: string; + bucket: string; + endPoint: string; + }; + azure: { + connectionString: string; + container: string; + }; + imgur: { + clientID: string; + }; + webdav: { + connectionString: string; + uploadDir: string; + publicUrl: string; }; }