Some points.

1. Getting a Wordpress pwa up and running is not hard at all, despite what the article says. There are several plug and play plugins, including mine:

https://wordpress.org/plugins/lh-web-application/

2. The best solutions for this are plugins, not themes.

2. Service workers are powerful, flexible and there is no right way. So having a service worker api is not a good idea imo.