Skip to content

Commit

Permalink
fix(tree): exclude the correct type from interface argument
Browse files Browse the repository at this point in the history
- at some point in time the `exclude` got split and renamed into 2 new types to better identify if it's collapsed or expanded, so the 2 types are: `toggle-expand` and `toggle-collapse` but it seems that TypeScript is not able to identify when the type to exclude is valid or not.
  • Loading branch information
ghiscoding committed Jul 21, 2021
1 parent a9680c3 commit af51784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/common/src/services/treeData.service.ts
Expand Up @@ -114,7 +114,7 @@ export class TreeDataService {
* @param {Boolean} shouldPreProcessFullToggle - should we pre-process a full toggle on all items? defaults to True
* @param {Boolean} shouldTriggerEvent - should we trigger a toggled item event? defaults to False
*/
applyToggledItemStateChanges(treeToggledItems: TreeToggledItem[], previousFullToggleType?: Exclude<ToggleStateChangeType, 'toggle'> | Exclude<ToggleStateChangeTypeString, 'toggle'>, shouldPreProcessFullToggle = true, shouldTriggerEvent = false) {
applyToggledItemStateChanges(treeToggledItems: TreeToggledItem[], previousFullToggleType?: Exclude<ToggleStateChangeType, 'toggle-collapse' | 'toggle-expand'> | Exclude<ToggleStateChangeTypeString, 'toggle-collapse' | 'toggle-expand'>, shouldPreProcessFullToggle = true, shouldTriggerEvent = false) {
if (Array.isArray(treeToggledItems)) {
const collapsedPropName = this.getTreeDataOptionPropName('collapsedPropName');
const hasChildrenPropName = this.getTreeDataOptionPropName('hasChildrenPropName');
Expand Down

0 comments on commit af51784

Please sign in to comment.