Skip to content

Commit 7d4dc21

Browse files
committed
Correct type imports for web-extensions package
1 parent 69c2f5e commit 7d4dc21

File tree

9 files changed

+24
-28
lines changed

9 files changed

+24
-28
lines changed

packages/web-extension/src/background/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import Browser from 'webextension-polyfill';
22
import type { eventWithTime } from '@rrweb/types';
33
import Channel from '~/utils/channel';
44
import {
5-
LocalData,
5+
type LocalData,
66
LocalDataKey,
77
RecorderStatus,
8-
Settings,
9-
SyncData,
8+
type Settings,
9+
type SyncData,
1010
SyncDataKey,
1111
} from '~/types';
1212
import { pauseRecording, resumeRecording } from '~/utils/recording';

packages/web-extension/src/components/CircleButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Button, ButtonProps } from '@chakra-ui/react';
1+
import { Button, type ButtonProps } from '@chakra-ui/react';
22

33
interface CircleButtonProps extends ButtonProps {
44
diameter: number;

packages/web-extension/src/components/SidebarWithHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {
1212
Drawer,
1313
DrawerContent,
1414
useDisclosure,
15-
BoxProps,
16-
FlexProps,
15+
type BoxProps,
16+
type FlexProps,
1717
Heading,
1818
Stack,
1919
Text,

packages/web-extension/src/content/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import Browser, { Storage } from 'webextension-polyfill';
1+
import Browser, { type Storage } from 'webextension-polyfill';
22
import { nanoid } from 'nanoid';
33
import type { eventWithTime } from '@rrweb/types';
44
import {
5-
LocalData,
5+
type LocalData,
66
LocalDataKey,
77
RecorderStatus,
88
ServiceName,
9-
Session,
10-
RecordStartedMessage,
11-
RecordStoppedMessage,
9+
type Session,
10+
type RecordStartedMessage,
11+
type RecordStoppedMessage,
1212
MessageName,
13-
EmitEventMessage,
13+
type EmitEventMessage,
1414
} from '~/types';
1515
import Channel from '~/utils/channel';
1616
import { isInCrossOriginIFrame } from '~/utils';

packages/web-extension/src/content/inject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { record } from 'rrweb';
22
import type { recordOptions } from 'rrweb';
33
import type { eventWithTime } from '@rrweb/types';
4-
import { MessageName, RecordStartedMessage } from '~/types';
4+
import { MessageName, type RecordStartedMessage } from '~/types';
55
import { isInCrossOriginIFrame } from '~/utils';
66

77
/**

packages/web-extension/src/pages/SessionList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ import {
2323
useReactTable,
2424
flexRender,
2525
getCoreRowModel,
26-
SortingState,
26+
type SortingState,
2727
getSortedRowModel,
28-
PaginationState,
28+
type PaginationState,
2929
} from '@tanstack/react-table';
3030
import { VscTriangleDown, VscTriangleUp } from 'react-icons/vsc';
3131
import { useNavigate } from 'react-router-dom';
32-
import { Session, EventName } from '~/types';
32+
import { type Session, EventName } from '~/types';
3333
import Channel from '~/utils/channel';
3434
import { deleteSessions, getAllSessions } from '~/utils/storage';
3535
import {

packages/web-extension/src/popup/App.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ import {
1010
} from '@chakra-ui/react';
1111
import { FiSettings, FiList, FiPause, FiPlay } from 'react-icons/fi';
1212
import Channel from '~/utils/channel';
13-
import {
13+
import type {
1414
LocalData,
15-
LocalDataKey,
16-
RecorderStatus,
17-
ServiceName,
1815
RecordStartedMessage,
1916
RecordStoppedMessage,
2017
Session,
21-
EventName,
2218
} from '~/types';
19+
import { LocalDataKey, RecorderStatus, ServiceName, EventName } from '~/types';
2320
import Browser from 'webextension-polyfill';
2421
import { CircleButton } from '~/components/CircleButton';
2522
import { Timer } from './Timer';
@@ -39,9 +36,8 @@ export function App() {
3936
void Browser.storage.local.get(LocalDataKey.recorderStatus).then((data) => {
4037
const localData = data as LocalData;
4138
if (!localData || !localData[LocalDataKey.recorderStatus]) return;
42-
const { status, startTimestamp, pausedTimestamp } = localData[
43-
LocalDataKey.recorderStatus
44-
];
39+
const { status, startTimestamp, pausedTimestamp } =
40+
localData[LocalDataKey.recorderStatus];
4541
setStatus(status);
4642
if (startTimestamp && pausedTimestamp)
4743
setStartTime(Date.now() - pausedTimestamp + startTimestamp || 0);

packages/web-extension/src/utils/channel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mitt from 'mitt';
2-
import Browser, { Runtime } from 'webextension-polyfill';
2+
import Browser, { type Runtime } from 'webextension-polyfill';
33

44
export type Message = EventType | ServiceType;
55
export type EventType = {

packages/web-extension/src/utils/recording.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import Browser from 'webextension-polyfill';
22
import type { eventWithTime } from '@rrweb/types';
33

44
import {
5-
LocalData,
5+
type LocalData,
66
LocalDataKey,
77
RecorderStatus,
8-
RecordStartedMessage,
9-
RecordStoppedMessage,
8+
type RecordStartedMessage,
9+
type RecordStoppedMessage,
1010
ServiceName,
1111
} from '~/types';
1212
import type Channel from './channel';

0 commit comments

Comments
 (0)