Skip to content

Commit f45be84

Browse files
🚚 [RUMF-848] move types and constants to respect the new ESLint rule
1 parent 6a03577 commit f45be84

File tree

9 files changed

+39
-32
lines changed

9 files changed

+39
-32
lines changed

packages/rum-core/src/domain/rumEventsCollection/action/trackActions.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@ import { addEventListener, Context, DOM_EVENT, generateUUID } from '@datadog/bro
22
import { LifeCycle, LifeCycleEventType } from '../../lifeCycle'
33
import { EventCounts, trackEventCounts } from '../../trackEventCounts'
44
import { waitIdlePageActivity } from '../../trackPageActivities'
5+
import { ActionType } from '../../../rawRumEvent.types'
56
import { getActionNameFromElement } from './getActionNameFromElement'
67

7-
export enum ActionType {
8-
CLICK = 'click',
9-
CUSTOM = 'custom',
10-
}
11-
128
type AutoActionType = ActionType.CLICK
139

1410
export interface ActionCounts {

packages/rum-core/src/domain/rumEventsCollection/resource/resourceUtils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ import {
88
ResourceType,
99
} from '@datadog/browser-core'
1010

11+
import { PerformanceResourceDetailsElement } from '../../../rawRumEvent.types'
1112
import { RumPerformanceResourceTiming } from '../../../browser/performanceCollection'
1213

13-
export interface PerformanceResourceDetailsElement {
14-
duration: number
15-
start: number
16-
}
17-
1814
export interface PerformanceResourceDetails {
1915
redirect?: PerformanceResourceDetailsElement
2016
dns?: PerformanceResourceDetailsElement

packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { supportPerformanceTimingEvent } from '../../../browser/performanceColle
44
import { LifeCycle, LifeCycleEventType } from '../../lifeCycle'
55
import { EventCounts, trackEventCounts } from '../../trackEventCounts'
66
import { waitIdlePageActivity } from '../../trackPageActivities'
7+
import { ViewLoadingType, ViewCustomTimings } from '../../../rawRumEvent.types'
78
import { Timings, trackTimings } from './trackTimings'
89

910
export interface View {
@@ -29,15 +30,6 @@ export interface ViewCreatedEvent {
2930
startTime: number
3031
}
3132

32-
export enum ViewLoadingType {
33-
INITIAL_LOAD = 'initial_load',
34-
ROUTE_CHANGE = 'route_change',
35-
}
36-
37-
export interface ViewCustomTimings {
38-
[key: string]: number
39-
}
40-
4133
export const THROTTLE_VIEW_UPDATE_PERIOD = 3000
4234
export const SESSION_KEEP_ALIVE_INTERVAL = 5 * ONE_MINUTE
4335

packages/rum-core/src/rawRumEvent.types.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import { Context, ErrorSource, ResourceType } from '@datadog/browser-core'
2-
import { ActionType } from './domain/rumEventsCollection/action/trackActions'
3-
import { PerformanceResourceDetailsElement } from './domain/rumEventsCollection/resource/resourceUtils'
4-
import { ViewCustomTimings, ViewLoadingType } from './domain/rumEventsCollection/view/trackViews'
1+
import type { Context, ErrorSource, ResourceType } from '@datadog/browser-core'
52

63
export enum RumEventType {
74
ACTION = 'action',
@@ -35,6 +32,11 @@ export interface RawRumResourceEvent {
3532
}
3633
}
3734

35+
export interface PerformanceResourceDetailsElement {
36+
duration: number
37+
start: number
38+
}
39+
3840
export interface RawRumErrorEvent {
3941
date: number
4042
type: RumEventType.ERROR
@@ -79,6 +81,15 @@ export interface RawRumViewEvent {
7981
}
8082
}
8183

84+
export enum ViewLoadingType {
85+
INITIAL_LOAD = 'initial_load',
86+
ROUTE_CHANGE = 'route_change',
87+
}
88+
89+
export interface ViewCustomTimings {
90+
[key: string]: number
91+
}
92+
8293
interface Count {
8394
count: number
8495
}
@@ -107,6 +118,11 @@ export interface RawRumActionEvent {
107118
}
108119
}
109120

121+
export enum ActionType {
122+
CLICK = 'click',
123+
CUSTOM = 'custom',
124+
}
125+
110126
export type RawRumEvent =
111127
| RawRumErrorEvent
112128
| RawRumResourceEvent
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const PRIVACY_ATTR_NAME = 'data-dd-privacy'
2+
export const PRIVACY_ATTR_VALUE_HIDDEN = 'hidden'
3+
export const PRIVACY_ATTR_VALUE_INPUT_IGNORED = 'input-ignored'
4+
5+
export const PRIVACY_CLASS_HIDDEN = 'dd-privacy-hidden'
6+
export const PRIVACY_CLASS_INPUT_IGNORED = 'dd-privacy-input-ignored'

packages/rum-recorder/src/domain/privacy.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
export const PRIVACY_ATTR_NAME = 'data-dd-privacy'
2-
export const PRIVACY_ATTR_VALUE_HIDDEN = 'hidden'
3-
export const PRIVACY_ATTR_VALUE_INPUT_IGNORED = 'input-ignored'
4-
5-
export const PRIVACY_CLASS_HIDDEN = 'dd-privacy-hidden'
6-
export const PRIVACY_CLASS_INPUT_IGNORED = 'dd-privacy-input-ignored'
1+
import {
2+
PRIVACY_ATTR_NAME,
3+
PRIVACY_ATTR_VALUE_HIDDEN,
4+
PRIVACY_CLASS_HIDDEN,
5+
PRIVACY_ATTR_VALUE_INPUT_IGNORED,
6+
PRIVACY_CLASS_INPUT_IGNORED,
7+
} from '../constants'
78

89
// PRIVACY_INPUT_TYPES_TO_IGNORE defines the input types whose input
910
// events we want to ignore by default, as they often contain PII.

packages/rum-recorder/src/domain/rrweb/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IdNodeMap, INode, MaskInputOptions, SerializedNodeWithId, SlimDOMOptions } from '../rrweb-snapshot'
1+
import { IdNodeMap, INode, MaskInputOptions, SerializedNodeWithId, SlimDOMOptions } from '../rrweb-snapshot/types'
22
import type { RawRecord } from '../../types'
33

44
export enum IncrementalSource {

packages/rum-recorder/src/internal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ export {
2222
PRIVACY_ATTR_VALUE_INPUT_IGNORED,
2323
PRIVACY_CLASS_HIDDEN,
2424
PRIVACY_CLASS_INPUT_IGNORED,
25-
} from './domain/privacy'
25+
} from './constants'
2626

2727
export * from './types'

packages/rum-recorder/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SerializedNodeWithId } from './domain/rrweb-snapshot'
1+
import { SerializedNodeWithId } from './domain/rrweb-snapshot/types'
22
import type { IncrementalData } from './domain/rrweb/types'
33

44
export { IncrementalSource } from './domain/rrweb/types'

0 commit comments

Comments
 (0)