/** * SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later or LGPL-3.0-or-later */ export declare const InvalidFilenameErrorReason: Readonly<{ ReservedName: "reserved name"; Character: "character"; Extension: "extension"; }>; export type TInvalidFilenameErrorReason = typeof InvalidFilenameErrorReason[keyof typeof InvalidFilenameErrorReason]; interface InvalidFilenameErrorOptions { /** * The filename that was validated */ filename: string; /** * Reason why the validation failed */ reason: TInvalidFilenameErrorReason; /** * Part of the filename that caused this error */ segment: string; } export declare class InvalidFilenameError extends Error { constructor(options: InvalidFilenameErrorOptions); /** * The filename that was validated */ get filename(): string; /** * Reason why the validation failed */ get reason(): TInvalidFilenameErrorReason; /** * Part of the filename that caused this error */ get segment(): string; } /** * Validate a given filename * * @param filename The filename to check * @throws {InvalidFilenameError} */ export declare function validateFilename(filename: string): void; /** * Check the validity of a filename * This is a convenient wrapper for `checkFilenameValidity` to only return a boolean for the valid * * @param filename Filename to check validity */ export declare function isFilenameValid(filename: string): boolean; export {};