Comply with noImplicitAny (#9940)
* Stash noImplicitAny work * Stash * Fix imports * Iterate * Fix tests * Delint * Fix tests
This commit is contained in:
parent
ac7f69216e
commit
61a63e47f4
359 changed files with 1621 additions and 1353 deletions
|
@ -33,13 +33,12 @@ interface IProps extends IDialogProps {
|
|||
widgetKind: WidgetKind; // TODO: Refactor into the Widget class
|
||||
}
|
||||
|
||||
interface IBooleanStates {
|
||||
// @ts-ignore - TS wants a string key, but we know better
|
||||
[capability: Capability]: boolean;
|
||||
}
|
||||
type BooleanStates = Partial<{
|
||||
[capability in Capability]: boolean;
|
||||
}>;
|
||||
|
||||
interface IState {
|
||||
booleanStates: IBooleanStates;
|
||||
booleanStates: BooleanStates;
|
||||
rememberSelection: boolean;
|
||||
}
|
||||
|
||||
|
@ -52,7 +51,7 @@ export default class WidgetCapabilitiesPromptDialog extends React.PureComponent<
|
|||
const parsedEvents = WidgetEventCapability.findEventCapabilities(this.props.requestedCapabilities);
|
||||
parsedEvents.forEach((e) => this.eventPermissionsMap.set(e.raw, e));
|
||||
|
||||
const states: IBooleanStates = {};
|
||||
const states: BooleanStates = {};
|
||||
this.props.requestedCapabilities.forEach((c) => (states[c] = true));
|
||||
|
||||
this.state = {
|
||||
|
@ -71,7 +70,7 @@ export default class WidgetCapabilitiesPromptDialog extends React.PureComponent<
|
|||
this.setState({ rememberSelection: newVal });
|
||||
};
|
||||
|
||||
private onSubmit = async (ev): Promise<void> => {
|
||||
private onSubmit = async (): Promise<void> => {
|
||||
this.closeAndTryRemember(
|
||||
Object.entries(this.state.booleanStates)
|
||||
.filter(([_, isSelected]) => isSelected)
|
||||
|
@ -79,7 +78,7 @@ export default class WidgetCapabilitiesPromptDialog extends React.PureComponent<
|
|||
);
|
||||
};
|
||||
|
||||
private onReject = async (ev): Promise<void> => {
|
||||
private onReject = async (): Promise<void> => {
|
||||
this.closeAndTryRemember([]); // nothing was approved
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue