Enable noImplicitOverride
TypeScript compiler option
This commit is contained in:
parent
4490d9f2d0
commit
ede34ecee3
51 changed files with 339 additions and 194 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
|
@ -16,7 +16,7 @@ export class AddNewLines extends React.Component<Props> {
|
|||
renderNonNewLine: ({ text }) => text,
|
||||
};
|
||||
|
||||
public render():
|
||||
public override render():
|
||||
| JSX.Element
|
||||
| string
|
||||
| null
|
||||
|
|
|
@ -214,7 +214,7 @@ export class ContactDetail extends React.Component<Props> {
|
|||
});
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const { contact, hasSignalAccount, i18n, onSendMessage } = this.props;
|
||||
const isIncoming = false;
|
||||
const module = 'contact-detail';
|
||||
|
|
|
@ -587,7 +587,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
|
|||
);
|
||||
}
|
||||
|
||||
public render(): ReactNode {
|
||||
public override render(): ReactNode {
|
||||
const { id, isSMSOnly, i18n, onSetDisappearingMessages, expireTimer } =
|
||||
this.props;
|
||||
const { isNarrow, modalState } = this.state;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
|
@ -54,7 +54,7 @@ export class Emojify extends React.Component<Props> {
|
|||
renderNonEmoji: ({ text }) => text,
|
||||
};
|
||||
|
||||
public render(): null | Array<JSX.Element | string | null> {
|
||||
public override render(): null | Array<JSX.Element | string | null> {
|
||||
const { text, sizeClass, renderNonEmoji } = this.props;
|
||||
|
||||
// We have to do this, because renderNonEmoji is not required in our Props object,
|
||||
|
|
|
@ -36,7 +36,7 @@ export class ErrorBoundary extends React.PureComponent<Props, State> {
|
|||
return { error };
|
||||
}
|
||||
|
||||
public render(): ReactNode {
|
||||
public override render(): ReactNode {
|
||||
const { error } = this.state;
|
||||
const { i18n, children } = this.props;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
|
@ -24,7 +24,7 @@ export class ExpireTimer extends React.Component<Props> {
|
|||
this.interval = null;
|
||||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
public override componentDidMount(): void {
|
||||
const { expirationLength } = this.props;
|
||||
const increment = getIncrement(expirationLength);
|
||||
const updateFrequency = Math.max(increment, 500);
|
||||
|
@ -39,13 +39,13 @@ export class ExpireTimer extends React.Component<Props> {
|
|||
this.interval = setInterval(update, updateFrequency);
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
public override componentWillUnmount(): void {
|
||||
if (this.interval) {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const {
|
||||
direction,
|
||||
expirationLength,
|
||||
|
|
|
@ -120,7 +120,7 @@ export class GroupNotification extends React.Component<Props> {
|
|||
}
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const { changes: rawChanges, i18n, from } = this.props;
|
||||
|
||||
// This check is just to be extra careful, and can probably be removed.
|
||||
|
|
|
@ -132,7 +132,7 @@ export class Image extends React.Component<Props> {
|
|||
);
|
||||
};
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const {
|
||||
alt,
|
||||
attachment,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2019-2020 Signal Messenger, LLC
|
||||
// Copyright 2019-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
|
@ -37,14 +37,14 @@ export class InlineNotificationWrapper extends React.Component<PropsType> {
|
|||
}
|
||||
};
|
||||
|
||||
public componentDidMount(): void {
|
||||
public override componentDidMount(): void {
|
||||
const { isSelected } = this.props;
|
||||
if (isSelected) {
|
||||
this.setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
public componentDidUpdate(prevProps: PropsType): void {
|
||||
public override componentDidUpdate(prevProps: PropsType): void {
|
||||
const { isSelected } = this.props;
|
||||
|
||||
if (!prevProps.isSelected && isSelected) {
|
||||
|
@ -52,7 +52,7 @@ export class InlineNotificationWrapper extends React.Component<PropsType> {
|
|||
}
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const { children } = this.props;
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
|
@ -326,7 +326,7 @@ export class Linkify extends React.Component<Props> {
|
|||
renderNonLink: ({ text }) => text,
|
||||
};
|
||||
|
||||
public render():
|
||||
public override render():
|
||||
| JSX.Element
|
||||
| string
|
||||
| null
|
||||
|
|
|
@ -418,7 +418,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
}
|
||||
};
|
||||
|
||||
public componentDidMount(): void {
|
||||
public override componentDidMount(): void {
|
||||
this.startSelectedTimer();
|
||||
this.startDeleteForEveryoneTimer();
|
||||
|
||||
|
@ -445,7 +445,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
}
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
public override componentWillUnmount(): void {
|
||||
if (this.selectedTimeout) {
|
||||
clearTimeout(this.selectedTimeout);
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
this.toggleReactionPicker(true);
|
||||
}
|
||||
|
||||
public componentDidUpdate(prevProps: Props): void {
|
||||
public override componentDidUpdate(prevProps: Props): void {
|
||||
const { canDeleteForEveryone, isSelected, status, timestamp } = this.props;
|
||||
|
||||
this.startSelectedTimer();
|
||||
|
@ -2414,7 +2414,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
);
|
||||
}
|
||||
|
||||
public render(): JSX.Element | null {
|
||||
public override render(): JSX.Element | null {
|
||||
const { author, attachments, direction, id, isSticker, timestamp } =
|
||||
this.props;
|
||||
const { expired, expiring, imageBroken, isSelected } = this.state;
|
||||
|
|
|
@ -105,7 +105,7 @@ export class MessageDetail extends React.Component<Props> {
|
|||
|
||||
private readonly messageContainerRef = React.createRef<HTMLDivElement>();
|
||||
|
||||
public componentDidMount(): void {
|
||||
public override componentDidMount(): void {
|
||||
// When this component is created, it's initially not part of the DOM, and then it's
|
||||
// added off-screen and animated in. This ensures that the focus takes.
|
||||
setTimeout(() => {
|
||||
|
@ -257,7 +257,7 @@ export class MessageDetail extends React.Component<Props> {
|
|||
);
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const {
|
||||
errors,
|
||||
message,
|
||||
|
|
|
@ -126,7 +126,7 @@ export class Quote extends React.Component<Props, State> {
|
|||
};
|
||||
}
|
||||
|
||||
componentDidMount(): void {
|
||||
override componentDidMount(): void {
|
||||
const { doubleCheckMissingQuoteReference, referencedMessageNotFound } =
|
||||
this.props;
|
||||
|
||||
|
@ -427,7 +427,7 @@ export class Quote extends React.Component<Props, State> {
|
|||
);
|
||||
}
|
||||
|
||||
public render(): JSX.Element | null {
|
||||
public override render(): JSX.Element | null {
|
||||
const {
|
||||
conversationColor,
|
||||
customColor,
|
||||
|
|
|
@ -1005,20 +1005,20 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
|
|||
}
|
||||
};
|
||||
|
||||
public componentDidMount(): void {
|
||||
public override componentDidMount(): void {
|
||||
this.updateWithVisibleRows();
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
window.registerForActive(this.updateWithVisibleRows);
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
public override componentWillUnmount(): void {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
window.unregisterForActive(this.updateWithVisibleRows);
|
||||
}
|
||||
|
||||
public componentDidUpdate(
|
||||
public override componentDidUpdate(
|
||||
prevProps: Readonly<PropsType>,
|
||||
prevState: Readonly<StateType>
|
||||
): void {
|
||||
|
@ -1311,7 +1311,7 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
|
|||
}
|
||||
};
|
||||
|
||||
public render(): JSX.Element | null {
|
||||
public override render(): JSX.Element | null {
|
||||
const {
|
||||
acknowledgeGroupMemberNameCollisions,
|
||||
areWeAdmin,
|
||||
|
|
|
@ -171,7 +171,7 @@ export type PropsType = PropsLocalType &
|
|||
>;
|
||||
|
||||
export class TimelineItem extends React.PureComponent<PropsType> {
|
||||
public render(): JSX.Element | null {
|
||||
public override render(): JSX.Element | null {
|
||||
const {
|
||||
containerElementRef,
|
||||
conversationId,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2019-2020 Signal Messenger, LLC
|
||||
// Copyright 2019-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
|
@ -40,7 +40,7 @@ export class TimelineLoadingRow extends React.PureComponent<Props> {
|
|||
return <Spinner size="24" svgSize="small" direction="on-background" />;
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
return (
|
||||
<div className="module-timeline-loading-row">{this.renderContents()}</div>
|
||||
);
|
||||
|
|
|
@ -31,7 +31,7 @@ export class Timestamp extends React.Component<Props> {
|
|||
this.interval = null;
|
||||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
public override componentDidMount(): void {
|
||||
const update = () => {
|
||||
this.setState({
|
||||
// Used to trigger renders
|
||||
|
@ -42,13 +42,13 @@ export class Timestamp extends React.Component<Props> {
|
|||
this.interval = setInterval(update, UPDATE_FREQUENCY);
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
public override componentWillUnmount(): void {
|
||||
if (this.interval) {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
}
|
||||
|
||||
public render(): JSX.Element | null {
|
||||
public override render(): JSX.Element | null {
|
||||
const {
|
||||
direction,
|
||||
i18n,
|
||||
|
|
|
@ -66,7 +66,7 @@ export class TypingBubble extends React.PureComponent<Props> {
|
|||
);
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const { i18n, conversationType } = this.props;
|
||||
const isGroup = conversationType === 'group';
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ export class VerificationNotification extends React.Component<Props> {
|
|||
);
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const { type } = this.props;
|
||||
const icon = type === 'markVerified' ? 'verified' : 'verified-not';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
|
@ -20,7 +20,7 @@ export type Props = {
|
|||
};
|
||||
|
||||
export class AttachmentSection extends React.Component<Props> {
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const { header } = this.props;
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
|
@ -23,7 +23,7 @@ export class DocumentListItem extends React.Component<Props> {
|
|||
shouldShowSeparator: true,
|
||||
};
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const { shouldShowSeparator } = this.props;
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
|
@ -78,7 +78,7 @@ export class MediaGallery extends React.Component<Props, State> {
|
|||
};
|
||||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
public override componentDidMount(): void {
|
||||
// When this component is created, it's initially not part of the DOM, and then it's
|
||||
// added off-screen and animated in. This ensures that the focus takes.
|
||||
setTimeout(() => {
|
||||
|
@ -88,7 +88,7 @@ export class MediaGallery extends React.Component<Props, State> {
|
|||
});
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const { selectedTab } = this.state;
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
|
@ -111,7 +111,7 @@ export class MediaGridItem extends React.Component<Props, State> {
|
|||
);
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public override render(): JSX.Element {
|
||||
const { onClick } = this.props;
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue