import type { Subscription, Topic } from "../models/index.js"; export interface CreateTopicOptions { /** Tooling metadata; topics WITH a namespace register in the inspection registry. */ namespace?: string; /** Tooling metadata. */ name?: string; /** Called when subscriberCount transitions 0 → 1 (refCount pattern). */ onActivate?(): void; /** Called when subscriberCount transitions back to 0 (last unsubscribe or destroy). */ onDeactivate?(): void; } export declare function createTopic(options?: CreateTopicOptions): Topic; export declare function toSubscriber(topic: Topic): { subscribe: (handler: (data: T) => void) => Subscription; }; /** * A typed group of topics keyed by an event map — mitt-level DX on the Topic * primitive. Topics are created lazily per key on first access (the event-map * generic is erased at runtime, so keys are only known when touched) and are * namespaced/registered like any other topic. * * @example * ```ts * const group = createTopicGroup<{ loggedIn: User; loggedOut: void }>({ namespace: 'auth#1.events' }); * group.topics.loggedIn.publish(user); // payload type-checked * group.topics.loggedIn.subscribe(u => ...); // u: User * group.destroy(); // destroys all created topics * ``` */ export declare function createTopicGroup>(options?: { namespace?: string; }): { topics: { [K in keyof EventMap]: Topic; }; destroy(): void; }; //# sourceMappingURL=index.d.ts.map