/** * Copyright (c) 2018-present, tarant * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import Actor from '../actor-system/actor'; import ActorSystem from '../actor-system/actor-system'; type TopicSeenAs = T & Topic; export default class Topic extends Actor { /** * Creates a topic for the given actor system. The id of the topic will be `topics/NAME_OF_THE_TOPIC` * * @param system Actor system where the topic will live * @param name Name of the topic to be created * @param consumerClass Protocol of the topic */ static for(system: ActorSystem, name: string, consumerClass: new (...args: any[]) => T): TopicSeenAs; private readonly subscriptions; constructor(topicName: string, consumerClass: new (...args: any[]) => T); subscribe(t: T): string; unsubscribe(id: string): void; } export {};