UNPKG

@citrineos/util

Version:

The OCPP util module which supplies helpful utilities like cache and queue connectors, etc.

17 lines (16 loc) 950 B
import { ICache } from '@citrineos/base'; import { ClassConstructor } from 'class-transformer'; import { RedisClientOptions } from 'redis'; /** * Implementation of cache interface with redis storage */ export declare class RedisCache implements ICache { private _client; constructor(clientOptions?: RedisClientOptions); exists(key: string, namespace?: string): Promise<boolean>; remove(key: string, namespace?: string | undefined): Promise<boolean>; onChange<T>(key: string, waitSeconds: number, namespace?: string | undefined, classConstructor?: (() => ClassConstructor<T>) | undefined): Promise<T | null>; get<T>(key: string, namespace?: string, classConstructor?: () => ClassConstructor<T>): Promise<T | null>; set(key: string, value: string, namespace?: string, expireSeconds?: number): Promise<boolean>; setIfNotExist(key: string, value: string, namespace?: string, expireSeconds?: number): Promise<boolean>; }