Ionic downloader catch finish download

Hello guys. i use downloader for my apk. mys code is:

var req: DownloadRequest = {
                  uri: '',
                  title: 'TryMe' ,
                  description: 'TryMe',
                  mimeType: "video/mp4",
                  visibleInDownloadsUi: true,
                  notificationVisibility: NotificationVisibility.VisibleNotifyCompleted,
                  destinationInExternalFilesDir: {
                    dirType: 'Downloads',
                    subPath: 'MyFile.apk',
      .then((location: string) => {
      }).catch((err) => {
        alert("DWN ser Err 42: " + JSON.stringify(err))
        return "";

i want to stop another functions when file is downloading. The program and functions are continue when downloading is finish. how can i do it?

Can you elaborate here on what “another functions” means, what “stopping” it would constitute, and why you want to do this?

Thousands of people have spent millions of hours in an effort to facilitate at least the illusion that web applications are capable of doing more than one thing at a time, and something that fits the paradigm of cooperative multitasking that we’re stuck with because JavaScript almost perfectly is a file download. It needs no user interaction generally, needs resources sporadically, and is at the mercy of a relatively slow chokepoint (the network throughput). Generally, people are ecstatic when apps continue to be responsive while work happens in the background, so it can’t be that you want to lock up the entire UI during this file download, right?

I must not be understanding the fundamental goal here.

i am curious about a function like ‘success’ or ‘done’ function which is when download is finished. is it clear?

Sorry, it is not clear at all.