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 <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-01-30 15:50:03 +01:00
parent f4a580cf2a
commit 6c82b95ea2

View file

@ -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 * SPDX-License-Identifier: AGPL-3.0-only
*/ */
@ -10,7 +10,10 @@ import { BackendType } from '../media/backends/backend-type.enum';
import { buildErrorMessage } from './utils'; import { buildErrorMessage } from './utils';
export interface MediaConfig { export interface MediaConfig {
backend: { backend: MediaBackendConfig;
}
export interface MediaBackendConfig {
use: BackendType; use: BackendType;
filesystem: { filesystem: {
uploadPath: string; uploadPath: string;
@ -33,7 +36,6 @@ export interface MediaConfig {
uploadDir: string; uploadDir: string;
publicUrl: string; publicUrl: string;
}; };
};
} }
const mediaSchema = Joi.object({ const mediaSchema = Joi.object({