JavaScript libraries often use the options pattern. All functionality options are represented by option classes, and have global default values represented by default option class instances. This way, the developer doesn't need to specify a whole option object that might contain hundreds of properties, but just the properties that differ from the default.
For instance, in the case of a graphic library, a very simplified option class might be something such as:
class GraphicStyle { pencilWidth: number; pencilType: string; foregroundColor: string; backgroundColor: string; colors(): string { return this.foregroundColor + " " + this.backgroundColor; } pencil(): string { return this.pencilWidth + " " + this.backgroundColor; ...