I recommend rewriting the file thusly to remove errors:
declare module "filepond-plugin-file-rename" {
const FilepondPluginFileRename: FilepondPluginFilepondPluginFileRenameProps;
export interface FilepondPluginFilepondPluginFileRenameProps {
/** Enable or disable file renaming */
allowFileRename: boolean;
/** A function that receives an objecting containing file information like basename, extension and name. It should return either a string value or a Promise that resolves with a string value. */
fileRenameFunction: undefined | null | (
(options: {
basename: string;
extension: string;
name: string;
}
) => string
) | Promise<string>;
}
export default FilepondPluginFileRename;
}
Note the important changes:
added parentheses around the function type in fileRenameFunction
added parameter name options to the first parameter of the function type in fileRenameFunction
deleted percent sign at end of file
These changes are intended to fix syntax errors; they shouldn't add or remove any functionality as far as I know.
The file at location
types/index.d.ts
is throwing typescript errors:I am using Typescript 3.9.7
I recommend rewriting the file thusly to remove errors:
Note the important changes:
options
to the first parameter of the function type in fileRenameFunctionThese changes are intended to fix syntax errors; they shouldn't add or remove any functionality as far as I know.