mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
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:
parent
1a904dda36
commit
260bf4e040
34 changed files with 257 additions and 192 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
/**
|
||||
* Specify the bound group
|
||||
* @type {any[]}
|
||||
* @type {ReadonlyArray<any>}
|
||||
*/
|
||||
export let group = undefined;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
/**
|
||||
* Set the combobox items
|
||||
* @type {ComboBoxItem[]}
|
||||
* @type {ReadonlyArray<ComboBoxItem>}
|
||||
*/
|
||||
export let items = [];
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/**
|
||||
* 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
|
||||
* @type {null | HTMLElement | HTMLElement[]}
|
||||
* @type {null | ReadonlyArray<null | HTMLElement>}
|
||||
*/
|
||||
export let target = null;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
/** @type {string[]} */
|
||||
/** @type {ReadonlyArray<string>} */
|
||||
export let selectedIds = [];
|
||||
|
||||
/** Specify the label text */
|
||||
|
|
|
@ -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 = [];
|
||||
|
||||
|
|
|
@ -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 = [];
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
/**
|
||||
* Set the dropdown items
|
||||
* @type {DropdownItem[]}
|
||||
* @type {ReadonlyArray<DropdownItem>}
|
||||
*/
|
||||
export let items = [];
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<script>
|
||||
/**
|
||||
* @event {File[]} add
|
||||
* @event {File[]} remove
|
||||
* @event {File[]} change
|
||||
* @event {ReadonlyArray<File>} add
|
||||
* @event {ReadonlyArray<File>} remove
|
||||
* @event {ReadonlyArray<File>} change
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -16,13 +16,13 @@
|
|||
|
||||
/**
|
||||
* Specify the accepted file types
|
||||
* @type {string[]}
|
||||
* @type {ReadonlyArray<string>}
|
||||
*/
|
||||
export let accept = [];
|
||||
|
||||
/**
|
||||
* Obtain a reference to the uploaded files
|
||||
* @type {File[]}
|
||||
* @type {ReadonlyArray<File>}
|
||||
*/
|
||||
export let files = [];
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<script>
|
||||
/**
|
||||
* @event {File[]} change
|
||||
* @event {ReadonlyArray<File>} change
|
||||
*/
|
||||
|
||||
/**
|
||||
* Specify the accepted file types
|
||||
* @type {string[]}
|
||||
* @type {ReadonlyArray<string>}
|
||||
*/
|
||||
export let accept = [];
|
||||
|
||||
/**
|
||||
* Obtain a reference to the uploaded files
|
||||
* @type {File[]}
|
||||
* @type {ReadonlyArray<File>}
|
||||
*/
|
||||
export let files = [];
|
||||
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
<script>
|
||||
/**
|
||||
* @event {File[]} add
|
||||
* @event {File[]} change
|
||||
* @event {ReadonlyArray<File>} add
|
||||
* @event {ReadonlyArray<File>} change
|
||||
*/
|
||||
|
||||
/**
|
||||
* Specify the accepted file types
|
||||
* @type {string[]}
|
||||
* @type {ReadonlyArray<string>}
|
||||
*/
|
||||
export let accept = [];
|
||||
|
||||
/**
|
||||
* Obtain a reference to the uploaded files
|
||||
* @type {File[]}
|
||||
* @type {ReadonlyArray<File>}
|
||||
*/
|
||||
export let files = [];
|
||||
|
||||
|
@ -20,9 +20,9 @@
|
|||
export let multiple = false;
|
||||
|
||||
/**
|
||||
* Override the default behavior of validating uploaded files
|
||||
* The default behavior does not validate files
|
||||
* @type {(files: File[]) => File[]}
|
||||
* Override the default behavior of validating uploaded files.
|
||||
* By default, files are not validated
|
||||
* @type {(files: ReadonlyArray<File>) => ReadonlyArray<File>}
|
||||
*/
|
||||
export let validateFiles = (files) => files;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
/**
|
||||
* Set the multiselect items
|
||||
* @type {MultiSelectItem[]}
|
||||
* @type {ReadonlyArray<MultiSelectItem>}
|
||||
*/
|
||||
export let items = [];
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
|||
|
||||
/**
|
||||
* Set the selected ids
|
||||
* @type {MultiSelectItemId[]}
|
||||
* @type {ReadonlyArray<MultiSelectItemId>}
|
||||
*/
|
||||
export let selectedIds = [];
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
/**
|
||||
* Specify the available page sizes
|
||||
* @type {number[]}
|
||||
* @type {ReadonlyArray<number>}
|
||||
*/
|
||||
export let pageSizes = [10];
|
||||
|
||||
|
|
|
@ -22,13 +22,13 @@
|
|||
|
||||
/**
|
||||
* Set the node ids to be selected
|
||||
* @type {TreeNodeId[]}
|
||||
* @type {ReadonlyArray<TreeNodeId>}
|
||||
*/
|
||||
export let selectedIds = [];
|
||||
|
||||
/**
|
||||
* Set the node ids to be expanded
|
||||
* @type {TreeNodeId[]}
|
||||
* @type {ReadonlyArray<TreeNodeId>}
|
||||
*/
|
||||
export let expandedIds = [];
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
/**
|
||||
* Render a list of search results
|
||||
* @type {HeaderSearchResult[]}
|
||||
* @type {ReadonlyArray<HeaderSearchResult>}
|
||||
*/
|
||||
export let results = [];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue