
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
@rrweb/types
Advanced tools
This package contains the shared types used across rrweb packages. See the [guide](../../guide.md) for more info on rrweb.
@rrweb/types is a TypeScript type definition package for rrweb, a library for recording and replaying user interactions on web pages. This package provides type definitions for various events and data structures used in rrweb, making it easier to work with rrweb in TypeScript projects.
Event Types
Defines the structure of an event with time, which includes the type of event, data associated with the event, timestamp, and delay.
import { eventWithTime } from '@rrweb/types';
const event: eventWithTime = {
type: 1,
data: {},
timestamp: Date.now(),
delay: 0
};
Incremental Snapshot Event
Defines the structure of an incremental snapshot event, which includes the type of event, data related to the snapshot, timestamp, and delay.
import { incrementalSnapshotEvent } from '@rrweb/types';
const snapshotEvent: incrementalSnapshotEvent = {
type: 2,
data: {
source: 1,
positions: [{ x: 0, y: 0, id: 1 }]
},
timestamp: Date.now(),
delay: 0
};
Full Snapshot Event
Defines the structure of a full snapshot event, which includes the type of event, data related to the full snapshot, timestamp, and delay.
import { fullSnapshotEvent } from '@rrweb/types';
const fullSnapshot: fullSnapshotEvent = {
type: 3,
data: {
node: {
id: 1,
type: 1,
childNodes: []
}
},
timestamp: Date.now(),
delay: 0
};
TypeScript is a superset of JavaScript that adds static types. While it doesn't provide specific types for rrweb, it allows you to define your own types and interfaces, offering flexibility and type safety in your projects.
io-ts is a runtime type system for IO decoding/encoding in TypeScript. It allows you to define types and validate data at runtime, which can be useful for ensuring the correctness of data structures similar to those used in rrweb.
Zod is a TypeScript-first schema declaration and validation library. It provides a way to define and validate data structures, similar to the type definitions provided by @rrweb/types, but with additional runtime validation capabilities.
This package contains the shared types used across rrweb packages. See the guide for more info on rrweb.
Become a sponsor and get your logo on our README on Github with a link to your site.
Yuyz0112 |
Yun Feng |
eoghanmurray |
Juice10 open for rrweb consulting |
![]() |
![]() |
|
|
|
![]() |
![]() |
![]() |
|
|
![]() |
|
FAQs
This package contains the shared types used across rrweb packages. See the [guide](../../guide.md) for more info on rrweb.
The npm package @rrweb/types receives a total of 571,124 weekly downloads. As such, @rrweb/types popularity was classified as popular.
We found that @rrweb/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
Company News
Socketās acquisition of Coana brings best-in-class reachability analysis to application security teams globally, cementing Socketās position as the leader in software supply chain security.