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({
value: () => [],
},
/** @type {?string} */
/** @type {string} */
selectedColorMode: {
type: String,
notify: true,
......@@ -40,8 +40,8 @@ Polymer({
observers: ['onNumOptionsChange(colorModes.length)'],
/**
* @param {number} mojoColorMode
* @return {!string}
* @param {chromeos.scanning.mojom.ColorMode} mojoColorMode
* @return {string}
* @private
*/
getColorModeString_(mojoColorMode) {
......
......@@ -23,7 +23,7 @@ Polymer({
behaviors: [I18nBehavior, SelectBehavior],
properties: {
/** @type {?string} */
/** @type {string} */
selectedFileType: {
type: String,
notify: true,
......
......@@ -30,7 +30,7 @@ Polymer({
value: () => [],
},
/** @type {?string} */
/** @type {string} */
selectedPageSize: {
type: String,
notify: true,
......@@ -41,7 +41,7 @@ Polymer({
/**
* @param {chromeos.scanning.mojom.PageSize} pageSize
* @return {!string}
* @return {string}
* @private
*/
getPageSizeString_(pageSize) {
......
......@@ -30,7 +30,7 @@ Polymer({
value: () => [],
},
/** @type {?string} */
/** @type {string} */
selectedResolution: {
type: String,
notify: true,
......@@ -41,7 +41,7 @@ Polymer({
/**
* @param {number} resolution
* @return {!string}
* @return {string}
* @private
*/
getResolutionString_(resolution) {
......
......@@ -35,7 +35,7 @@ Polymer({
value: () => [],
},
/** @type {?string} */
/** @type {string} */
selectedScannerId: {
type: String,
notify: true,
......
......@@ -48,14 +48,11 @@ Polymer({
/** @private {?chromeos.scanning.mojom.ScanServiceInterface} */
scanService_: null,
/** @private {!Map<!string, !mojoBase.mojom.UnguessableToken>} */
/** @private {!Map<string, !mojoBase.mojom.UnguessableToken>} */
scannerIds_: new Map(),
properties: {
/**
* @type {!ScannerArr}
* @private
*/
/** @private {!ScannerArr} */
scanners_: {
type: Array,
value: () => [],
......@@ -67,59 +64,50 @@ Polymer({
observer: 'onSelectedScannerIdChange_',
},
/**
* @type {?chromeos.scanning.mojom.ScannerCapabilities}
* @private
*/
/** @private {?chromeos.scanning.mojom.ScannerCapabilities} */
capabilities_: Object,
/** @type {?string} */
/** @type {string} */
selectedSource: String,
/** @type {?string} */
/** @type {string} */
selectedFileType: String,
/** @type {string} */
selectedFilePath: String,
/** @type {?string} */
/** @type {string} */
selectedColorMode: String,
/** @type {?string} */
/** @type {string} */
selectedPageSize: String,
/** @type {?string} */
/** @type {string} */
selectedResolution: String,
/**
* @type {!Array<chromeos.scanning.mojom.PageSize>}
* @private
*/
/** @private {!Array<chromeos.scanning.mojom.PageSize>} */
selectedSourcePageSizes_: {
type: Array,
value: () => [],
computed: 'computePageSizes_(selectedSource)',
},
/**
* @type {?string}
* @private
*/
/** @private {string} */
statusText_: String,
/** @private */
/** @private {boolean} */
settingsDisabled_: {
type: Boolean,
value: false,
},
/** @private */
/** @private {boolean} */
scanButtonDisabled_: {
type: Boolean,
value: true,
},
/** @private */
/** @private {boolean} */
loaded_: {
type: Boolean,
value: false,
......@@ -141,7 +129,7 @@ Polymer({
},
/**
* @param {?string} selectedSource
* @param {string} selectedSource
* @return {!Array<chromeos.scanning.mojom.PageSize>}
* @private
*/
......
......@@ -7,7 +7,7 @@ import {assertNotReached} from 'chrome://resources/js/assert.m.js';
/**
* Converts a chromeos.scanning.mojom.ColorMode string to the corresponding enum
* value.
* @param {!string} colorModeString
* @param {string} colorModeString
* @return {chromeos.scanning.mojom.ColorMode}
*/
export function colorModeFromString(colorModeString) {
......@@ -47,8 +47,8 @@ export function fileTypeFromString(fileTypeString) {
/**
* Converts a chromeos.scanning.mojom.ColorMode to a string that can be
* displayed in the color mode dropdown.
* @param {number} mojoColorMode
* @return {!string}
* @param {chromeos.scanning.mojom.ColorMode} mojoColorMode
* @return {string}
*/
export function getColorModeString(mojoColorMode) {
// TODO(jschettler): Replace with finalized i18n strings.
......@@ -69,7 +69,7 @@ export function getColorModeString(mojoColorMode) {
* Converts a chromeos.scanning.mojom.PageSize to a string that can be
* displayed in the page size dropdown.
* @param {chromeos.scanning.mojom.PageSize} pageSize
* @return {!string}
* @return {string}
*/
export function getPageSizeString(pageSize) {
// TODO(jschettler): Replace with finalized i18n strings.
......@@ -89,8 +89,8 @@ export function getPageSizeString(pageSize) {
/**
* Converts a chromeos.scanning.mojom.SourceType to a string that can be
* displayed in the source dropdown.
* @param {number} mojoSourceType
* @return {!string}
* @param {chromeos.scanning.mojom.SourceType} mojoSourceType
* @return {string}
*/
export function getSourceTypeString(mojoSourceType) {
// TODO(jschettler): Replace with finalized i18n strings.
......@@ -113,7 +113,7 @@ export function getSourceTypeString(mojoSourceType) {
/**
* Converts a chromeos.scanning.mojom.PageSize string to the corresponding enum
* value.
* @param {!string} pageSizeString
* @param {string} pageSizeString
* @return {chromeos.scanning.mojom.PageSize}
*/
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
* values as strings with a hashtag as the separator.
* @param {!mojoBase.mojom.UnguessableToken} token
* @return {!string}
* @return {string}
*/
export function tokenToString(token) {
return `${token.high.toString()}#${token.low.toString()}`;
......
......@@ -28,6 +28,7 @@ export const SelectBehavior = {
/**
* The number of options in the select element.
* @type {number}
* @private
*/
numOptions_: {
......
......@@ -30,7 +30,7 @@ Polymer({
value: () => [],
},
/** @type {?string} */
/** @type {string} */
selectedSource: {
type: String,
notify: true,
......@@ -40,8 +40,8 @@ Polymer({
observers: ['onNumOptionsChange(sources.length)'],
/**
* @param {number} mojoSourceType
* @return {!string}
* @param {chromeos.scanning.mojom.SourceType} mojoSourceType
* @return {string}
* @private
*/
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