قُلْ لَا يَعْلَمُ مَنْ فِي السَّمَاوَاتِ وَالْأَرْضِ الْغَيْبَ إِلَّا اللَّهُ
Say: None in the heavens or the earth knows the unseen except Allah. (An-Naml 27:65)
Inherent, complete knowledge of the unseen belongs uniquely to Allah. Whatever unseen matters are disclosed to a Prophet become known through divine revelation and bestowal.
Given knowledge must not be equated with inherent divine knowledge.