@gwigz/homunculus-core
Version:
A third-party framework for interacting with Linden Lab's virtual world "Second Life"
80 lines (79 loc) • 2.54 kB
TypeScript
import { AsyncEventEmitter } from "@vladfrangu/async_event_emitter";
import type { Client } from "../client";
import type { NearbyChatMessage } from "../types";
export interface NearbyEvents {
chat: [chat: NearbyChatMessage];
}
export declare class Nearby extends AsyncEventEmitter<NearbyEvents> {
private readonly client;
private typingTimeout?;
/**
* @internal
*/
constructor(client: Client);
/**
* Agents within 20 meters of the client's position.
*
* To get a complete list, use `client.region.agents`.
*/
get agents(): import("../types").Agent[];
/**
* Starts typing in the current region.
*
* @param timeout Optional, milliseconds to wait before stop typing is called.
*/
startTyping(timeout?: number): Promise<void>;
/**
* Stops typing in the current region.
*/
stopTyping(): void;
/**
* Sends a whisper to the specified channel.
*
* @param message The message to send.
* @param channel Optional, channel to send the message to.
*/
whisper(message: string, channel?: number): void;
/**
* Sends a normal message to the specified channel.
*
* @param message The message to send.
* @param channel Optional, channel to send the message to.
*/
say(message: string, channel?: number): void;
/**
* Sends a shout message to the specified channel.
*
* @param message The message to send.
* @param channel Optional, channel to send the message to.
*/
shout(message: string, channel?: number): void;
/**
* Sends a message to the specified channel.
*
* @param message The message to send.
* @param channel Optional, channel to send the message to.
* @param type Optional, type of message to send.
*/
message(message: string, channel?: number, type?: number): void;
/**
* Ejects the specified agent from the current region.
*
* @param key The key of the agent to eject.
* @param ban Optional, whether to ban the agent from the region.
*/
eject(key: string, ban?: boolean): void;
/**
* Freezes the specified agent in the current region.
*
* @param key The key of the agent to freeze.
*/
freeze(key: string): void;
/**
* Unfreezes the specified agent in the current region.
*
* @param key The key of the agent to unfreeze.
*/
unfreeze(key: string): void;
triggerSound(soundId: string, gain?: number): Promise<void>;
}