Skip to content

Commit

Permalink
fix(redux): types
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayden0323 committed Mar 11, 2024
1 parent c2248e5 commit ecb92bc
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions packages/redux/localstorage/hooks/useAllCustomTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import type { TokenAsObject, WithStorageState } from '../types'
type UseCustomTokensReturn = [
Record<string, Record<string, Token>>,
{
addCustomToken(payload: TokenAsObject): void
removeCustomToken(payload: Pick<TokenAsObject, 'address' | 'chainId'>): void
addCustomToken: (payload: TokenAsObject) => void
removeCustomToken: (payload: Pick<TokenAsObject, 'address' | 'chainId'>) => void
},
]

Expand Down
6 changes: 3 additions & 3 deletions packages/redux/localstorage/hooks/useCustomTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import type { TokenAsObject, WithStorageState } from '../types'
type UseCustomTokensReturn = [
Record<string, Token>,
{
addCustomToken(payload: TokenAsObject): void
addCustomTokens(payload: TokenAsObject[]): void
removeCustomToken(payload: Pick<TokenAsObject, 'address' | 'chainId'>): void
addCustomToken: (payload: TokenAsObject) => void
addCustomTokens: (payload: TokenAsObject[]) => void
removeCustomToken: (payload: Pick<TokenAsObject, 'address' | 'chainId'>) => void
},
]

Expand Down
22 changes: 11 additions & 11 deletions packages/redux/localstorage/hooks/useNotifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import type { WithStorageState } from '../types'
type UseNotificationsReturn = [
Record<number, string[]>,
{
createNotification(notification: NotificationData): void
createInlineNotification(notification: NotificationData): void
createPendingNotification(notification: Omit<NotificationData, 'promise'>): void
createSuccessNotification(notification: Omit<NotificationData, 'promise'>): void
createFailedNotification(notification: Omit<NotificationData, 'promise'>): void
createInfoNotification(notification: Omit<NotificationData, 'promise'>): void
clearNotifications(): void
createNotification: (notification: NotificationData) => void
createInlineNotification: (notification: NotificationData) => void
createPendingNotification: (notification: Omit<NotificationData, 'promise'>) => void
createSuccessNotification: (notification: Omit<NotificationData, 'promise'>) => void
createFailedNotification: (notification: Omit<NotificationData, 'promise'>) => void
createInfoNotification: (notification: Omit<NotificationData, 'promise'>) => void
clearNotifications: () => void
},
]

Expand All @@ -48,7 +48,7 @@ export const useNotifications: UseNotifications = (context, account) => {
)

const createPendingNotification = useCallback(
(rest: NotificationData) => {
(rest: Omit<NotificationData, 'promise'>) => {
const { groupTimestamp } = rest
createPendingToast(rest)
dispatch(actions.createNotification({ account, notification: stringify(rest), timestamp: groupTimestamp }))
Expand All @@ -57,7 +57,7 @@ export const useNotifications: UseNotifications = (context, account) => {
)

const createSuccessNotification = useCallback(
(rest: NotificationData) => {
(rest: Omit<NotificationData, 'promise'>) => {
const { groupTimestamp } = rest
createSuccessToast(rest)
dispatch(actions.createNotification({ account, notification: stringify(rest), timestamp: groupTimestamp }))
Expand All @@ -66,7 +66,7 @@ export const useNotifications: UseNotifications = (context, account) => {
)

const createFailedNotification = useCallback(
(rest: NotificationData) => {
(rest: Omit<NotificationData, 'promise'>) => {
const { groupTimestamp } = rest
createFailedToast(rest)
dispatch(actions.createNotification({ account, notification: stringify(rest), timestamp: groupTimestamp }))
Expand All @@ -75,7 +75,7 @@ export const useNotifications: UseNotifications = (context, account) => {
)

const createInfoNotification = useCallback(
(rest: NotificationData) => {
(rest: Omit<NotificationData, 'promise'>) => {
const { groupTimestamp } = rest
createInfoToast(rest)
dispatch(actions.createNotification({ account, notification: stringify(rest), timestamp: groupTimestamp }))
Expand Down
26 changes: 13 additions & 13 deletions packages/redux/localstorage/hooks/useSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import type { GasPrice, StorageState, WithStorageState } from '../types'
type UseSettingsReturn = [
Omit<StorageState, 'customTokens'>,
{
updateAggregator(aggregator: boolean): void
updateSlippageTolerance(slippageTolerance: number): void
updateSlippageToleranceType(slippageToleranceType: 'auto' | 'custom'): void
updateMaxFeePerGas(updateMaxFeePerGas: number | string | undefined): void
updateMaxPriorityFeePerGas(maxPriorityFeePerGas: number | string | undefined): void
updateGasPrice(gasPrice: GasPrice): void
updateGasType(gasType: 'preset' | 'custom'): void
updateTransactionDeadline(deadline: number): void
updateParachainId(parachainId: ParachainId): void
updatePolkadotConnector(polkadotConnector: string | undefined): void
updatePolkadotAddress(polkadotAddress: string | undefined): void
updateUserLocale(userLocale: string): void
updateHideAggregationSwapBanner(hideAggregationSwapBanner: boolean): void
updateAggregator: (aggregator: boolean) => void
updateSlippageTolerance: (slippageTolerance: number) => void
updateSlippageToleranceType: (slippageToleranceType: 'auto' | 'custom') => void
updateMaxFeePerGas: (updateMaxFeePerGas: number | string | undefined) => void
updateMaxPriorityFeePerGas: (maxPriorityFeePerGas: number | string | undefined) => void
updateGasPrice: (gasPrice: GasPrice) => void
updateGasType: (gasType: 'preset' | 'custom') => void
updateTransactionDeadline: (deadline: number) => void
updateParachainId: (parachainId: ParachainId) => void
updatePolkadotConnector: (polkadotConnector: string | undefined) => void
updatePolkadotAddress: (polkadotAddress: string | undefined) => void
updateUserLocale: (userLocale: string) => void
updateHideAggregationSwapBanner: (hideAggregationSwapBanner: boolean) => void
},
]

Expand Down
2 changes: 1 addition & 1 deletion packages/redux/token-lists/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function createTokenLists(options?: TokenListsOptions): {
reducer: Reducer<TokenListsState, AnyAction>
actions: CaseReducerActions<SliceCaseReducers<any>, string>
hooks: TokenListHooks
Updater(props: Omit<UpdaterProps, 'context'>): JSX.Element
Updater: (props: Omit<UpdaterProps, 'context'>) => JSX.Element
} {
const reducerPath = options?.reducerPath ?? 'token-lists'
const slice = createTokenListsSlice(reducerPath)
Expand Down

0 comments on commit ecb92bc

Please sign in to comment.