Enable @typescript-eslint/explicit-member-accessibility on /src (#9785)

* Enable `@typescript-eslint/explicit-member-accessibility` on /src

* Prettier
This commit is contained in:
Michael Telatynski 2022-12-16 12:29:59 +00:00 committed by GitHub
parent 51554399fb
commit f1e8e7f140
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
396 changed files with 1110 additions and 1098 deletions

View file

@ -31,7 +31,7 @@ interface IState {
export default class AudioFeed extends React.Component<IProps, IState> {
private element = createRef<HTMLAudioElement>();
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {
@ -39,13 +39,13 @@ export default class AudioFeed extends React.Component<IProps, IState> {
};
}
componentDidMount() {
public componentDidMount() {
MediaDeviceHandler.instance.addListener(MediaDeviceHandlerEvent.AudioOutputChanged, this.onAudioOutputChanged);
this.props.feed.addListener(CallFeedEvent.NewStream, this.onNewStream);
this.playMedia();
}
componentWillUnmount() {
public componentWillUnmount() {
MediaDeviceHandler.instance.removeListener(
MediaDeviceHandlerEvent.AudioOutputChanged,
this.onAudioOutputChanged,
@ -118,7 +118,7 @@ export default class AudioFeed extends React.Component<IProps, IState> {
this.playMedia();
};
render() {
public render() {
// Do not render the audio element if there is no audio track
if (this.state.audioMuted) return null;

View file

@ -29,7 +29,7 @@ interface IState {
}
export default class AudioFeedArrayForLegacyCall extends React.Component<IProps, IState> {
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {
@ -37,21 +37,21 @@ export default class AudioFeedArrayForLegacyCall extends React.Component<IProps,
};
}
componentDidMount() {
public componentDidMount() {
this.props.call.addListener(CallEvent.FeedsChanged, this.onFeedsChanged);
}
componentWillUnmount() {
public componentWillUnmount() {
this.props.call.removeListener(CallEvent.FeedsChanged, this.onFeedsChanged);
}
onFeedsChanged = () => {
public onFeedsChanged = () => {
this.setState({
feeds: this.props.call.getRemoteFeeds(),
});
};
render() {
public render() {
return this.state.feeds.map((feed, i) => {
return <AudioFeed feed={feed} key={i} />;
});

View file

@ -35,11 +35,11 @@ interface IButtonProps {
}
class DialPadButton extends React.PureComponent<IButtonProps> {
onClick = (ev: ButtonEvent) => {
public onClick = (ev: ButtonEvent) => {
this.props.onButtonPress(this.props.digit, ev);
};
render() {
public render() {
switch (this.props.kind) {
case DialPadButtonKind.Digit:
return (
@ -68,7 +68,7 @@ interface IProps {
}
export default class Dialpad extends React.PureComponent<IProps> {
render() {
public render() {
const buttonNodes = [];
for (let i = 0; i < BUTTONS.length; i++) {

View file

@ -34,27 +34,27 @@ interface IState {
export default class DialpadModal extends React.PureComponent<IProps, IState> {
private numberEntryFieldRef: React.RefObject<Field> = createRef();
constructor(props) {
public constructor(props) {
super(props);
this.state = {
value: "",
};
}
onCancelClick = () => {
public onCancelClick = () => {
this.props.onFinished(false);
};
onChange = (ev) => {
public onChange = (ev) => {
this.setState({ value: ev.target.value });
};
onFormSubmit = (ev) => {
public onFormSubmit = (ev) => {
ev.preventDefault();
this.onDialPress();
};
onDigitPress = (digit: string, ev: ButtonEvent) => {
public onDigitPress = (digit: string, ev: ButtonEvent) => {
this.setState({ value: this.state.value + digit });
// Keep the number field focused so that keyboard entry is still available.
@ -65,7 +65,7 @@ export default class DialpadModal extends React.PureComponent<IProps, IState> {
}
};
onDeletePress = (ev: ButtonEvent) => {
public onDeletePress = (ev: ButtonEvent) => {
if (this.state.value.length === 0) return;
this.setState({ value: this.state.value.slice(0, -1) });
@ -77,12 +77,12 @@ export default class DialpadModal extends React.PureComponent<IProps, IState> {
}
};
onDialPress = async () => {
public onDialPress = async () => {
LegacyCallHandler.instance.dialNumber(this.state.value);
this.props.onFinished(true);
};
render() {
public render() {
const backspaceButton = <DialPadBackspaceButton onBackspacePress={this.onDeletePress} />;
// Only show the backspace button if the field has content

View file

@ -104,7 +104,7 @@ export default class LegacyCallView extends React.Component<IProps, IState> {
private contentWrapperRef = createRef<HTMLDivElement>();
private buttonsRef = createRef<LegacyCallViewButtons>();
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
const { primary, secondary, sidebar } = LegacyCallView.getOrderedFeeds(this.props.call.getFeeds());
@ -140,7 +140,7 @@ export default class LegacyCallView extends React.Component<IProps, IState> {
dis.unregister(this.dispatcherRef);
}
static getDerivedStateFromProps(props: IProps): Partial<IState> {
public static getDerivedStateFromProps(props: IProps): Partial<IState> {
const { primary, secondary, sidebar } = LegacyCallView.getOrderedFeeds(props.call.getFeeds());
return {
@ -232,7 +232,7 @@ export default class LegacyCallView extends React.Component<IProps, IState> {
this.buttonsRef.current?.showControls();
};
static getOrderedFeeds(feeds: Array<CallFeed>): {
public static getOrderedFeeds(feeds: Array<CallFeed>): {
primary?: CallFeed;
secondary?: CallFeed;
sidebar: Array<CallFeed>;

View file

@ -152,7 +152,7 @@ export default class LegacyCallViewButtons extends React.Component<IProps, IStat
private contextMenuButton = createRef<HTMLDivElement>();
private controlsHideTimer: number = null;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {

View file

@ -40,7 +40,7 @@ interface IState {
* or nothing if there is no call in that room.
*/
export default class LegacyCallViewForRoom extends React.Component<IProps, IState> {
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {
call: this.getCall(),

View file

@ -28,7 +28,7 @@ interface IProps {
}
export default class LegacyCallViewSidebar extends React.Component<IProps> {
render() {
public render() {
const feeds = this.props.feeds.map((feed) => {
return (
<VideoFeed

View file

@ -138,7 +138,7 @@ class PipView extends React.Component<IProps, IState> {
// Proper solution: use useRef (requires the component to be refactored to a functional component).
private movePersistedElement = createRef<() => void>() as React.MutableRefObject<() => void>;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
const roomId = SdkContextClass.instance.roomViewStore.getRoomId();

View file

@ -52,7 +52,7 @@ interface IState {
export default class VideoFeed extends React.PureComponent<IProps, IState> {
private element: HTMLVideoElement;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {
@ -61,16 +61,16 @@ export default class VideoFeed extends React.PureComponent<IProps, IState> {
};
}
componentDidMount() {
public componentDidMount() {
this.updateFeed(null, this.props.feed);
this.playMedia();
}
componentWillUnmount() {
public componentWillUnmount() {
this.updateFeed(this.props.feed, null);
}
componentDidUpdate(prevProps: IProps, prevState: IState) {
public componentDidUpdate(prevProps: IProps, prevState: IState) {
this.updateFeed(prevProps.feed, this.props.feed);
// If the mutes state has changed, we try to playMedia()
if (prevState.videoMuted !== this.state.videoMuted || prevProps.feed.stream !== this.props.feed.stream) {
@ -78,7 +78,7 @@ export default class VideoFeed extends React.PureComponent<IProps, IState> {
}
}
static getDerivedStateFromProps(props: IProps) {
public static getDerivedStateFromProps(props: IProps) {
return {
audioMuted: props.feed.isAudioMuted(),
videoMuted: props.feed.isVideoMuted(),
@ -177,7 +177,7 @@ export default class VideoFeed extends React.PureComponent<IProps, IState> {
}
};
render() {
public render() {
const { pipMode, primary, secondary, feed } = this.props;
const wrapperClasses = classnames("mx_VideoFeed", {