Read history data using custom modules

I found the function TagHistoryManager.queryHistory(TagHistoryQueryParams var1,StreamingDatasetWriter var2);
But I don’t know how to use it
Can anyone provide some help?
I will be very grateful.