DeprecationWarning: Parse.Cloud.beforeSaveFile -> Typescript

Hi,
DeprecationWarning: Parse.Cloud.beforeSaveFile is deprecated and will be removed in a future version. Use Parse.Cloud.beforeSave(Parse.File, (request) => {})
but in TypeScript “Parse.File” isn’t recognize

Do you have a solution ?

I never used a parse-server with Typescript but, If you’re sure that Parse.File exists at runtime and it’s just a TypeScript issue, you could use a type assertion to any:

typescript

Parse.Cloud.beforeSave('file' as any, (request) => {
  // your logic here
});

Parse’s types are managed in the DefinitelyTyped repo, you can submit a PR there to update types :blush: