Update index.d.ts (#549)

Add addServerName, removeServerName, missingServerName
This commit is contained in:
joshxyzhimself 2021-06-11 17:03:34 +08:00 committed by GitHub
parent 8591a224cf
commit a84c61393b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
docs/index.d.ts vendored
View File

@ -306,6 +306,12 @@ export interface TemplatedApp {
publish(topic: RecognizedString, message: RecognizedString, isBinary?: boolean, compress?: boolean) : boolean;
/** Returns number of subscribers for this topic. */
numSubscribers(topic: RecognizedString) : number;
/** Adds a server name. */
addServerName(hostname: string, options: AppOptions): TemplatedApp;
/** Removes a server name. */
removeServerName(hostname: string): TemplatedApp;
/** Registers a synchronous callback on missing server names. See /examples/ServerName.js. */
missingServerName(cb: (hostname: string) => void): TemplatedApp;
}
/** Constructs a non-SSL app. An app is your starting point where you attach behavior to URL routes.