export type MsisdnSource = 'option' | 'env' | 'default' | 'runtime'; /** * The number a server instance answers for when a call does not name one. * * This used to be two module-level variables. That is correct for a stdio server, * where one process serves one client, and wrong the moment the server is hosted: * every request in a Next.js process shares the module, so one caller changing the * default changed it for everybody. State that belongs to a conversation has to * live on the server instance that serves it, so it is a value created per server. */ export interface Session { getDefaultMsisdn(): string; getDefaultMsisdnSource(): MsisdnSource; /** Validate and install a new default. Throws MsisdnError on a bad number. */ setDefaultMsisdn(input: string): string; /** The number for a call: the explicit argument, else the session default. */ resolveMsisdn(explicit?: string): string; } export interface SessionOptions { /** * Starting number. Wins over TSEL_DEFAULT_MSISDN. A malformed value throws, * because a host that passes one has made a configuration mistake and should * hear about it rather than silently get the dummy number. */ defaultMsisdn?: string; } export declare function createSession(options?: SessionOptions): Session;