diff --git a/keyserver/src/creators/thread-creator.js b/keyserver/src/creators/thread-creator.js --- a/keyserver/src/creators/thread-creator.js +++ b/keyserver/src/creators/thread-creator.js @@ -11,7 +11,6 @@ } from 'lib/shared/color-utils.js'; import { isInvalidSidebarSource } from 'lib/shared/message-utils.js'; import { getThreadTypeParentRequirement } from 'lib/shared/thread-utils.js'; -import type { Shape } from 'lib/types/core.js'; import { messageTypes } from 'lib/types/message-types-enum.js'; import type { RawMessageInfo, MessageData } from 'lib/types/message-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; @@ -64,7 +63,7 @@ 'This is your private chat, ' + 'where you can set reminders and jot notes in private!'; -type CreateThreadOptions = Shape<{ +type CreateThreadOptions = Partial<{ +forceAddMembers: boolean, +updatesForCurrentSession: UpdatesForCurrentSession, +silentlyFailMembers: boolean, diff --git a/keyserver/src/scripts/merge-users.js b/keyserver/src/scripts/merge-users.js --- a/keyserver/src/scripts/merge-users.js +++ b/keyserver/src/scripts/merge-users.js @@ -1,6 +1,5 @@ // @flow -import type { Shape } from 'lib/types/core.js'; import type { ServerThreadInfo } from 'lib/types/thread-types.js'; import { updateTypes } from 'lib/types/update-types-enum.js'; import { type UpdateData } from 'lib/types/update-types.js'; @@ -29,7 +28,7 @@ } } -type ReplaceUserInfo = Shape<{ +type ReplaceUserInfo = Partial<{ +username: boolean, +password: boolean, }>; diff --git a/keyserver/src/session/cookies.js b/keyserver/src/session/cookies.js --- a/keyserver/src/session/cookies.js +++ b/keyserver/src/session/cookies.js @@ -7,7 +7,6 @@ import { isStaff } from 'lib/shared/staff-utils.js'; import { hasMinCodeVersion } from 'lib/shared/version-utils.js'; -import type { Shape } from 'lib/types/core.js'; import type { SignedIdentityKeysBlob } from 'lib/types/crypto-types.js'; import type { Platform, PlatformDetails } from 'lib/types/device-types.js'; import type { CalendarQuery } from 'lib/types/entry-types.js'; @@ -493,7 +492,7 @@ result.cookieChange = sessionChange; } -type AnonymousCookieCreationParams = Shape<{ +type AnonymousCookieCreationParams = Partial<{ +platformDetails: ?PlatformDetails, +deviceToken: ?string, }>; diff --git a/keyserver/src/socket/socket.js b/keyserver/src/socket/socket.js --- a/keyserver/src/socket/socket.js +++ b/keyserver/src/socket/socket.js @@ -16,7 +16,6 @@ } from 'lib/shared/timeouts.js'; import { mostRecentUpdateTimestamp } from 'lib/shared/update-utils.js'; import { hasMinCodeVersion } from 'lib/shared/version-utils.js'; -import type { Shape } from 'lib/types/core.js'; import { endpointIsSocketSafe } from 'lib/types/endpoints.js'; import type { RawEntryInfo } from 'lib/types/entry-types.js'; import { defaultNumberPerThread } from 'lib/types/message-types.js'; @@ -829,7 +828,7 @@ } } - setStateCheckConditions(newConditions: Shape) { + setStateCheckConditions(newConditions: Partial) { this.stateCheckConditions = { ...this.stateCheckConditions, ...newConditions, diff --git a/keyserver/src/updaters/session-updaters.js b/keyserver/src/updaters/session-updaters.js --- a/keyserver/src/updaters/session-updaters.js +++ b/keyserver/src/updaters/session-updaters.js @@ -1,12 +1,11 @@ // @flow -import type { Shape } from 'lib/types/core.js'; import type { CalendarQuery } from 'lib/types/entry-types.js'; import { dbQuery, SQL } from '../database/database.js'; import type { Viewer } from '../session/viewer.js'; -export type SessionUpdate = Shape<{ +export type SessionUpdate = Partial<{ +query: CalendarQuery, +lastUpdate: number, +lastValidated: number, diff --git a/keyserver/src/updaters/thread-updaters.js b/keyserver/src/updaters/thread-updaters.js --- a/keyserver/src/updaters/thread-updaters.js +++ b/keyserver/src/updaters/thread-updaters.js @@ -10,7 +10,6 @@ viewerIsMember, getThreadTypeParentRequirement, } from 'lib/shared/thread-utils.js'; -import type { Shape } from 'lib/types/core.js'; import { messageTypes } from 'lib/types/message-types-enum.js'; import type { RawMessageInfo, MessageData } from 'lib/types/message-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; @@ -324,7 +323,7 @@ return { updatesResult: { newUpdates: viewerUpdates } }; } -type UpdateThreadOptions = Shape<{ +type UpdateThreadOptions = Partial<{ +forceAddMembers: boolean, +forceUpdateRoot: boolean, +silenceMessages: boolean, diff --git a/lib/hooks/theme.js b/lib/hooks/theme.js --- a/lib/hooks/theme.js +++ b/lib/hooks/theme.js @@ -3,7 +3,6 @@ import * as React from 'react'; import { updateThemeInfoActionType } from '../actions/theme-actions.js'; -import type { Shape } from '../types/core.js'; import type { GlobalTheme, GlobalThemeInfo, @@ -21,7 +20,7 @@ return; } - let updateObject: Shape = { + let updateObject: Partial = { systemTheme: colorScheme, }; if (globalThemeInfo.preference === 'system') { diff --git a/lib/media/file-utils.js b/lib/media/file-utils.js --- a/lib/media/file-utils.js +++ b/lib/media/file-utils.js @@ -3,7 +3,6 @@ import fileType from 'file-type'; import invariant from 'invariant'; -import type { Shape } from '../types/core.js'; import type { MediaType } from '../types/media-types.js'; type ResultMIME = 'image/png' | 'image/jpeg'; @@ -12,10 +11,10 @@ +extension: string, +serverCanHandle: boolean, +serverTranscodesImage: boolean, - +imageConfig?: Shape<{ + +imageConfig?: Partial<{ +convertTo: ResultMIME, }>, - +videoConfig?: Shape<{ + +videoConfig?: Partial<{ +loop: boolean, }>, }; diff --git a/lib/types/core.js b/lib/types/core.js deleted file mode 100644 --- a/lib/types/core.js +++ /dev/null @@ -1,3 +0,0 @@ -// @flow - -export type Shape = $ReadOnly<$Rest>; diff --git a/lib/types/media-types.js b/lib/types/media-types.js --- a/lib/types/media-types.js +++ b/lib/types/media-types.js @@ -3,7 +3,6 @@ import t, { type TInterface, type TUnion } from 'tcomb'; import type { ClientEncryptedImageAvatar } from './avatar-types'; -import type { Shape } from './core.js'; import { type Platform } from './device-types.js'; import { tShape, tString, tID } from '../utils/validation-utils.js'; @@ -36,7 +35,7 @@ +extras: string, }; -export type Corners = Shape<{ +export type Corners = Partial<{ +topLeft: boolean, +topRight: boolean, +bottomLeft: boolean, @@ -767,10 +766,10 @@ export type Media = Image | Video | EncryptedImage | EncryptedVideo; export type MediaShape = - | Shape - | Shape