It's worth to point out that the people in Star Trek
are seeing glimpses of possible futures all the time ("All Good Things...", "The Visitor", "Future's End", "Before and After", "Timeless", "Relativity", "Endgame", "Shockwave", "Future Tense", "Azati Prime").
At least some of these events have been recorded as log entries and so forth. So if people are writing stories about the future in the 22nd-24th centuries these could at least partially be based on facts rather than fiction. Or at least they know which future scenarios are plausible and which ones are less plausible.