Chore: Move most types from rrweb to @rrweb/types package (#1031)

* Chore: Add move most types from rrweb to @rrweb/types package

* Split off type imports

* Split off type import to its own line

* Get vite to generate type definitions

* Apply formatting changes

* noEmit not allowed in tsconfig, moved it to build step

* Align version of @rrweb/types with main rrweb package

Based on @mark-fenng's comments https://github.com/rrweb-io/rrweb/pull/1031/files#r1002298176

* Move up keywords
This commit is contained in:
Justin Halsall
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 96ba547e72
commit 905ac51afb
69 changed files with 1307 additions and 712 deletions

View File

@@ -43,6 +43,7 @@
"rollup-plugin-typescript2": "^0.31.2",
"rollup-plugin-web-worker-loader": "^1.6.1",
"ts-jest": "^27.1.3",
"@rrweb/types": "^2.0.0-alpha.3",
"typescript": "^4.7.3"
},
"dependencies": {

View File

@@ -6,7 +6,7 @@ import type {
scrollData,
styleDeclarationData,
styleSheetRuleData,
} from 'rrweb/src/types';
} from '@rrweb/types';
import type {
IRRCDATASection,
IRRComment,

View File

@@ -14,7 +14,7 @@ import type {
scrollData,
styleSheetRuleData,
styleDeclarationData,
} from 'rrweb/src/types';
} from '@rrweb/types';
import {
BaseRRNode as RRNode,
BaseRRCDATASectionImpl,

View File

@@ -12,12 +12,12 @@ import {
import type { IRRNode } from '../src/document';
import { Replayer } from 'rrweb';
import type {
eventWithTime,
canvasMutationData,
styleDeclarationData,
styleSheetRuleData,
} from 'rrweb/src/types';
import { EventType, IncrementalSource } from 'rrweb/src/types';
import type { eventWithTime } from 'rrweb/typings/types';
} from '@rrweb/types';
import { EventType, IncrementalSource } from '@rrweb/types';
const elementSn = {
type: RRNodeType.Element,

View File

@@ -18,6 +18,9 @@
"references": [
{
"path": "../rrweb-snapshot"
},
{
"path": "../types"
}
],
"compileOnSave": true,