import { expectError, expectType } from 'tsd' import mqEmitter from '../mqemitter' import type { Message, MQEmitter } from '../mqemitter' expectType(mqEmitter()) expectType(mqEmitter({ concurrency: 200, matchEmptyLevels: true })) expectType( mqEmitter({ concurrency: 10, matchEmptyLevels: true, separator: '/', wildcardOne: '+', wildcardSome: '#', }) ) function listener (message: Message, done: () => void) {} expectType(mqEmitter().on('topic', listener)) expectError(mqEmitter().emit(null)) expectType( mqEmitter().emit({ topic: 'test', prop1: 'prop1', [Symbol.for('me')]: 42 }) ) expectType(mqEmitter().emit({ topic: 'test', prop1: 'prop1' }, () => {})) expectType(mqEmitter().removeListener('topic', listener)) expectType(mqEmitter().close(() => null))