Not sure what you are trying to achieve here, care to elaborate?
Do you want to share files on YOUR computer with the world?
Or you want to access another persons computer to browse their files (they shared out)?
If the latter then maybe you could look at VPN Virtual private network - Wikipedia
If it is the former then perhaps hosting your private cloud would be better? Have a look at NextCloud. https://nextcloud.com/
I’m going to guess you don’t have a static WAN IP address, in which case you can’t reliably share your files via the web without a third party being involved.
(because your external IP would keep changing, so you’d never be guaranteed to have a static known IP to connect to)
There are companies that use their DNS service to effectively give you a static hostname that’s translated to your dynamic IP, but you have to run client side software that keeps their system updated with your current IP (so that’s third party involvement).
VNC, VPN, or even hosting NextCloud would all require a dynamic DNS service if you don’t have a static IP … the Teamviewer client is doing the same thing (as well as providing the front end connection software).
I guess there’s Resilio Sync (formerly BitTorrent Sync) which uses P2P technology to sync folders but that’s not really a perfect fit, and P2P also technically includes third parties.