File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
core/src/lib/declarations
fabric/src/lib/components/command-bar Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ type KnownKeysOfOptions = KnownKeys<Options>; // 'key' | 'title';
1515
1616 * Taken from https://stackoverflow.com/questions/51465182/typescript-remove-index-signature-using-mapped-types
1717 */
18- export type KnownKeys < T > = { [ K in keyof T ] : string extends K ? never : number extends K ? never : K } extends {
19- [ _ in keyof T ] : infer U
20- }
21- ? U
22- : never ;
18+ type KnownKeys < T > = {
19+ [ K in keyof T ] : string extends K ? never : number extends K ? never : K
20+ } extends { [ _ in keyof T ] : infer U } ?U : never ;
Original file line number Diff line number Diff line change 11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT License.
33
4- import { InputRendererOptions , Omit , ReactWrapperComponent } from '@angular-react/core' ;
4+ import { InputRendererOptions , ReactWrapperComponent } from '@angular-react/core' ;
55import {
66 AfterContentInit ,
77 ChangeDetectionStrategy ,
@@ -224,7 +224,10 @@ export class FabCommandBarComponent extends ReactWrapperComponent<ICommandBarPro
224224 }
225225}
226226
227- export interface ICommandBarItemOptions < TData = any > extends Omit < ICommandBarItemProps , 'onRender' | 'onRenderIcon' > {
227+ // Not using `Omit` here since it confused the TypeScript compiler and it just showed the properties listed here (`renderIcon`, `render` and `data`).
228+ // The type here is just `Omit` without the generics though.
229+ export interface ICommandBarItemOptions < TData = any >
230+ extends Pick < ICommandBarItemProps , Exclude < KnownKeys < ICommandBarItemProps > , 'onRender' | 'onRenderIcon' > > {
228231 readonly renderIcon ?: InputRendererOptions < ICommandBarItemOptionsRenderIconContext > ;
229232 readonly render ?: InputRendererOptions < ICommandBarItemOptionsRenderContext > ;
230233 readonly data ?: TData ;
You can’t perform that action at this time.
0 commit comments