We currently don't have any script API allowing to test immediately that a Document or a DocumentReference refers to a terminal page, would be handy to have it.