diff --git a/static/app/utils/types/flatten.tsx b/static/app/utils/types/flatten.tsx deleted file mode 100644 index c26bc40c93d7c6..00000000000000 --- a/static/app/utils/types/flatten.tsx +++ /dev/null @@ -1,18 +0,0 @@ -// From type-fest simplify but renamed to Flatten https://github.com/sindresorhus/type-fest/blob/5dbd7aed6ac6bb561229761ff7a3061098e47704/source/simplify.d.ts - -// MIT License - -// Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -/** - * Useful to flatten the type output to improve type hints shown in editors. - * And also to transform an interface into a type to aide with assignability. - * see more examples @link https://github.com/sindresorhus/type-fest/blob/main/source/simplify.d.ts - */ -export type Flatten = {[KeyType in keyof T]: T[KeyType]} & {}; diff --git a/static/app/views/insights/common/components/tableCells/starredSegmentCell.tsx b/static/app/views/insights/common/components/tableCells/starredSegmentCell.tsx index f0f2072cf616b9..cbbe80614cf2c2 100644 --- a/static/app/views/insights/common/components/tableCells/starredSegmentCell.tsx +++ b/static/app/views/insights/common/components/tableCells/starredSegmentCell.tsx @@ -1,10 +1,11 @@ +import type {Simplify} from 'type-fest'; + import {Button} from 'sentry/components/core/button'; import {IconStar} from 'sentry/icons'; import {t} from 'sentry/locale'; import type {EventsMetaType} from 'sentry/utils/discover/eventView'; import {FlexContainer} from 'sentry/utils/discover/styles'; import {useQueryClient} from 'sentry/utils/queryClient'; -import type {Flatten} from 'sentry/utils/types/flatten'; import useProjects from 'sentry/utils/useProjects'; import {useStarredSegment} from 'sentry/views/insights/common/utils/useStarredSegment'; import type {SpanResponse} from 'sentry/views/insights/types'; @@ -15,7 +16,7 @@ interface Props { segmentName: string; } -type TableRow = Flatten< +type TableRow = Simplify< Partial & Pick >; diff --git a/static/app/views/insights/types.tsx b/static/app/views/insights/types.tsx index d309da76ddd61b..7c7ff380a52774 100644 --- a/static/app/views/insights/types.tsx +++ b/static/app/views/insights/types.tsx @@ -1,6 +1,7 @@ +import type {Simplify} from 'type-fest'; + import type {PlatformKey} from 'sentry/types/project'; import type {MutableSearch} from 'sentry/utils/tokenizeSearch'; -import type {Flatten} from 'sentry/utils/types/flatten'; import type {SupportedDatabaseSystem} from 'sentry/views/insights/database/utils/constants'; export enum ModuleName { @@ -499,7 +500,7 @@ type SpanResponseRaw = { [Property in SpanFields as `${SpanFunction.COUNT_IF}(${Property},${string},${string})`]: number; }; -export type SpanResponse = Flatten; +export type SpanResponse = Simplify; export type SpanProperty = keyof SpanResponse; export type SpanQueryFilters = Partial> & { @@ -536,7 +537,7 @@ type ErrorResponseRaw = { [Property in NoArgErrorFunction as `${Property}()`]: number; }; -export type ErrorResponse = Flatten; +export type ErrorResponse = Simplify; export type ErrorProperty = keyof ErrorResponse; // Maps the subregion code to the subregion name according to UN m49 standard