Skip to content

Commit

Permalink
clean up type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Mar 25, 2024
1 parent 08fafbb commit 4600d78
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/imports/background/data-sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
startOfDay,
WEEK_IN_MS,
} from '@worldbrain/memex-common/lib/utils/date-time'
import { browser } from 'webextension-polyfill-ts'

const getDirNestedCollectionName = (dirNode) => {
const parentCollectionName = dirNode.collectionName ?? ''
Expand Down
2 changes: 1 addition & 1 deletion src/imports/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TagsBackground from 'src/tags/background'
import CustomListBackground from 'src/custom-lists/background'
import { PageIndexingBackground } from 'src/page-indexing/background'
import BookmarksBackground from 'src/bookmarks/background'
import type { Runtime, Storage } from 'webextension-polyfill-ts'
import type { Runtime, Storage } from 'webextension-polyfill'

// Constants
export const importStateStorageKey = 'import_items'
Expand Down
6 changes: 4 additions & 2 deletions src/imports/background/progress-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import Processor from './item-processor'

import * as urlLists from './url-list.test.data'
import initData, { TestData, diff } from './state-manager.test.data'
import { browser } from 'webextension-polyfill-ts'
import browser from 'webextension-polyfill'
import { Browser } from 'webextension-polyfill'

jest.mock('src/blacklist/background/interface')
jest.mock('src/activity-logger')
Expand All @@ -24,7 +25,7 @@ const runSuite = (DATA: TestData, skip = false) => () => {
const dataSources = new DataSources({
history: DATA.history as any,
bookmarks: DATA.bookmarks as any,
browserAPIs: browser,
browserAPIs: browser as Browser,
})

const itemCreator = new ItemCreator({
Expand All @@ -33,6 +34,7 @@ const runSuite = (DATA: TestData, skip = false) => () => {
histKeys: new Set(),
bmKeys: new Set(),
}),
browserAPIs: browser as Browser,
})
stateManager = new ImportStateManager({
storageManager: null,
Expand Down
7 changes: 5 additions & 2 deletions src/imports/background/state-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { ImportItem } from './types'

import * as urlLists from './url-list.test.data'
import initData, { TestData, diff } from './state-manager.test.data'
import { browser } from 'webextension-polyfill-ts'
import browser from 'webextension-polyfill'
import { Browser } from 'webextension-polyfill'

type ForEachChunkCb = (
values: [string, ImportItem][],
Expand All @@ -27,10 +28,11 @@ const runSuite = (DATA: TestData) => () => {
const dataSources = new DataSources({
history: DATA.history as any,
bookmarks: DATA.bookmarks as any,
browserAPIs: browser,
browserAPIs: browser as Browser,
})

const itemCreator = new ItemCreator({
browserAPIs: browser as Browser,
dataSources,
existingKeySource: async () => ({
histKeys: new Set(),
Expand Down Expand Up @@ -60,6 +62,7 @@ const runSuite = (DATA: TestData) => () => {
histKeys: new Set(),
bmKeys: new Set(),
}),
browserAPIs: browser as Browser,
})
const localState = new State({
itemCreator,
Expand Down

0 comments on commit 4600d78

Please sign in to comment.