I didn't know the whole cosmere when I wrote Elantris. In fact, a lot of the things I put into Elantris, like the shardpool, I put in feeling like I would connect them later on, but I had no idea how they were going to connect. By Mistborn, I did have all the cosmere. I have an advantage in that, because I took so long to publish, I was able to do a lot of practice books, and it let me really settle in on what I wanted to do, and I was able to build the cosmere... For instance, Dragonsteel (which I wrote after Elantris) is Hoid's backstory and his origin story and things like that. (And also has Bridge Four in it. Back then, they were on a different planet.) I was able to really experiment in Aether of Night with what shardpools meant, and the gods and the Shards of Adonalsium. You can read that one, that one's on the internet just for free. I think the easiest way to do it is to go to my forums and ask them for a copy. I told them they could give it away. It's not very good. It's not terrible, but it does have a lot of shardpool stuff in it, so if you're interested in that.
So by the time I wrote Mistborn, I knew what I was doing with all of this. And I think kind of retrofit to make sure Elantris still fit it all. Hoid still had an appearance, the Shardpools worked the way I wanted to, the magic systems were based off the cosmere magic, the realmatics were all consistent, and things like that.
People ask me a lot, "Where did you get the cosmere?" It was a gradual evolution during the unpublished novels, and then was done by the time I wrote Mistborn.