/** * Interpolates different parameters into a string. * The provided string can set the parameters to replace wrapping a parameter name in curly * braces. This will then be replaced by the parameter value as long as it is defined. If it * is not provided, the parameter name will just be removed from the final string. * * @param string - The string to interpolate different parameters in. * @param parameters - Value of the different parameters to interpolate. * @returns The interpolated string. * @example Different usages of the interpolate function. * ```js * interpolate('https://{env}.empathy.co/{instance}', { * env: 'live', * instance: 'demo' * }) // 'https://live.empathy.co/demo' * * interpolate('https://{(api-)env}.empathy.co/{instance}', { * env: 'live', * instance: 'demo' * }) // 'https://api-live.empathy.co/demo' * * interpolate('https://api.{env(.)}empathy.co/{instance}', { * env: 'live', * instance: 'demo' * }) // 'https://api.live.empathy.co/demo' * * interpolate('https://{(api-)env(.)}empathy.co/{instance}', { * env: 'live', * instance: 'demo' * }) // 'https://api-live.empathy.co/demo' * * interpolate('https://{env}.empathy.co/{instance}', { * env: 'live' * }) // 'https://live.empathy.co/' * * interpolate('https://search{(api-)env}.empathy.co/{instance}', { * instance: 'demo' * }) // 'https://search.empathy.co/demo' * * interpolate('https://api.{env(.)}empathy.co/{instance}', { * instance: 'demo' * }) // 'https://api.empathy.co/demo' * * interpolate('https://search.{(api-)env(.)}empathy.co/{instance}', { * instance: 'demo' * }) // 'https://search.empathy.co/demo' * ``` * @public */ export declare function interpolate(string: string, parameters: Record): string;