Skip to content

Commit 13941e1

Browse files
authored
ref(✂️): remove unused types (#90051)
This PR removes `types`, `interfaces` and `enums` that aren’t used anymore in the codebase.
1 parent 8a0590c commit 13941e1

File tree

42 files changed

+1
-345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1
-345
lines changed

static/app/components/acl/feature.tsx

-5
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ type Props = {
6969
requireAll?: boolean;
7070
};
7171

72-
/**
73-
* Normalized props for feature configuration objects
74-
*/
75-
export type FeatureProps = Omit<Props, 'children' | 'config' | 'organization'>;
76-
7772
/**
7873
* Common props passed to children and disabled render handlers.
7974
*/

static/app/components/activity/note/types.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ import type {OnChangeHandlerFunc} from 'react-mentions';
22

33
import type {DEFAULT_ERROR_JSON} from 'sentry/constants';
44

5-
/**
6-
* Represents a mentionable user or team.
7-
*/
8-
export type Mentionable = {
9-
display: string;
10-
email: string;
11-
id: string;
12-
};
13-
145
/**
156
* List of id, display name
167
*/

static/app/components/arithmeticBuilder/action.tsx

-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ function isArithmeticBuilderReplaceAction(
4949
return action.type === 'REPLACE_TOKEN';
5050
}
5151

52-
export interface ArithmeticBuilderState {
53-
expression: string;
54-
focusOverride: FocusOverride | null;
55-
}
56-
5752
interface UseArithmeticBuilderActionOptions {
5853
initialExpression: string;
5954
updateExpression?: (expression: Expression) => void;

static/app/components/charts/useSessionsRequest.tsx

-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ import {useApiQuery} from 'sentry/utils/queryClient';
66
import {filterSessionsInTimeWindow, getSessionsInterval} from 'sentry/utils/sessions';
77
import useOrganization from 'sentry/utils/useOrganization';
88

9-
export type SessionsRequestRenderProps = {
10-
errored: boolean;
11-
loading: boolean;
12-
reloading: boolean;
13-
response: SessionApiResponse | null;
14-
};
15-
169
type Props = {
1710
field: SessionFieldWithOperation[];
1811
end?: string;

static/app/components/deprecatedSmartSearchBar/types.tsx

-7
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ export type SearchItem = {
6464
value?: string | null;
6565
};
6666

67-
export type Tag = {
68-
desc: string;
69-
key: string;
70-
predefined: boolean;
71-
values: string[];
72-
};
73-
7467
export enum ShortcutType {
7568
DELETE = 'delete',
7669
NEGATE = 'negate',

static/app/components/dropdownAutoComplete/index.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ interface StaticDropdownAutoCompleteProps extends BaseProps {
4242
lazyItems?: never;
4343
}
4444

45-
export type DropdownAutoCompleteProps =
46-
| LazyDropdownAutoCompleteProps
47-
| StaticDropdownAutoCompleteProps;
48-
4945
/**
5046
* @deprecated prefer using CompactSelect
5147
*/

static/app/components/events/autofix/types.ts

-32
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ export enum AutofixStepType {
2121
SOLUTION = 'solution',
2222
}
2323

24-
export enum AutofixCodebaseIndexingStatus {
25-
UP_TO_DATE = 'up_to_date',
26-
INDEXING = 'indexing',
27-
NOT_INDEXED = 'not_indexed',
28-
OUT_OF_DATE = 'out_of_date',
29-
ERRORED = 'errored',
30-
}
31-
3224
export enum AutofixStatus {
3325
COMPLETED = 'COMPLETED',
3426
ERROR = 'ERROR',
@@ -47,12 +39,6 @@ type AutofixOptions = {
4739
iterative_feedback?: boolean;
4840
};
4941

50-
export type AutofixUpdateEndpointResponse = {
51-
run_id: number;
52-
message?: string;
53-
status?: 'success' | 'error';
54-
};
55-
5642
type CodebaseState = {
5743
is_readable: boolean | null;
5844
is_writeable: boolean | null;
@@ -118,14 +104,6 @@ export interface CommentThreadMessage {
118104
isLoading?: boolean;
119105
}
120106

121-
export type CodeSnippetContext = {
122-
file_path: string;
123-
repo_name: string;
124-
snippet: string;
125-
end_line?: number;
126-
start_line?: number;
127-
};
128-
129107
export type AutofixInsight = {
130108
insight: string;
131109
justification: string;
@@ -254,16 +232,6 @@ export interface AutofixRepoDefinition {
254232
provider: string;
255233
}
256234

257-
export interface Repository {
258-
externalId: string;
259-
id: string;
260-
name: string;
261-
provider?: {
262-
id?: string;
263-
name?: string;
264-
};
265-
}
266-
267235
export interface RepoSettings {
268236
branch: string;
269237
instructions: string;

static/app/components/onboarding/onboardingContext.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {createContext, useContext, useMemo} from 'react';
33
import type {OnboardingSelectedSDK} from 'sentry/types/onboarding';
44
import {useSessionStorage} from 'sentry/utils/useSessionStorage';
55

6-
export type OnboardingContextProps = {
6+
type OnboardingContextProps = {
77
setSelectedPlatform: (selectedSDK?: OnboardingSelectedSDK) => void;
88
selectedPlatform?: OnboardingSelectedSDK;
99
};

static/app/types/breadcrumbs.tsx

-21
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,6 @@ interface BreadcrumbTypeBase {
4646
timestamp?: string;
4747
}
4848

49-
export interface BreadcrumbTypeSystem extends BreadcrumbTypeBase {
50-
action: string;
51-
extras: Record<string, any>;
52-
type: BreadcrumbType.SYSTEM;
53-
}
54-
55-
export interface BreadcrumbTypeSession extends BreadcrumbTypeBase {
56-
action: string;
57-
extras: Record<string, any>;
58-
type: BreadcrumbType.SESSION;
59-
}
60-
6149
export interface BreadcrumbTypeNavigation extends BreadcrumbTypeBase {
6250
type: BreadcrumbType.NAVIGATION;
6351
data?: null | {
@@ -66,15 +54,6 @@ export interface BreadcrumbTypeNavigation extends BreadcrumbTypeBase {
6654
};
6755
}
6856

69-
export interface BreadcrumbTypeInit extends BreadcrumbTypeBase {
70-
data: {
71-
action: 'replay-init';
72-
label: string;
73-
url: string;
74-
};
75-
type: BreadcrumbType.INIT;
76-
}
77-
7857
export interface BreadcrumbTypeHTTP extends BreadcrumbTypeBase {
7958
type: BreadcrumbType.HTTP;
8059
data?:

static/app/types/core.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ export interface DataCategoryInfo {
125125
snakeCasePlural?: string;
126126
}
127127

128-
export type EventType = 'error' | 'transaction' | 'attachment';
129-
130128
export enum Outcome {
131129
ACCEPTED = 'accepted',
132130
FILTERED = 'filtered',

static/app/types/echarts.tsx

-13
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,6 @@ interface EChartsHighlightEventParam {
6464

6565
export type EChartHighlightHandler = EChartEventHandler<EChartsHighlightEventParam>;
6666

67-
export interface EChartsDownplayEventParam {
68-
type: 'downplay';
69-
batch?: Array<{
70-
dataIndex: number;
71-
dataIndexInside: number;
72-
escapeConnect: boolean;
73-
notBlur: boolean;
74-
seriesIndex: number;
75-
type: string;
76-
}>;
77-
name?: string;
78-
}
79-
8067
export type EChartDownplayHandler = EChartEventHandler<EChartsHighlightEventParam>;
8168

8269
/**

static/app/types/event.tsx

-13
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ type VariantEvidence = {
5151
parent_span_ids?: string[];
5252
};
5353

54-
type EventGroupVariantKey =
55-
| 'built-in-fingerprint'
56-
| 'custom-fingerprint'
57-
| 'app'
58-
| 'default'
59-
| 'system';
60-
6154
export const enum EventGroupVariantType {
6255
CHECKSUM = 'checksum',
6356
FALLBACK = 'fallback',
@@ -122,8 +115,6 @@ export type EventGroupVariant =
122115
| BuiltInFingerprintVariant
123116
| PerformanceProblemVariant;
124117

125-
export type EventGroupInfo = Record<EventGroupVariantKey, EventGroupVariant>;
126-
127118
/**
128119
* SDK Update metadata
129120
*/
@@ -211,10 +202,6 @@ export type Frame = {
211202
symbolicatorStatus?: SymbolicatorStatus;
212203
};
213204

214-
export enum FrameBadge {
215-
GROUPING = 'grouping',
216-
}
217-
218205
export type ExceptionValue = {
219206
mechanism: StackTraceMechanism | null;
220207
module: string | null;

static/app/types/group.tsx

-15
Original file line numberDiff line numberDiff line change
@@ -993,18 +993,3 @@ export type ShortIdResponse = {
993993
projectSlug: string;
994994
shortId: string;
995995
};
996-
997-
/**
998-
* Note used in Group Activity and Alerts for users to comment
999-
*/
1000-
export type Note = {
1001-
/**
1002-
* Array of [id, display string] tuples used for @-mentions
1003-
*/
1004-
mentions: Array<[string, string]>;
1005-
1006-
/**
1007-
* Note contents (markdown allowed)
1008-
*/
1009-
text: string;
1010-
};

static/app/types/onboarding.tsx

-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import type {Query} from 'history';
22

3-
import type {OnboardingContextProps} from 'sentry/components/onboarding/onboardingContext';
43
import type {Category} from 'sentry/components/platformPicker';
54
import type {InjectedRouter} from 'sentry/types/legacyReactRouter';
65

7-
import type {Organization} from './organization';
86
import type {PlatformIntegration, PlatformKey, Project} from './project';
97

108
export enum OnboardingTaskGroup {
@@ -31,13 +29,6 @@ export enum OnboardingTaskKey {
3129
PERFORMANCE_GUIDE = 'performance_guide',
3230
}
3331

34-
export type OnboardingCustomComponentProps = {
35-
onboardingContext: OnboardingContextProps;
36-
organization: Organization;
37-
projects: Project[];
38-
task: OnboardingTask;
39-
};
40-
4132
interface OnboardingTaskDescriptorBase {
4233
description: string;
4334
/**
@@ -126,5 +117,3 @@ export type OnboardingRecentCreatedProject = {
126117
isProjectActive: boolean | undefined;
127118
project: Project | undefined;
128119
};
129-
130-
export type OnboardingPlatformDoc = {html: string; link: string};

static/app/types/organization.tsx

-6
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,6 @@ export interface SavedQuery extends NewQuery {
288288
id: string;
289289
}
290290

291-
export type SavedQueryState = {
292-
hasError: boolean;
293-
isLoading: boolean;
294-
savedQueries: SavedQuery[];
295-
};
296-
297291
export type Confidence = 'high' | 'low' | null;
298292

299293
export type EventsStatsData = Array<

static/app/types/profiling/core.tsx

-27
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,3 @@ type Span = {
4141
}>;
4242
queue_label?: string;
4343
};
44-
45-
export type SuspectFunction = {
46-
count: number;
47-
examples: string[];
48-
fingerprint: number;
49-
name: string;
50-
p75: number;
51-
p95: number;
52-
p99: number;
53-
package: string;
54-
sum: number;
55-
worst: string;
56-
};
57-
58-
export type ProfileTransaction = {
59-
duration_ms: {
60-
p50: number;
61-
p75: number;
62-
p90: number;
63-
p95: number;
64-
p99: number;
65-
};
66-
last_profile_at: string;
67-
name: string;
68-
profiles_count: number;
69-
project_id: string;
70-
};

static/app/types/system.tsx

-5
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,3 @@ export interface StatuspageIncident {
457457
*/
458458
updated_at: string | undefined;
459459
}
460-
461-
export type PromptActivity = {
462-
dismissedTime?: number;
463-
snoozedTime?: number;
464-
};

static/app/types/user.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,3 @@ export type InternetProtocol = {
130130
lastSeen: string;
131131
regionCode: string | null;
132132
};
133-
134-
export type SubscriptionDetails = {disabled?: boolean; reason?: string};

static/app/types/workflowEngine/dataConditions.tsx

-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ export interface NewDataCondition {
7070
condition_result?: any;
7171
}
7272

73-
export interface DataCondition extends Readonly<NewDataCondition> {
74-
readonly id: string;
75-
type: DataConditionGroupLogicType;
76-
}
77-
7873
export interface DataConditionGroup {
7974
conditions: NewDataCondition[];
8075
id: string;

static/app/utils/analytics/starfishAnalyticsEvents.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ type StarfishEventParameters = {
3838
};
3939
};
4040

41-
export type StarfishEventKey = keyof StarfishEventParameters;
42-
4341
export const starfishEventMap: Record<keyof StarfishEventParameters, string> = {
4442
'starfish.chart.zoom': 'Starfish: Chart Zoomed',
4543
'starfish.pageview': 'Starfish: Page Viewed',

static/app/utils/discover/fieldRenderers.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ type FieldFormatters = {
129129
string: FieldFormatter;
130130
};
131131

132-
export type FieldTypes = keyof FieldFormatters;
133-
134132
const EmptyValueContainer = styled('span')`
135133
color: ${p => p.theme.subText};
136134
`;

static/app/utils/discover/fields.tsx

-5
Original file line numberDiff line numberDiff line change
@@ -656,11 +656,6 @@ export type Aggregation = {
656656

657657
export const DEPRECATED_FIELDS: string[] = [FieldKey.CULPRIT];
658658

659-
export type FieldTag = {
660-
key: FieldKey;
661-
name: FieldKey;
662-
};
663-
664659
export const FIELD_TAGS = Object.freeze(
665660
Object.fromEntries(DISCOVER_FIELDS.map(item => [item, {key: item, name: item}]))
666661
);

0 commit comments

Comments
 (0)