diff --git a/types/mosca/index.d.ts b/types/mosca/index.d.ts index 178f150d05..aee3625d10 100644 --- a/types/mosca/index.d.ts +++ b/types/mosca/index.d.ts @@ -1,9 +1,11 @@ // Type definitions for mosca 2.8 // Project: https://github.com/mcollina/mosca // Definitions by: Joao Gabriel Gouveia +// Jerray Fu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export class Server { + id: string; opts: any; modernOpts: any; clients: any; @@ -83,3 +85,15 @@ export interface Message { qos: number; retain: boolean; } + +export namespace persistence { + interface Persistence { + wire(server: Server): void; + } + type FactoryFunc = (options: { [key: string]: any }) => Persistence; + + const Redis: FactoryFunc; + const Mongo: FactoryFunc; + const LevelUp: FactoryFunc; + const Memory: FactoryFunc; +}