Skip to content

Commit

Permalink
docs: use enum type instead of string (#1391)
Browse files Browse the repository at this point in the history
In several places, string was used as @type annotation for the documentation. This PR is replacing those string annotations with the corresponding enums.
  • Loading branch information
MarcusNotheis committed Mar 30, 2020
1 parent a0a2589 commit ca90fbf
Show file tree
Hide file tree
Showing 25 changed files with 36 additions and 33 deletions.
8 changes: 4 additions & 4 deletions packages/main/src/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const metadata = {
* <li><code>Circle</code></li>
* <li><code>Square</code></li>
* <ul>
* @type {string}
* @type {AvatarShape}
* @defaultvalue "Circle"
* @public
*/
Expand All @@ -91,7 +91,7 @@ const metadata = {
* <li><code>L</code></li>
* <li><code>XL</code></li>
* <ul>
* @type {string}
* @type {AvatarSize}
* @defaultvalue "S"
* @public
*/
Expand All @@ -108,7 +108,7 @@ const metadata = {
* <li><code>Cover</code></li>
* <li><code>Contain</code></li>
* <ul>
* @type {string}
* @type {AvatarFitType}
* @defaultvalue "Cover"
* @public
*/
Expand All @@ -134,7 +134,7 @@ const metadata = {
* <li><code>Accent10</code></li>
* <li><code>Placeholder</code></li>
* <ul>
* @type {string}
* @type {AvatarBackgroundColor}
* @defaultvalue "Accent6"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const metadata = {
* Defines the calendar type used for display.
* If not defined, the calendar type of the global configuration is used.
* Available options are: "Gregorian", "Islamic", "Japanese", "Buddhist" and "Persian".
* @type {string}
* @type {CalendarType}
* @public
*/
primaryCalendarType: {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/CheckBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const metadata = {
* <br><br>
* <b>Note:</b> Available options are <code>Warning</code>, <code>Error</code>, and <code>None</code> (default).
*
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const metadata = {
* <li><code>Information</code></li>
* </ul>
*
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const metadata = {
* <li><code>Information</code></li>
* </ul>
*
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
*/
Expand Down Expand Up @@ -119,7 +119,7 @@ const metadata = {
* <li><code>Persian</code></li>
* </ul>
*
* @type {string}
* @type {CalendarType}
* @defaultvalue "Gregorian"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/DayPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const metadata = {
/**
* Sets a calendar type used for display.
* If not set, the calendar type of the global configuration is used.
* @type {string}
* @type {CalendarType}
* @public
*/
primaryCalendarType: {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/FileUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const metadata = {
* <li><code>Information</code></li>
* </ul>
*
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const metadata = {
* that use different soft keyboard layouts depending on the given input type.</li>
* </ul>
*
* @type {string}
* @type {InputType}
* @defaultvalue "Text"
* @public
*/
Expand Down Expand Up @@ -204,7 +204,7 @@ const metadata = {
* <li><code>Information</code></li>
* </ul>
*
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const metadata = {
* <br><br>
* <b>Note:</b> Avaialble options are <code>Default</code>, <code>Subtle</code>, and <code>Emphasized</code>.
*
* @type {string}
* @type {LinkDesign}
* @defaultvalue "Default"
* @public
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const metadata = {
* <b>Note:</b> Avalaible options are <code>None</code>, <code>SingleSelect</code>,
* <code>MultiSelect</code>, and <code>Delete</code>.
*
* @type {string}
* @type {ListMode}
* @defaultvalue "None"
* @public
*/
Expand Down Expand Up @@ -127,7 +127,7 @@ const metadata = {
* item doesn't have a bottom separator.</li>
* </ul>
*
* @type {string}
* @type {ListSeparators}
* @defaultvalue "All"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const metadata = {
* <b>Note:</b> When set to <code>Active</code>, the item will provide visual response upon press and hover,
* while with type <code>Inactive</code> and <code>Detail</code> - will not.
*
* @type {string}
* @type {ListItemType}
* @defaultvalue "Active"
* @public
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/MessageStrip.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ const metadata = {
*
* See all the available icons in the <ui5-link target="_blank" href="https://openui5.hana.ondemand.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html" class="api-table-content-cell-link">Icon Explorer</ui5-link>.
*
* @type {string}
* @defaultvalue ""
* @type {HTMLElement}
* @slot
* @public
*/
"icon": {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/MonthPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const metadata = {
/**
* Sets a calendar type used for display.
* If not set, the calendar type of the global configuration is used.
* @type {string}
* @type {CalendarType}
* @public
*/
primaryCalendarType: {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/MultiComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const metadata = {
* <li><code>Information</code></li>
* </ul>
*
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/RadioButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const metadata = {
* <li><code>Warning</code></li>
* </ul>
*
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const metadata = {
* <li><code>Information</code></li>
* </ul>
*
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/main/src/StandardListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ const metadata = {
* Defines the state of the <code>info</code>.
* <br>
* Available options are: <code>"None"</code> (by default), <code>"Success"</code>, <code>"Warning"</code> and <code>"Erorr"</code>.
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
* @since 0.13.0
*/
Expand Down
6 changes: 4 additions & 2 deletions packages/main/src/SuggestionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ const metadata = {
* Defines the state of the <code>info</code>.
* <br><br>
* Available options are: <code>"None"</code> (by default), <code>"Success"</code>, <code>"Warning"</code> and <code>"Erorr"</code>.
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
*/
infoState: {
Expand All @@ -97,7 +98,8 @@ const metadata = {
* <b>Note:</b>
* When set, the other properties, such as <code>image</code>, <code>icon</code>, <code>description</code>, etc. will be omitted
* and only the <code>text</code> will be displayed.
* @type {string}
* @type {boolean}
* @defaultvalue false
* @public
*/
group: {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const metadata = {
*
* <br><br>
* <b>Note:</b> The color value depends on the current theme.
* @type {string}
* @type {SemanticColor}
* @defaultvalue "Default"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/TabContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const metadata = {
* <li><code>Inline</code></li>
* <ul>
*
* @type {string}
* @type {TabLayout}
* @defaultvalue "Standard"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/TimePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const metadata = {
* <li><code>Information</code></li>
* </ul>
*
* @type {string}
* @type {ValueState}
* @defaultvalue "None"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/TimelineItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const metadata = {
* Defines the name of the item.
*
* @type {string}
* @defaultvalue false
* @defaultvalue ""
* @public
*/
itemName: {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/Title.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const metadata = {
* Defines the <code>ui5-title</code> level.
* Available options are: <code>"H6"</code> to <code>"H1"</code>.
*
* @type {string}
* @type {TitleLevel}
* @defaultvalue "H2"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/Toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const metadata = {
* <li><code>BottomEnd</code></li>
* </ul>
*
* @type {string}
* @type {ToastPlacement}
* @defaultvalue "BottomCenter"
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/YearPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const metadata = {
/**
* Sets a calendar type used for display.
* If not set, the calendar type of the global configuration is used.
* @type {string}
* @type {CalendarType}
* @public
*/
primaryCalendarType: {
Expand Down

0 comments on commit ca90fbf

Please sign in to comment.