import { Claims } from './types/claims.js'; import { GeneratorOptions } from './types/generatorOptions.js'; import './types/acl.js'; /** * Validates the generator options and constructs the claims object. * * @param {GeneratorOptions} [opts] - The generator options. * @return {Claims} - The claims object. * @private */ declare const validateOptions: (opts?: GeneratorOptions) => Claims; /** * Generates a JWT token. * * @param {string} applicationId - The application id. * @param {string | Buffer} privateKey - The private key as a string or buffer. * @param {GeneratorOptions} [opts] - Optional generator options. * @return {string} - Returns the signed JWT token. * @throws {MissingApplicationIdError} Throws an error if applicationId is missing. * @throws {MissingPrivateKeyError} Throws an error if privateKey is missing. * @throws {InvalidApplicationIdError} Throws an error if applicationId is not a string. * @throws {InvalidPrivateKeyError} Throws an error if privateKey is not a string or buffer. * @see {@link https://developer.vonage.com/en/getting-started/concepts/authentication#json-web-tokens} * * @example * Generate a JWT token with default claims. * * ```js * const privateKey = fs.readFileSync(__dirname + '/private.key'); * const token = tokenGenerate(applicationId, privateKey); * ``` * * @example * Generate a JWT token with custom claims. * * ```js * const privateKey = fs.readFileSync(__dirname + '/private.key'); * const token = tokenGenerate(applicationId, privateKey, { * subject: 'my-subject', * acl: { * paths: { * '/*\/users\/**': {}, * '/*\/conversations\/**': {}, * '/*\/sessions\/**': {}, * }, * }, * }); * ``` */ declare const tokenGenerate: (applicationId: string, privateKey: string | Buffer, opts?: GeneratorOptions) => string; export { tokenGenerate, validateOptions };