Commit 0b9bed6e authored by Gavin Williams's avatar Gavin Williams Committed by Commit Bot

scanning: Clean up type annotations

Remove redundant ! from {!string} on string properties as primitives are
non-nullable by default.

Remove ? from {?string} on string properties as we do not need nullable
strings since we do not explicitly set strings to null or check for null
strings in Scanning.

Bug: 1059779
Change-Id: I9e0f9e1d1c08822319d00867a449318c8f59f0d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2511789Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Reviewed-by: default avatarJesse Schettler <jschettler@chromium.org>
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823344}
parent a299f8ef
...@@ -30,7 +30,7 @@ Polymer({ ...@@ -30,7 +30,7 @@ Polymer({
value: () => [], value: () => [],
}, },
/** @type {?string} */ /** @type {string} */
selectedColorMode: { selectedColorMode: {
type: String, type: String,
notify: true, notify: true,
...@@ -40,8 +40,8 @@ Polymer({ ...@@ -40,8 +40,8 @@ Polymer({
observers: ['onNumOptionsChange(colorModes.length)'], observers: ['onNumOptionsChange(colorModes.length)'],
/** /**
* @param {number} mojoColorMode * @param {chromeos.scanning.mojom.ColorMode} mojoColorMode
* @return {!string} * @return {string}
* @private * @private
*/ */
getColorModeString_(mojoColorMode) { getColorModeString_(mojoColorMode) {
......
...@@ -23,7 +23,7 @@ Polymer({ ...@@ -23,7 +23,7 @@ Polymer({
behaviors: [I18nBehavior, SelectBehavior], behaviors: [I18nBehavior, SelectBehavior],
properties: { properties: {
/** @type {?string} */ /** @type {string} */
selectedFileType: { selectedFileType: {
type: String, type: String,
notify: true, notify: true,
......
...@@ -30,7 +30,7 @@ Polymer({ ...@@ -30,7 +30,7 @@ Polymer({
value: () => [], value: () => [],
}, },
/** @type {?string} */ /** @type {string} */
selectedPageSize: { selectedPageSize: {
type: String, type: String,
notify: true, notify: true,
...@@ -41,7 +41,7 @@ Polymer({ ...@@ -41,7 +41,7 @@ Polymer({
/** /**
* @param {chromeos.scanning.mojom.PageSize} pageSize * @param {chromeos.scanning.mojom.PageSize} pageSize
* @return {!string} * @return {string}
* @private * @private
*/ */
getPageSizeString_(pageSize) { getPageSizeString_(pageSize) {
......
...@@ -30,7 +30,7 @@ Polymer({ ...@@ -30,7 +30,7 @@ Polymer({
value: () => [], value: () => [],
}, },
/** @type {?string} */ /** @type {string} */
selectedResolution: { selectedResolution: {
type: String, type: String,
notify: true, notify: true,
...@@ -41,7 +41,7 @@ Polymer({ ...@@ -41,7 +41,7 @@ Polymer({
/** /**
* @param {number} resolution * @param {number} resolution
* @return {!string} * @return {string}
* @private * @private
*/ */
getResolutionString_(resolution) { getResolutionString_(resolution) {
......
...@@ -35,7 +35,7 @@ Polymer({ ...@@ -35,7 +35,7 @@ Polymer({
value: () => [], value: () => [],
}, },
/** @type {?string} */ /** @type {string} */
selectedScannerId: { selectedScannerId: {
type: String, type: String,
notify: true, notify: true,
......
...@@ -48,14 +48,11 @@ Polymer({ ...@@ -48,14 +48,11 @@ Polymer({
/** @private {?chromeos.scanning.mojom.ScanServiceInterface} */ /** @private {?chromeos.scanning.mojom.ScanServiceInterface} */
scanService_: null, scanService_: null,
/** @private {!Map<!string, !mojoBase.mojom.UnguessableToken>} */ /** @private {!Map<string, !mojoBase.mojom.UnguessableToken>} */
scannerIds_: new Map(), scannerIds_: new Map(),
properties: { properties: {
/** /** @private {!ScannerArr} */
* @type {!ScannerArr}
* @private
*/
scanners_: { scanners_: {
type: Array, type: Array,
value: () => [], value: () => [],
...@@ -67,59 +64,50 @@ Polymer({ ...@@ -67,59 +64,50 @@ Polymer({
observer: 'onSelectedScannerIdChange_', observer: 'onSelectedScannerIdChange_',
}, },
/** /** @private {?chromeos.scanning.mojom.ScannerCapabilities} */
* @type {?chromeos.scanning.mojom.ScannerCapabilities}
* @private
*/
capabilities_: Object, capabilities_: Object,
/** @type {?string} */ /** @type {string} */
selectedSource: String, selectedSource: String,
/** @type {?string} */ /** @type {string} */
selectedFileType: String, selectedFileType: String,
/** @type {string} */ /** @type {string} */
selectedFilePath: String, selectedFilePath: String,
/** @type {?string} */ /** @type {string} */
selectedColorMode: String, selectedColorMode: String,
/** @type {?string} */ /** @type {string} */
selectedPageSize: String, selectedPageSize: String,
/** @type {?string} */ /** @type {string} */
selectedResolution: String, selectedResolution: String,
/** /** @private {!Array<chromeos.scanning.mojom.PageSize>} */
* @type {!Array<chromeos.scanning.mojom.PageSize>}
* @private
*/
selectedSourcePageSizes_: { selectedSourcePageSizes_: {
type: Array, type: Array,
value: () => [], value: () => [],
computed: 'computePageSizes_(selectedSource)', computed: 'computePageSizes_(selectedSource)',
}, },
/** /** @private {string} */
* @type {?string}
* @private
*/
statusText_: String, statusText_: String,
/** @private */ /** @private {boolean} */
settingsDisabled_: { settingsDisabled_: {
type: Boolean, type: Boolean,
value: false, value: false,
}, },
/** @private */ /** @private {boolean} */
scanButtonDisabled_: { scanButtonDisabled_: {
type: Boolean, type: Boolean,
value: true, value: true,
}, },
/** @private */ /** @private {boolean} */
loaded_: { loaded_: {
type: Boolean, type: Boolean,
value: false, value: false,
...@@ -141,7 +129,7 @@ Polymer({ ...@@ -141,7 +129,7 @@ Polymer({
}, },
/** /**
* @param {?string} selectedSource * @param {string} selectedSource
* @return {!Array<chromeos.scanning.mojom.PageSize>} * @return {!Array<chromeos.scanning.mojom.PageSize>}
* @private * @private
*/ */
......
...@@ -7,7 +7,7 @@ import {assertNotReached} from 'chrome://resources/js/assert.m.js'; ...@@ -7,7 +7,7 @@ import {assertNotReached} from 'chrome://resources/js/assert.m.js';
/** /**
* Converts a chromeos.scanning.mojom.ColorMode string to the corresponding enum * Converts a chromeos.scanning.mojom.ColorMode string to the corresponding enum
* value. * value.
* @param {!string} colorModeString * @param {string} colorModeString
* @return {chromeos.scanning.mojom.ColorMode} * @return {chromeos.scanning.mojom.ColorMode}
*/ */
export function colorModeFromString(colorModeString) { export function colorModeFromString(colorModeString) {
...@@ -47,8 +47,8 @@ export function fileTypeFromString(fileTypeString) { ...@@ -47,8 +47,8 @@ export function fileTypeFromString(fileTypeString) {
/** /**
* Converts a chromeos.scanning.mojom.ColorMode to a string that can be * Converts a chromeos.scanning.mojom.ColorMode to a string that can be
* displayed in the color mode dropdown. * displayed in the color mode dropdown.
* @param {number} mojoColorMode * @param {chromeos.scanning.mojom.ColorMode} mojoColorMode
* @return {!string} * @return {string}
*/ */
export function getColorModeString(mojoColorMode) { export function getColorModeString(mojoColorMode) {
// TODO(jschettler): Replace with finalized i18n strings. // TODO(jschettler): Replace with finalized i18n strings.
...@@ -69,7 +69,7 @@ export function getColorModeString(mojoColorMode) { ...@@ -69,7 +69,7 @@ export function getColorModeString(mojoColorMode) {
* Converts a chromeos.scanning.mojom.PageSize to a string that can be * Converts a chromeos.scanning.mojom.PageSize to a string that can be
* displayed in the page size dropdown. * displayed in the page size dropdown.
* @param {chromeos.scanning.mojom.PageSize} pageSize * @param {chromeos.scanning.mojom.PageSize} pageSize
* @return {!string} * @return {string}
*/ */
export function getPageSizeString(pageSize) { export function getPageSizeString(pageSize) {
// TODO(jschettler): Replace with finalized i18n strings. // TODO(jschettler): Replace with finalized i18n strings.
...@@ -89,8 +89,8 @@ export function getPageSizeString(pageSize) { ...@@ -89,8 +89,8 @@ export function getPageSizeString(pageSize) {
/** /**
* Converts a chromeos.scanning.mojom.SourceType to a string that can be * Converts a chromeos.scanning.mojom.SourceType to a string that can be
* displayed in the source dropdown. * displayed in the source dropdown.
* @param {number} mojoSourceType * @param {chromeos.scanning.mojom.SourceType} mojoSourceType
* @return {!string} * @return {string}
*/ */
export function getSourceTypeString(mojoSourceType) { export function getSourceTypeString(mojoSourceType) {
// TODO(jschettler): Replace with finalized i18n strings. // TODO(jschettler): Replace with finalized i18n strings.
...@@ -113,7 +113,7 @@ export function getSourceTypeString(mojoSourceType) { ...@@ -113,7 +113,7 @@ export function getSourceTypeString(mojoSourceType) {
/** /**
* Converts a chromeos.scanning.mojom.PageSize string to the corresponding enum * Converts a chromeos.scanning.mojom.PageSize string to the corresponding enum
* value. * value.
* @param {!string} pageSizeString * @param {string} pageSizeString
* @return {chromeos.scanning.mojom.PageSize} * @return {chromeos.scanning.mojom.PageSize}
*/ */
export function pageSizeFromString(pageSizeString) { export function pageSizeFromString(pageSizeString) {
...@@ -134,7 +134,7 @@ export function pageSizeFromString(pageSizeString) { ...@@ -134,7 +134,7 @@ export function pageSizeFromString(pageSizeString) {
* Converts an unguessable token to a string by combining the high and low * Converts an unguessable token to a string by combining the high and low
* values as strings with a hashtag as the separator. * values as strings with a hashtag as the separator.
* @param {!mojoBase.mojom.UnguessableToken} token * @param {!mojoBase.mojom.UnguessableToken} token
* @return {!string} * @return {string}
*/ */
export function tokenToString(token) { export function tokenToString(token) {
return `${token.high.toString()}#${token.low.toString()}`; return `${token.high.toString()}#${token.low.toString()}`;
......
...@@ -28,6 +28,7 @@ export const SelectBehavior = { ...@@ -28,6 +28,7 @@ export const SelectBehavior = {
/** /**
* The number of options in the select element. * The number of options in the select element.
* @type {number}
* @private * @private
*/ */
numOptions_: { numOptions_: {
......
...@@ -30,7 +30,7 @@ Polymer({ ...@@ -30,7 +30,7 @@ Polymer({
value: () => [], value: () => [],
}, },
/** @type {?string} */ /** @type {string} */
selectedSource: { selectedSource: {
type: String, type: String,
notify: true, notify: true,
...@@ -40,8 +40,8 @@ Polymer({ ...@@ -40,8 +40,8 @@ Polymer({
observers: ['onNumOptionsChange(sources.length)'], observers: ['onNumOptionsChange(sources.length)'],
/** /**
* @param {number} mojoSourceType * @param {chromeos.scanning.mojom.SourceType} mojoSourceType
* @return {!string} * @return {string}
* @private * @private
*/ */
getSourceTypeString_(mojoSourceType) { getSourceTypeString_(mojoSourceType) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment