The document file (*.document.ts) is an optional file that extends your scalar with custom methods using the by() function. While constant.ts defines the data structure and dictionary.ts provides translations, document.ts adds runtime behavior and utility methods.
This guide covers the by() function syntax, when to use document.ts, and patterns for adding methods.