Skip to content

Commit

Permalink
Lint .d.ts files
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn-Signal committed Sep 6, 2022
1 parent 6b82d67 commit aa86d8b
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 143 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ libtextsecure/components.js
libtextsecure/test/test.js
test/test.js
sticker-creator/dist/**
ts/protobuf/compiled.d.ts

# Third-party files
js/Mp3LameEncoder.min.js
Expand All @@ -25,7 +26,6 @@ app/**/*.js
ts/**/*.js
sticker-creator/**/*.js

**/*.d.ts
.eslintrc.js
webpack.config.ts
preload.bundle.*
65 changes: 32 additions & 33 deletions ts/model-types.d.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
// Copyright 2020-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

/* eslint-disable max-classes-per-file */

import * as Backbone from 'backbone';

import { GroupV2ChangeType } from './groups';
import { BodyRangeType, BodyRangesType } from './types/Util';
import { CallHistoryDetailsFromDiskType } from './types/Calling';
import { CustomColorType } from './types/Colors';
import { DeviceType } from './textsecure/Types';
import { SendMessageChallengeData } from './textsecure/Errors';
import { MessageModel } from './models/messages';
import { ConversationModel } from './models/conversations';
import { ProfileNameChangeType } from './util/getStringForProfileChange';
import { CapabilitiesType } from './textsecure/WebAPI';
import { ReadStatus } from './messages/MessageReadStatus';
import { SendStateByConversationId } from './messages/MessageSendState';
import { GroupNameCollisionsWithIdsByTitle } from './util/groupMemberNameCollisions';
import { ConversationColorType } from './types/Colors';
import {
AttachmentDraftType,
AttachmentType,
ThumbnailType,
} from './types/Attachment';
import { EmbeddedContactType } from './types/EmbeddedContact';
import type { GroupV2ChangeType } from './groups';
import type { BodyRangeType, BodyRangesType } from './types/Util';
import type { CallHistoryDetailsFromDiskType } from './types/Calling';
import type { CustomColorType, ConversationColorType } from './types/Colors';
import type { DeviceType } from './textsecure/Types.d';
import type { SendMessageChallengeData } from './textsecure/Errors';
import type { MessageModel } from './models/messages';
import type { ConversationModel } from './models/conversations';
import type { ProfileNameChangeType } from './util/getStringForProfileChange';
import type { CapabilitiesType } from './textsecure/WebAPI';
import type { ReadStatus } from './messages/MessageReadStatus';
import type { SendStateByConversationId } from './messages/MessageSendState';
import type { GroupNameCollisionsWithIdsByTitle } from './util/groupMemberNameCollisions';

import type { AttachmentDraftType, AttachmentType } from './types/Attachment';
import type { EmbeddedContactType } from './types/EmbeddedContact';
import { SignalService as Proto } from './protobuf';
import { AvatarDataType } from './types/Avatar';
import { UUIDStringType, UUIDKind } from './types/UUID';
import { ReactionSource } from './reactions/ReactionSource';
import type { AvatarDataType } from './types/Avatar';
import type { UUIDStringType } from './types/UUID';
import type { ReactionSource } from './reactions/ReactionSource';
import type { SeenStatus } from './MessageSeenStatus';
import type { GiftBadgeStates } from './components/conversation/Message';
import type { LinkPreviewType } from './types/message/LinkPreviews';

import type { StickerType } from './types/Stickers';
import type { MIMEType } from './types/MIME';

import AccessRequiredEnum = Proto.AccessControl.AccessRequired;
import MemberRoleEnum = Proto.Member.Role;
import { SeenStatus } from './MessageSeenStatus';
import { GiftBadgeStates } from './components/conversation/Message';
import { LinkPreviewType } from './types/message/LinkPreviews';

import type { ProcessedQuoteAttachment } from './textsecure/Types.d';
import type { StickerType } from './types/Stickers';
import { MIMEType } from './types/MIME';

export type LastMessageStatus =
| 'paused'
Expand All @@ -48,8 +45,6 @@ export type LastMessageStatus =
| 'read'
| 'viewed';

type TaskResultType = any;

export type SenderKeyInfoType = {
createdAtDate: number;
distributionId: string;
Expand Down Expand Up @@ -77,7 +72,7 @@ export type QuotedAttachment = {

export type QuotedMessageType = {
// TODO DESKTOP-3826
// eslint-disable-next-line no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
attachments: Array<any>;
// `author` is an old attribute that holds the author's E164. We shouldn't use it for
// new messages, but old messages might have this attribute.
Expand Down Expand Up @@ -121,6 +116,7 @@ export type MessageReactionType = {
isSentByConversationId?: Record<string, boolean>;
};

/* eslint-disable camelcase */
export type MessageAttributesType = {
bodyAttachment?: AttachmentType;
bodyRanges?: BodyRangesType;
Expand Down Expand Up @@ -242,6 +238,7 @@ export type MessageAttributesType = {
deletedForEveryoneSendStatus?: Record<string, boolean>;
deletedForEveryoneFailed?: boolean;
};
/* eslint-enable camelcase */

export type ConversationAttributesTypeType = 'private' | 'group';

Expand All @@ -255,6 +252,7 @@ export type ValidateConversationType = Pick<
'e164' | 'uuid' | 'type' | 'groupId'
>;

/* eslint-disable camelcase */
export type ConversationAttributesType = {
accessKey?: string | null;
addedBy?: string;
Expand Down Expand Up @@ -395,6 +393,7 @@ export type ConversationAttributesType = {
// up in that case).
unblurredAvatarPath?: string;
};
/* eslint-enable camelcase */

export type GroupV2MemberType = {
uuid: UUIDStringType;
Expand Down
2 changes: 2 additions & 0 deletions ts/mp4box.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

/* eslint-disable camelcase */

declare module 'mp4box' {
type MP4MediaTrack = {
alternate_group: number;
Expand Down
11 changes: 7 additions & 4 deletions ts/quill/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2019-2021 Signal Messenger, LLC
// Copyright 2019-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

import UpdatedDelta from 'quill-delta';
import { MentionCompletion } from './mentions/completion';
import { EmojiCompletion } from './emoji/completion';
import type UpdatedDelta from 'quill-delta';
import type { MentionCompletion } from './mentions/completion';
import type { EmojiCompletion } from './emoji/completion';

declare module 'react-quill' {
// `react-quill` uses a different but compatible version of Delta
Expand Down Expand Up @@ -31,6 +31,9 @@ declare module 'quill' {

interface LeafBlot {
text?: string;
// Quill doesn't make it easy to type this result.
// (It's probably doable, but not worth our time.)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value(): any;
}

Expand Down
4 changes: 2 additions & 2 deletions ts/textsecure/Types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type { SignalService as Proto } from '../protobuf';
import type { IncomingWebSocketRequest } from './WebsocketResources';
import type { UUID, UUIDStringType } from '../types/UUID';
import type { TextAttachmentType } from '../types/Attachment';
import { GiftBadgeStates } from '../components/conversation/Message';
import { MIMEType } from '../types/MIME';
import type { GiftBadgeStates } from '../components/conversation/Message';
import type { MIMEType } from '../types/MIME';

export {
IdentityKeyType,
Expand Down
6 changes: 4 additions & 2 deletions ts/types/Storage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode';
import type { RetryItemType } from '../util/retryPlaceholders';
import type { ConfigMapType as RemoteConfigType } from '../RemoteConfig';
import type { SystemTraySetting } from './SystemTraySetting';
import type { ExtendedStorageID, UnknownRecord } from './StorageService';
import type { ExtendedStorageID, UnknownRecord } from './StorageService.d';

import type { GroupCredentialType } from '../textsecure/WebAPI';
import type {
Expand All @@ -21,7 +21,7 @@ import type {
} from '../textsecure/Types.d';
import type { ThemeSettingType } from './StorageUIKeys';

import { RegisteredChallengeType } from '../challenge';
import type { RegisteredChallengeType } from '../challenge';

export type SerializedCertificateType = {
expires: number;
Expand All @@ -41,6 +41,7 @@ export type IdentityKeyMap = Record<
>;

// This should be in sync with `STORAGE_UI_KEYS` in `ts/types/StorageUIKeys.ts`.
/* eslint-disable camelcase */
export type StorageAccessType = {
'always-relay-calls': boolean;
'audio-notification': boolean;
Expand Down Expand Up @@ -144,6 +145,7 @@ export type StorageAccessType = {
signaling_key: never;
'challenge:retry-message-ids': never;
};
/* eslint-enable camelcase */

export type StorageInterface = {
onready(callback: () => void): void;
Expand Down
Loading

0 comments on commit aa86d8b

Please sign in to comment.