How nextcloud handle different files

how nextcloud handle different files
if I am installing officeonline it will open the office files with officeonline server if the file is from draw.iotypes it will open it with this editor ??
I want to build app that open cad files but how to make files from this type open with my app

Take a look at https://github.com/nextcloud/richdocuments/blob/master/src/files.js. I think that is how the office app registers itself as file open action.