breaking(types): type arrays as read-only

Closes #1259
This commit is contained in:
Eric Liu 2022-06-04 13:25:53 -07:00
commit 3ffe9cddc0
14 changed files with 33 additions and 33 deletions

View file

@ -14,7 +14,7 @@
/** /**
* Specify the bound group * Specify the bound group
* @type {any[]} * @type {ReadonlyArray<any>}
*/ */
export let group = undefined; export let group = undefined;

View file

@ -8,7 +8,7 @@
/** /**
* Set the combobox items * Set the combobox items
* @type {ComboBoxItem[]} * @type {ReadonlyArray<ComboBoxItem>}
*/ */
export let items = []; export let items = [];

View file

@ -6,7 +6,7 @@
/** /**
* Specify an element or list of elements to trigger the context menu. * Specify an element or list of elements to trigger the context menu.
* If no element is specified, the context menu applies to the entire window * If no element is specified, the context menu applies to the entire window
* @type {null | HTMLElement | HTMLElement[]} * @type {null | ReadonlyArray<null | HTMLElement>}
*/ */
export let target = null; export let target = null;

View file

@ -1,5 +1,5 @@
<script> <script>
/** @type {string[]} */ /** @type {ReadonlyArray<string>} */
export let selectedIds = []; export let selectedIds = [];
/** Specify the label text */ /** Specify the label text */

View file

@ -24,14 +24,14 @@
/** /**
* Specify the data table headers * Specify the data table headers
* @type {DataTableHeader[]} * @type {ReadonlyArray<DataTableHeader>}
*/ */
export let headers = []; export let headers = [];
/** /**
* Specify the rows the data table should render * Specify the rows the data table should render
* keys defined in `headers` are used for the row ids * keys defined in `headers` are used for the row ids
* @type {DataTableRow[]} * @type {ReadonlyArray<DataTableRow>}
*/ */
export let rows = []; export let rows = [];
@ -66,13 +66,13 @@
/** /**
* Specify the row ids to be expanded * Specify the row ids to be expanded
* @type {DataTableRowId[]} * @type {ReadonlyArray<DataTableRowId>}
*/ */
export let expandedRowIds = []; export let expandedRowIds = [];
/** /**
* Specify the ids for rows that should not be expandable * Specify the ids for rows that should not be expandable
* @type {DataTableRowId[]} * @type {ReadonlyArray<DataTableRowId>}
*/ */
export let nonExpandableRowIds = []; export let nonExpandableRowIds = [];
@ -90,13 +90,13 @@
/** /**
* Specify the row ids to be selected * Specify the row ids to be selected
* @type {DataTableRowId[]} * @type {ReadonlyArray<DataTableRowId>}
*/ */
export let selectedRowIds = []; export let selectedRowIds = [];
/** /**
* Specify the ids of rows that should not be selectable * Specify the ids of rows that should not be selectable
* @type {DataTableRowId[]} * @type {ReadonlyArray<DataTableRowId>}
*/ */
export let nonSelectableRowIds = []; export let nonSelectableRowIds = [];

View file

@ -25,7 +25,7 @@
/** /**
* Set the column headers * Set the column headers
* Supersedes `columns` if value is a non-empty array * Supersedes `columns` if value is a non-empty array
* @type {string[] | Partial<DataTableHeader>[]} * @type {ReadonlyArray<string | Partial<DataTableHeader>>}
*/ */
export let headers = []; export let headers = [];

View file

@ -9,7 +9,7 @@
/** /**
* Set the dropdown items * Set the dropdown items
* @type {DropdownItem[]} * @type {ReadonlyArray<DropdownItem>}
*/ */
export let items = []; export let items = [];

View file

@ -1,8 +1,8 @@
<script> <script>
/** /**
* @event {File[]} add * @event {ReadonlyArray<File>} add
* @event {File[]} remove * @event {ReadonlyArray<File>} remove
* @event {File[]} change * @event {ReadonlyArray<File>} change
*/ */
/** /**
@ -16,13 +16,13 @@
/** /**
* Specify the accepted file types * Specify the accepted file types
* @type {string[]} * @type {ReadonlyArray<string>}
*/ */
export let accept = []; export let accept = [];
/** /**
* Obtain a reference to the uploaded files * Obtain a reference to the uploaded files
* @type {File[]} * @type {ReadonlyArray<File>}
*/ */
export let files = []; export let files = [];

View file

@ -1,17 +1,17 @@
<script> <script>
/** /**
* @event {File[]} change * @event {ReadonlyArray<File>} change
*/ */
/** /**
* Specify the accepted file types * Specify the accepted file types
* @type {string[]} * @type {ReadonlyArray<string>}
*/ */
export let accept = []; export let accept = [];
/** /**
* Obtain a reference to the uploaded files * Obtain a reference to the uploaded files
* @type {File[]} * @type {ReadonlyArray<File>}
*/ */
export let files = []; export let files = [];

View file

@ -1,18 +1,18 @@
<script> <script>
/** /**
* @event {File[]} add * @event {ReadonlyArray<File>} add
* @event {File[]} change * @event {ReadonlyArray<File>} change
*/ */
/** /**
* Specify the accepted file types * Specify the accepted file types
* @type {string[]} * @type {ReadonlyArray<string>}
*/ */
export let accept = []; export let accept = [];
/** /**
* Obtain a reference to the uploaded files * Obtain a reference to the uploaded files
* @type {File[]} * @type {ReadonlyArray<File>}
*/ */
export let files = []; export let files = [];
@ -20,9 +20,9 @@
export let multiple = false; export let multiple = false;
/** /**
* Override the default behavior of validating uploaded files * Override the default behavior of validating uploaded files.
* The default behavior does not validate files * By default, files are not validated
* @type {(files: File[]) => File[]} * @type {(files: ReadonlyArray<File>) => ReadonlyArray<File>}
*/ */
export let validateFiles = (files) => files; export let validateFiles = (files) => files;

View file

@ -11,7 +11,7 @@
/** /**
* Set the multiselect items * Set the multiselect items
* @type {MultiSelectItem[]} * @type {ReadonlyArray<MultiSelectItem>}
*/ */
export let items = []; export let items = [];
@ -29,7 +29,7 @@
/** /**
* Set the selected ids * Set the selected ids
* @type {MultiSelectItemId[]} * @type {ReadonlyArray<MultiSelectItemId>}
*/ */
export let selectedIds = []; export let selectedIds = [];

View file

@ -47,7 +47,7 @@
/** /**
* Specify the available page sizes * Specify the available page sizes
* @type {number[]} * @type {ReadonlyArray<number>}
*/ */
export let pageSizes = [10]; export let pageSizes = [10];

View file

@ -22,13 +22,13 @@
/** /**
* Set the node ids to be selected * Set the node ids to be selected
* @type {TreeNodeId[]} * @type {ReadonlyArray<TreeNodeId>}
*/ */
export let selectedIds = []; export let selectedIds = [];
/** /**
* Set the node ids to be expanded * Set the node ids to be expanded
* @type {TreeNodeId[]} * @type {ReadonlyArray<TreeNodeId>}
*/ */
export let expandedIds = []; export let expandedIds = [];

View file

@ -19,7 +19,7 @@
/** /**
* Render a list of search results * Render a list of search results
* @type {HeaderSearchResult[]} * @type {ReadonlyArray<HeaderSearchResult>}
*/ */
export let results = []; export let results = [];