chore: Drop unused type declarations and type exports (#34055)

pull/33906/head^2
Tasso Evangelista 1 year ago committed by GitHub
parent b8388ab48d
commit 8ade81bd20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      apps/meteor/app/api/server/definition.ts
  2. 7
      apps/meteor/app/importer/server/classes/converters/UserConverter.ts
  3. 2
      apps/meteor/app/livechat/server/lib/localTypes.ts
  4. 2
      apps/meteor/app/push/server/push.ts
  5. 2
      apps/meteor/app/statistics/server/lib/getAppsStatistics.ts
  6. 16
      apps/meteor/client/apps/@types/IOrchestrator.ts
  7. 2
      apps/meteor/client/contexts/ImageGalleryContext.ts
  8. 2
      apps/meteor/client/lib/cachedCollections/CachedCollection.ts
  9. 2
      apps/meteor/client/lib/minimongo/types.ts
  10. 2
      apps/meteor/client/views/admin/mailer/MailerPage.tsx
  11. 2
      apps/meteor/client/views/admin/subscription/components/InfoTextIconModal.tsx
  12. 2
      apps/meteor/client/views/admin/subscription/components/UsagePieGraph.tsx
  13. 2
      apps/meteor/client/views/omnichannel/realTimeMonitoring/counter/CounterContainer.tsx
  14. 2
      apps/meteor/client/views/room/Sidepanel/SidepanelItem/RoomSidepanelItem.tsx
  15. 2
      apps/meteor/client/views/room/contexts/UserCardContext.ts
  16. 11
      apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.tsx

@ -112,16 +112,7 @@ export type PartialThis = {
readonly logger: Logger;
};
export type UserInfo = IUser & {
email?: string;
settings: {
profile: object;
preferences: unknown;
};
avatarUrl: string;
};
export type ActionThis<TMethod extends Method, TPathPattern extends PathPattern, TOptions> = {
type ActionThis<TMethod extends Method, TPathPattern extends PathPattern, TOptions> = {
readonly requestIp: string;
urlParams: UrlParams<TPathPattern>;
readonly response: Response;
@ -186,11 +177,11 @@ export type ResultFor<TMethod extends Method, TPathPattern extends PathPattern>
body: unknown;
};
export type Action<TMethod extends Method, TPathPattern extends PathPattern, TOptions> =
type Action<TMethod extends Method, TPathPattern extends PathPattern, TOptions> =
| ((this: ActionThis<TMethod, TPathPattern, TOptions>) => Promise<ResultFor<TMethod, TPathPattern>>)
| ((this: ActionThis<TMethod, TPathPattern, TOptions>) => ResultFor<TMethod, TPathPattern>);
export type Operation<TMethod extends Method, TPathPattern extends PathPattern, TEndpointOptions> =
type Operation<TMethod extends Method, TPathPattern extends PathPattern, TEndpointOptions> =
| Action<TMethod, TPathPattern, TEndpointOptions>
| ({
action: Action<TMethod, TPathPattern, TEndpointOptions>;

@ -26,13 +26,6 @@ export type UserConverterOptions = {
enableEmail2fa?: boolean;
};
export type ConvertUsersResult = {
inserted: string[];
updated: string[];
skipped: number;
failed: number;
};
export class UserConverter extends RecordConverter<IImportUserRecord, UserConverterOptions & RecordConverterOptions> {
private insertedIds = new Set<IUser['_id']>();

@ -1,6 +1,6 @@
import type { IOmnichannelRoom, IUser, ILivechatVisitor, IMessage, MessageAttachment, IMessageInbox } from '@rocket.chat/core-typings';
export type GenericCloseRoomParams = {
type GenericCloseRoomParams = {
room: IOmnichannelRoom;
comment?: string;
options?: {

@ -20,7 +20,7 @@ const ajv = new Ajv({
coerceTypes: true,
});
export type FCMCredentials = {
type FCMCredentials = {
type: string;
project_id: string;
private_key_id: string;

@ -6,7 +6,7 @@ import mem from 'mem';
import { SystemLogger } from '../../../../server/lib/logger/system';
import { Info } from '../../../utils/rocketchat.info';
export type AppsStatistics = {
type AppsStatistics = {
engineVersion: string;
totalInstalled: number | false;
totalActive: number | false;

@ -1,21 +1,5 @@
import type { ISetting } from '@rocket.chat/apps-engine/definition/settings/ISetting';
interface ILanguageInfo {
Params: string;
Description: string;
Setting_Name: string;
Setting_Description: string;
}
interface ILanguages {
[key: string]: ILanguageInfo;
}
export interface IAppLanguage {
id: string;
languages: ILanguages;
}
export interface IAppExternalURL {
url: string;
}

@ -1,6 +1,6 @@
import { createContext } from 'react';
export type ImageGalleryContextValue = {
type ImageGalleryContextValue = {
imageId: string;
isOpen: boolean;
onClose: () => void;

@ -15,8 +15,6 @@ import { isTruthy } from '../../../lib/isTruthy';
import { withDebouncing } from '../../../lib/utils/highOrderFunctions';
import { getConfig } from '../utils/getConfig';
export type EventType = 'notify-logged' | 'notify-all' | 'notify-user';
type Name = 'rooms' | 'subscriptions' | 'permissions' | 'public-settings' | 'private-settings';
const hasId = <T>(record: T): record is T & { _id: string } => typeof record === 'object' && record !== null && '_id' in record;

@ -63,7 +63,7 @@ export type FieldExpression<T> = {
$comment?: string;
};
export type Flatten<T> = T extends unknown[] ? T[0] : T;
type Flatten<T> = T extends unknown[] ? T[0] : T;
export type Query<T> = {
[P in keyof T]?: Flatten<T[P]> | RegExp | FieldExpression<Flatten<T[P]>>;

@ -23,7 +23,7 @@ import { validateEmail } from '../../../../lib/emailValidator';
import { isJSON } from '../../../../lib/utils/isJSON';
import { Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '../../../components/Page';
export type SendEmailFormValue = {
type SendEmailFormValue = {
fromEmail: string;
subject: string;
emailBody: string;

@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next';
import GenericModal from '../../../../components/GenericModal';
export type InfoTextIconModalProps = {
type InfoTextIconModalProps = {
title: string;
infoText: ReactNode;
};

@ -14,7 +14,7 @@ const graphColors = (color: CSSProperties['color']): GraphColorsReturn => ({
free: Palette.stroke['stroke-extra-light'].toString(),
});
export type UsagePieGraphProps = {
type UsagePieGraphProps = {
used: number;
total: number;
label?: ReactNode;

@ -9,7 +9,7 @@ import CounterItem from './CounterItem';
import CounterRow from './CounterRow';
import { AsyncStatePhase } from '../../../../hooks/useAsyncState';
export type DataType = {
type DataType = {
title: string;
value: number | string;
}[];

@ -6,7 +6,7 @@ import { goToRoomById } from '../../../../lib/utils/goToRoomById';
import { useTemplateByViewMode } from '../../../../sidebarv2/hooks/useTemplateByViewMode';
import { useItemData } from '../hooks/useItemData';
export type RoomSidepanelItemProps = {
type RoomSidepanelItemProps = {
openedRoom?: string;
room: IRoom;
parentRid: string;

@ -3,7 +3,7 @@ import { createContext, useContext } from 'react';
import type { AriaButtonProps } from 'react-aria';
import type { OverlayTriggerState } from 'react-stately';
export type UserCardContextValue = {
type UserCardContextValue = {
openUserCard: (e: UIEvent, username: string) => void;
closeUserCard: () => void;
triggerProps: AriaButtonProps<'button'>;

@ -9,17 +9,6 @@ import { useEndpointAction } from '../../../../hooks/useEndpointAction';
import { useRoom, useRoomSubscription } from '../../contexts/RoomContext';
import { useRoomToolbox } from '../../contexts/RoomToolboxContext';
export type NotificationFormValues = {
turnOn: boolean;
muteGroupMentions: boolean;
showCounter: boolean;
showMentions: boolean;
desktopAlert: string;
desktopSound: string;
mobileAlert: string;
emailAlert: string;
};
const NotificationPreferencesWithData = (): ReactElement => {
const t = useTranslation();
const room = useRoom();

Loading…
Cancel
Save