breaking(types): type arrays as read-only (#1335)

Closes #1259

* breaking(types): type arrays as read-only

* Run "yarn build:docs"

* test: assert read-only arrays
This commit is contained in:
metonym 2022-06-05 13:25:43 -07:00 committed by GitHub
commit 260bf4e040
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 257 additions and 192 deletions

View file

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

View file

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