kamranahmedse / redux-persist-expire

Expiring transformer for redux-persist
MIT License
78 stars 12 forks source link

TypeScript Types #28

Closed BartusZak closed 1 year ago

BartusZak commented 2 years ago

Hey,

Are there any TypeScript Types for package?

0529bill commented 2 years ago

add a redux-persist-expire.d.ts with the code below to the root of your project

declare module 'redux-persist-expire' {
    import { createTransform } from 'redux-persist'
    interface ConfigType {
        persistedAtKey?: string
        expireSeconds?: null | number
        expiredState?: unknown
        autoExpire?: boolean
    }

    export default function expireReducer(reducerKey: string, config: ConfigType): typeof createTransform
}
kamranahmedse commented 1 year ago

Type definitions have been added in the latest version 1.1.1