Convert ReactWrapperView
to TypeScript
This commit is contained in:
parent
bb9a270bfd
commit
63189f3f91
16 changed files with 325 additions and 364 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// Copyright 2018-2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { ReactNode } from 'react';
|
||||
|
@ -16,7 +16,7 @@ import { Avatar, AvatarSize } from './Avatar';
|
|||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import { IMAGE_PNG, isImage, isVideo } from '../types/MIME';
|
||||
import type { LocalizerType } from '../types/Util';
|
||||
import type { MediaItemType, MessageAttributesType } from '../types/MediaItem';
|
||||
import type { MediaItemType, MediaItemMessageType } from '../types/MediaItem';
|
||||
import { formatDuration } from '../util/formatDuration';
|
||||
import { useRestoreFocus } from '../hooks/useRestoreFocus';
|
||||
import * as log from '../logging/log';
|
||||
|
@ -31,7 +31,7 @@ export type PropsType = {
|
|||
onForward?: (messageId: string) => void;
|
||||
onSave?: (options: {
|
||||
attachment: AttachmentType;
|
||||
message: MessageAttributesType;
|
||||
message: MediaItemMessageType;
|
||||
index: number;
|
||||
}) => void;
|
||||
selectedIndex?: number;
|
||||
|
@ -676,7 +676,7 @@ function LightboxHeader({
|
|||
}: {
|
||||
getConversation: (id: string) => ConversationType;
|
||||
i18n: LocalizerType;
|
||||
message: MessageAttributesType;
|
||||
message: MediaItemMessageType;
|
||||
}): JSX.Element {
|
||||
const conversation = getConversation(message.conversationId);
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// Copyright 2018-2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { MessageAttributesType } from '../../../../model-types.d';
|
||||
import type { AttachmentType } from '../../../../types/Attachment';
|
||||
import type { Message } from './Message';
|
||||
|
||||
export type ItemClickEvent = {
|
||||
message: Message;
|
||||
message: Pick<MessageAttributesType, 'sent_at'>;
|
||||
attachment: AttachmentType;
|
||||
type: 'media' | 'documents';
|
||||
};
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { AttachmentType } from '../../../../types/Attachment';
|
||||
|
||||
export type Message = {
|
||||
id: string;
|
||||
attachments: Array<AttachmentType>;
|
||||
// Assuming this is for the API
|
||||
// eslint-disable-next-line camelcase
|
||||
received_at: number;
|
||||
// eslint-disable-next-line camelcase
|
||||
received_at_ms: number;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue