import { DatabaseDriver } from './database-driver' ; const Redis = require ( 'ioredis' ) ; export class RedisDatabase implements DatabaseDriver { type { any } protected redis : any ; param { any } options constructor ( protected options ) { this . redis = new Redis ( options . database . redis ) ; } param { string } key return { Promise < any > } get ( key ) { return new Promise < any > ( ( resolve , reject ) => { this . redis . get ( key ) . then ( value => resolve ( JSON . parse ( value ) ) ) ; } ) ; } param { string } key param { any } value return { void } set ( key , value ) { this . redis . set ( key , JSON . stringify ( value ) ) ; } }