Skip to content
Commit df05295f authored by dpapad's avatar dpapad Committed by Chromium LUCI CQ
Browse files

PrintPreview: Init <print-preview-model> settings in a type safe way.

Previously the 'settings' member variable was initialized as part of
the Polymer property definition which is not type checked. Extracting
the initialization to a helper createSettings() function makes the code
have better TypeScript type coverage.

For example after this change, adding any new properties without
updating the Settings interface will throw a build time error as
follows

TS2353: Object literal may only specify known properties, and 'foo' does not exist in type 'Settings'.

whereas previously it would erroneously pass type checking.

Bug: 331681689
Change-Id: I47b480dfc56e36c76e8858ebda0679a991164af1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5420660


Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1282186}
parent c99c54cd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment