@uppy/companion
Version:
OAuth helper and remote fetcher for Uppy's (https://uppy.io) extensible file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Dropbox and Google Drive, S3 and more :dog:
18 lines (17 loc) • 794 B
TypeScript
/**
* This module simulates the builtin events.EventEmitter but with the use of redis.
* This is useful for when companion is running on multiple instances and events need
* to be distributed across.
*
* @param {import('ioredis').Redis} redisClient
* @param {string} redisPubSubScope
* @returns
*/
export default function redisEmitter(redisClient: import("ioredis").Redis, redisPubSubScope: string): {
on: (eventName: string, handler: any) => Promise<void>;
off: (eventName: string, handler: any) => Promise<void>;
once: (eventName: string, handler: any) => Promise<void>;
emit: (eventName: string, ...args: any[]) => Promise<void>;
removeListener: (eventName: string, handler: any) => Promise<void>;
removeAllListeners: (eventName: string) => Promise<void>;
};