Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
raducristianpopa committed Mar 13, 2024
1 parent 04af608 commit 0166bc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/popup/lib/context.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'
import { getContextData } from '@/popup/lib/messages'
import { PopupStore } from '@/shared/types'
import { DeepNonNullable, PopupStore } from '@/shared/types'

export enum ReducerActionType {
SET_DATA = 'SET_DATA',
TOGGLE_WM = 'TOGGLE_WM'
}

export type PopupState = Required<NonNullable<PopupStore>>
export type PopupState = Required<DeepNonNullable<PopupStore>>

export interface PopupContext {
state: Required<NonNullable<PopupState>>
Expand Down
5 changes: 5 additions & 0 deletions src/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ export type PopupStore = Omit<
> & {
website: WebsiteData
}

export type DeepNonNullable<T> = {
[P in keyof T]?: NonNullable<T[P]>;
}

0 comments on commit 0166bc6

Please sign in to comment.