import { ChannelInfo, IncEvent, Subscription, ChannelHandle } from '@napplet/core'; /** * Napplet NAP inc sdk entrypoint. * * @module */ /** * @napplet/nap/inc -- SDK helpers wrapping window.napplet.inc. * * These convenience functions delegate to `window.napplet.inc.*` at call time. * The shim must be imported somewhere to install the global. */ /** * Broadcast an INC message to other napplets via the shell. * * @param topic An opaque stable topic or convention URI * @param payload Optional opaque payload for a queryless topic * * @example * ```ts * import { incEmit } from '@napplet/nap/inc'; * * incEmit('napplet:profile/open', { pubkey: '...' }); * ``` */ declare function incEmit(topic: string, payload?: unknown): void; /** * Subscribe to INC events on a specific topic. * * @param topic Exact topic value to listen for * @param callback Called with one runtime-attested INC event * @returns A Subscription handle with a `close()` method * * @example * ```ts * import { incOn } from '@napplet/nap/inc'; * * const sub = incOn('napplet:profile/open', (event) => { * console.log('Profile requested:', event.payload); * }); * // Later: sub.close(); * ``` */ declare function incOn(topic: string, callback: (event: IncEvent) => void): Subscription; /** * Open a point-to-point INC channel. * * @param target Target napplet dTag * @returns Symmetric channel handle */ declare function incOpenChannel(target: string): Promise; /** * Subscribe to inbound INC channels. * * @param callback Called with each symmetric channel handle * @returns Subscription handle */ declare function incOnChannelOpened(callback: (handle: ChannelHandle) => void): Subscription; /** * List active INC channels. * * @returns Active channel snapshots */ declare function incListChannels(): Promise; /** * Broadcast to all open INC channel peers. * * @param payload Optional opaque payload * @returns Nothing */ declare function incBroadcast(payload?: unknown): void; export { incBroadcast, incEmit, incListChannels, incOn, incOnChannelOpened, incOpenChannel };