Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit ce145c4

Browse files
committed
WIP: Export types and update README
1 parent 89c454a commit ce145c4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/mdc-chips/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,16 +307,16 @@ Method Signature | Description
307307

308308
Property | Value Type | Description
309309
--- | --- | ---
310-
`chips` | Array<`MDCChip`> | An array of the `MDCChip` objects that represent chips in the set
311-
`selectedChipIds` | `!Array<string>` (read-only) | An array of the IDs of all selected chips
310+
`chips` | `MDCChip[]` | An array of the `MDCChip` objects that represent chips in the set
311+
`selectedChipIds` | `string[]` (read-only) | An array of the IDs of all selected chips
312312

313313
## Usage within Web Frameworks
314314

315315
If you are using a JavaScript framework, such as React or Angular, you can create Chips for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).
316316

317317
### Adapters: `MDCChipAdapter` and `MDCChipSetAdapter`
318318

319-
See [`chip/index.js`](chip/index.js) and [`chip-set/index.js`](chip-set/index.js) for vanilla DOM implementations of these adapter APIs for reference.
319+
See [`chip/index.ts`](chip/index.ts) and [`chip-set/index.ts`](chip-set/index.ts) for vanilla DOM implementations of these adapter APIs for reference.
320320

321321
#### `MDCChipAdapter`
322322

@@ -336,7 +336,7 @@ Method Signature | Description
336336
`setStyleProperty(propertyName: string, value: string) => void` | Sets the property value of the given style property on the root element
337337
`hasLeadingIcon() => boolean` | Returns whether the chip has a leading icon
338338
`getRootBoundingClientRect() => ClientRect` | Returns the bounding client rect of the root element
339-
`getCheckmarkBoundingClientRect() => ?ClientRect` | Returns the bounding client rect of the checkmark element or null if it doesn't exist
339+
`getCheckmarkBoundingClientRect() => ClientRect \| null` | Returns the bounding client rect of the checkmark element or null if it doesn't exist
340340

341341
> \*_NOTE_: `notifyInteraction` and `notifyTrailingIconInteraction` must pass along the target chip's ID, and must be observable by the parent `mdc-chip-set` element (e.g. via DOM event bubbling).
342342
@@ -382,7 +382,7 @@ Events | Element Selector | Foundation Handler
382382

383383
Method Signature | Description
384384
--- | ---
385-
`getSelectedChipIds() => !Array<string>` | Returns an array of the IDs of all selected chips
385+
`getSelectedChipIds() => string[]` | Returns an array of the IDs of all selected chips
386386
`select(chipId: string) => void` | Selects the chip with the given id
387387
`handleChipInteraction(chipId: string) => void` | Handles a custom `MDCChip:interaction` event on the root element
388388
`handleChipSelection(chipId: string, selected: boolean) => void` | Handles a custom `MDCChip:selection` event on the root element

packages/mdc-chips/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
export * from './chip/adapter';
2525
export * from './chip/foundation';
2626
export * from './chip/index';
27+
export * from './chip/types';
2728
export * from './chip-set/adapter';
2829
export * from './chip-set/foundation';
2930
export * from './chip-set/index';

0 commit comments

Comments
 (0)