coveo-search-ui
Version:
Coveo JavaScript Search Framework
1,547 lines • 91.7 kB
HTML
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ICoreHelpers | Coveo JavaScript Search Framework - Reference Documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://use.typekit.net/bqa0xml.css"></link>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.min.css" />
<link rel="stylesheet" href="../assets/css/main.css">
<link rel="stylesheet" href="../assets/css/overrides.css">
<link rel="stylesheet" href="../assets/css/coveo-connect-header.css">
<link rel="stylesheet" href="https://static.cloud.coveo.com/searchui/v2.10126/css/CoveoFullSearch.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="https://static.cloud.coveo.com/coveo.analytics.js/coveoua.js"></script>
<script src="../assets/js/modernizr.js"></script>
<script class="coveo-script" src="https://static.cloud.coveo.com/searchui/v2.10126/js/CoveoJsSearch.min.js"></script>
<script src="../assets/js/coveo-connect-header.js"></script>
<script src="../assets/gen/js/playground.js"></script>
<script src="../assets/js/searchUIrefDoc.js"></script>
<link href="../assets/favicon.ico" rel="shortcut icon" type="image/x-icon">
</head>
<body>
<header class="no-sticky">
<div class="content">
<div class="main-header">
<div class="logo">
<a class="logo-img-wrap" href="https://coveo.com">
<div class="logo-imgbg">
<svg width="124" height="32" viewBox="0 0 409 104" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M164.7 36.2L159.8 41.4C156.4 38.1 152.8 36.2 147.9 36.2C139.4 36.2 133 42.9 133 52.3C133 61.7 139.4 68.4 147.9 68.4C152.5 68.4 156.9 66.5 160.1 63.2L164.7 68.4C160.7 73 155 75.4 148.3 75.4C134.3 75.4 125.2 65.4 125.2 52.3C125.2 38.9 134.3 28.9 148.3 28.9C154.6 28.8 160.6 31.5 164.7 36.2Z" fill="white"/>
<path d="M219.4 52.3C219.4 65.4 209.4 75.4 196 75.4C182.3 75.4 172.3 65.4 172.3 52.3C172.3 38.9 182.3 28.9 196 28.9C209.4 28.9 219.4 38.9 219.4 52.3ZM180.2 52.3C180.2 61.7 186.9 68.4 196 68.4C204.8 68.4 211.5 61.7 211.5 52.3C211.5 42.9 204.8 36.2 196 36.2C186.9 36.2 180.2 42.9 180.2 52.3Z" fill="white"/>
<path d="M252.3 74.5H243.1L224.3 30.1H232.8L247.7 66.9L262.6 30.1H270.8L252.3 74.5Z" fill="white"/>
<path d="M318.8 52V55H283.8C284.7 64.1 291.1 68.7 298.7 68.7C303.8 68.8 308.8 66.9 312.7 63.5L316.7 68.7C311.2 73.9 305.1 75.5 298.4 75.5C285 75.5 275.6 66.4 275.6 52.4C275.6 38.7 285 29 297.8 29C310 28.9 318.8 38.6 318.8 52ZM283.9 48.6H311.3C310.4 41 305.2 35.8 297.9 35.8C290 35.9 285.1 41 283.9 48.6Z" fill="white"/>
<path d="M376 52.3C376 65.4 366 75.4 352.6 75.4C338.9 75.4 328.9 65.4 328.9 52.3C328.9 38.9 338.9 28.9 352.6 28.9C365.9 28.9 376 38.9 376 52.3ZM336.8 52.3C336.8 61.7 343.5 68.4 352.6 68.4C361.4 68.4 368.1 61.7 368.1 52.3C368.1 42.9 361.4 36.2 352.6 36.2C343.4 36.2 336.8 42.9 336.8 52.3Z" fill="white"/>
<path d="M88.1 14.9C79.5 6.4 68.3 1.2 56.2 0C55.3 0 54.6 0.8 54.6 1.8C54.6 2.2 54.7 2.5 55 2.8L73.8 21.3C73.8 21.6 73.8 21.6 73.5 21.6C68.3 17.8 62.2 15.5 55.9 14.9C55.3 14.8 54.8 15.2 54.7 15.8C54.7 16.1 54.8 16.4 55 16.7L67.8 29.5C67.8 29.5 67.8 29.8 67.5 29.5C64 27.3 60.1 25.9 55.9 25.5C55.3 25.5 55 26.1 55.3 26.7L76.9 48.3C77.5 48.9 78.4 48.3 78.1 47.7C77.8 43.6 76.4 39.6 74.1 36.1C73.8 36.1 74.1 35.8 74.1 36.1L86.6 48.3C87.2 48.9 88.4 48.3 88.4 47.4C87.7 41 85.4 34.8 81.7 29.5C81.4 29.5 81.7 29.2 81.7 29.5L100.6 48C101.1 48.6 101.9 48.7 102.5 48.3C103 48 103.2 47.4 103 46.8C101.9 34.7 96.6 23.4 88.1 14.9Z" fill="#00ADFF"/>
<path d="M14.9 14.9C23.6 6.5 34.8 1.2 46.8 0C47.7 0 48.4 0.6 48.5 1.5C48.5 1.9 48.4 2.4 48 2.7L29.5 21.3C29.2 21.6 29.5 21.6 29.5 21.6C34.8 17.8 41 15.5 47.4 14.9C48.3 14.9 48.9 16.1 48.3 16.7L35.6 29.5C35.3 29.5 35.6 29.8 35.6 29.5C39.1 27.3 43 26 47.2 25.5C47.8 25.5 48.4 26.1 47.8 26.7L26.1 48.3C25.5 48.9 24.9 48.3 24.9 47.7C25.3 43.6 26.8 39.6 29.2 36.1C29.2 36.1 28.9 35.8 28.9 36.1L16.7 48.3C15.8 48.9 14.6 48.3 14.9 47.4C15.5 40.9 17.8 34.7 21.6 29.5C21.6 29.5 21.3 29.2 21.3 29.5L2.7 48C1.5 49.2 0 48.3 0 46.8C1.2 34.8 6.5 23.6 14.9 14.9Z" fill="#F05245"/>
<path d="M14.9 88.8C23.4 97.4 34.7 102.7 46.8 103.7C47.6 103.8 48.3 103.3 48.4 102.5C48.5 102 48.3 101.6 48 101.2L29.5 82.4C29.2 82.4 29.5 82.1 29.5 82.4C34.8 86.2 41 88.5 47.4 89C48.3 89 48.9 87.8 48.3 87.2L35.6 74.5C35.3 74.2 35.6 74.2 35.6 74.2C39 76.5 43 78 47.1 78.4C47.7 78.4 48.3 77.5 47.7 77.2L26.1 55.6C25.5 55 24.9 55.3 24.9 56.2C25.3 60.3 26.8 64.3 29.2 67.8C29.2 67.8 28.9 68.1 28.9 67.8L16.7 55.6C15.8 55 14.6 55.3 14.9 56.5C15.5 62.9 17.8 69 21.6 74.1C21.6 74.3 21.5 74.4 21.3 74.4L2.7 55.6C2 55 0.9 55.2 0.4 55.9C0.2 56.2 0.1 56.5 0 56.9C1.1 68.9 6.4 80.2 14.9 88.8Z" fill="#1CEBCF"/>
<path d="M88.1 88.8C79.6 97.5 68.3 102.8 56.2 103.7C55 104 54.1 102.2 55 101.3L73.8 82.5C73.8 82.5 73.8 82.2 73.5 82.5C68.3 86.3 62.2 88.6 55.9 89.2C55.3 89.3 54.8 88.8 54.7 88.2C54.7 87.9 54.8 87.6 55 87.3L67.8 74.5C67.8 74.2 67.8 74.2 67.5 74.2C64.1 76.6 60.1 78.1 56 78.4C55.5 78.3 55.2 77.9 55.3 77.5C55.3 77.4 55.3 77.3 55.4 77.2L77 55.6C77.6 55 78.5 55.3 78.2 56.2C77.9 60.3 76.5 64.3 74.2 67.8C73.9 67.8 74.2 68.1 74.2 67.8L86.7 55.6C87.1 55.2 87.8 55.2 88.2 55.6C88.4 55.8 88.5 56.2 88.5 56.5C87.8 62.8 85.5 68.9 81.8 74.1C81.5 74.4 81.8 74.4 81.8 74.4L100.6 55.6C101.5 54.7 103.3 55.6 103 56.8C102 68.9 96.7 80.2 88.1 88.8Z" fill="#FFE300"/>
<path opacity="0.87" d="M390.8 31.9V43H388.9V31.9H385.4V30.1H394.4V31.9H390.8Z" fill="white"/>
<path opacity="0.87" d="M407.7 43V34.4L404.7 40.5999H403.3L400.3 34.4V43H398.3V30.2H400.3L404 38.2L407.7 30.2H409.6V43H407.7Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="409" height="104" fill="white"/>
</clipPath>
</defs>
</svg>
</div>
</a>
<a class="logo-text" href="https://docs.coveo.com">
<span class="logo-text-bar">|</span>
<span class="logo-text-custom">docs</span>
</a>
</div>
<div class="search">
<div id="coveoConnectHeaderStandaloneSearchbox" class="searchbox">
<div class="CoveoSearchbox" style="display: flex;" type="text" data-auto-focus="false" data-enable-omnibox="true"
data-inline="false" data-enable-wildcards="true" data-enable-search-as-you-type="false"
data-enable-reveal-query-suggest-addon="true" data-enable-query-syntax="true"
data-enable-field-addon="true" data-placeholder="Search"></div>
<div class="CoveoAnalytics"></div>
</div>
</div>
<nav class="subnav">
<ul>
<li><a href="https://connect.coveo.com/" target="_blank">Community</a></li>
<li><a href="https://docs.google.com/forms/d/e/1FAIpQLSeyNL18g4JWIDR5xEyIMY48JIjyjwXRmlCveecjXBNSLh4Ygg/viewform?usp=sf_link" target="_blank">Feedback</a></li>
<li><a href="https://docs.coveo.com/en/3378/">News</a></li>
</ul>
</nav>
</div>
</div>
</header>
<subHeader class="no-sticky">
<div class="content">
<nav class="navBar">
<ul>
<li><button class="dropdownButton">Guides<i class="fas fa-chevron-down"></i>
<ul class="dropdown">
<li><a href="https://docs.coveo.com/en/1724/">Searching With Coveo</a></li>
<li><a href="https://docs.coveo.com/en/2648/">Project Guide</a></li>
<li><a href="https://docs.coveo.com/en/1351/">Services</a></li>
</li>
</ul>
</button>
</li>
<li>
<button class="dropdownButton">API Reference<i class="fas fa-chevron-down"></i>
<ul class="dropdown">
<li><a href="https://coveo.github.io/search-ui/" target="_blank">JavaScript Search Framework</a></li>
<!-- <li><a href="#">Atomic</a></li> -->
<li><a href="https://docs.coveo.com/en/headless/latest/reference/">Headless</a></li>
<li><a href="https://docs.coveo.com/en/12/">Push API</a></li>
<li><a href="https://docs.coveo.com/en/8/">Field API</a></li>
<li><a href="https://docs.coveo.com/en/13/">Search API</a></li>
<li><a href="https://docs.coveo.com/en/18/">Usage Analytics API</a></li>
<li><a href="https://docs.coveo.com/en/4/">Other APIs</a></li>
</ul>
</button>
</li>
<li>
<button class="dropdownButton">Extensions<i class="fas fa-chevron-down"></i>
<ul class="dropdown">
<li><a href="https://docs.coveo.com/en/1499/">Coveo for Commerce</a></li>
<li><a href="https://docs.coveo.com/en/1243/">Coveo for Salesforce</a></li>
<li><a href="https://docs.coveo.com/en/1479/">Coveo for ServiceNow</a></li>
<li><a href="https://docs.coveo.com/en/2709/">Coveo for Sitecore</a></li>
</ul>
</button>
</li>
</ul>
</nav>
</div>
</subHeader>
<div class="container container-main">
<div class="row">
<div id="toc-column" class="col-1 col-menu menu-sticky-wrap menu-highlight">
<div id="filter-box-container">
<div id="filter-box-header">Filter</div>
<div id="filter-box-body">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<div class="ctr-box-filter">
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited" title="Display inherited methods and properties"> Inherited</label><br>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="filter-box-footer"></div>
</div>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<a id="globals-toc-link" href=../globals.html><b>Globals</b></a>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="icorehelpers.html" class="tsd-kind-icon">ICore<wbr>Helpers</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#anchor" class="tsd-kind-icon">anchor</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#currency" class="tsd-kind-icon">currency</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#date" class="tsd-kind-icon">date</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#datetime" class="tsd-kind-icon">date<wbr>Time</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#email" class="tsd-kind-icon">email</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#emaildatetime" class="tsd-kind-icon">email<wbr>Date<wbr>Time</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#encodecarriagereturn" class="tsd-kind-icon">encode<wbr>Carriage<wbr>Return</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#fromfiletypetoicon" class="tsd-kind-icon">from<wbr>File<wbr>Type<wbr>ToIcon</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#highlight" class="tsd-kind-icon">highlight</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#highlightstreamhtml" class="tsd-kind-icon">highlight<wbr>StreamHTML</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#highlightstreamtext" class="tsd-kind-icon">highlight<wbr>Stream<wbr>Text</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#image" class="tsd-kind-icon">image</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#ismobiledevice" class="tsd-kind-icon">is<wbr>Mobile<wbr>Device</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#loadtemplate" class="tsd-kind-icon">load<wbr>Template</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#number" class="tsd-kind-icon">number</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#shorten" class="tsd-kind-icon">shorten</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#shortenpath" class="tsd-kind-icon">shorten<wbr>Path</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#shortenuri" class="tsd-kind-icon">shorten<wbr>Uri</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#size" class="tsd-kind-icon">size</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#thumbnail" class="tsd-kind-icon">thumbnail</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#time" class="tsd-kind-icon">time</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#timespan" class="tsd-kind-icon">time<wbr>Span</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="icorehelpers.html#translatedcaption" class="tsd-kind-icon">translated<wbr>Caption</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
</ul>
</nav>
</div>
<div id="separator"></div>
<div class="col-2 col-content">
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<a id="home-menu-link" class="aui-nav-link" title="Go to the home page" href=..>
<i class="fa fa-home" aria-hidden="true"></i>
</a>
<li>
<a href="../globals.html">Globals</a>
</li>
<li>
<a href="icorehelpers.html">ICoreHelpers</a>
</li>
</ul>
<h1>Interface ICoreHelpers</h1>
</div>
</div>
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The core template helpers provided by default.</p>
</div>
<p><strong>Examples:</strong></p>
<p><strong>HTML</strong></p>
<pre><code class="lang-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"CoveoFieldValue"</span> <span class="hljs-attr">data-field</span>=<span class="hljs-string">"@videoduration"</span> <span class="hljs-attr">data-helper</span>=<span class="hljs-string">"timeSpan"</span> <span class="hljs-attr">data-helper-options-is-milliseconds</span>=<span class="hljs-string">"false"</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span>
</code></pre>
<p><strong>Underscore</strong></p>
<pre><code class="lang-erb"><span class="xml"><span class="hljs-tag"><<span class="hljs-name">%=</span></span></span><span class="ruby"> timeSpan(raw.videoduration, { <span class="hljs-symbol">isMilliseconds:</span> <span class="hljs-literal">false</span> }) </span><span class="xml"><span class="hljs-tag">%></span></span>
</code></pre>
</div>
</section>
<div class="preview-container tsd-panel">
<div class="overlay"></div>
</div>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#anchor" class="tsd-kind-icon">anchor</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#currency" class="tsd-kind-icon">currency</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#date" class="tsd-kind-icon">date</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#datetime" class="tsd-kind-icon">date<wbr>Time</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#email" class="tsd-kind-icon">email</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#emaildatetime" class="tsd-kind-icon">email<wbr>Date<wbr>Time</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#encodecarriagereturn" class="tsd-kind-icon">encode<wbr>Carriage<wbr>Return</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#fromfiletypetoicon" class="tsd-kind-icon">from<wbr>File<wbr>Type<wbr>ToIcon</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#highlight" class="tsd-kind-icon">highlight</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#highlightstreamhtml" class="tsd-kind-icon">highlight<wbr>StreamHTML</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#highlightstreamtext" class="tsd-kind-icon">highlight<wbr>Stream<wbr>Text</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#image" class="tsd-kind-icon">image</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#ismobiledevice" class="tsd-kind-icon">is<wbr>Mobile<wbr>Device</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#loadtemplate" class="tsd-kind-icon">load<wbr>Template</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#number" class="tsd-kind-icon">number</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#shorten" class="tsd-kind-icon">shorten</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#shortenpath" class="tsd-kind-icon">shorten<wbr>Path</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#shortenuri" class="tsd-kind-icon">shorten<wbr>Uri</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#size" class="tsd-kind-icon">size</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#thumbnail" class="tsd-kind-icon">thumbnail</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#time" class="tsd-kind-icon">time</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#timespan" class="tsd-kind-icon">time<wbr>Span</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="icorehelpers.html#translatedcaption" class="tsd-kind-icon">translated<wbr>Caption</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="anchor" class="tsd-anchor"></a>
<h3>anchor</h3>
<div class="tsd-signature tsd-kind-icon">anchor<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L219">ui/Templates/CoreHelpers.ts
:219</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Formats a clickable HTML link (<code><a></code>).</p>
</div>
<ul>
<li><code>href</code>: The link URI</li>
<li><code>options</code>: Optional. The options to use (see <a href="ianchorutilsoptions.html">IAnchorUtilsOptions</a>)</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>href<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><a href="ianchorutilsoptions.html" class="tsd-signature-type">IAnchorUtilsOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>href: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="ianchorutilsoptions.html" class="tsd-signature-type">IAnchorUtilsOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="currency" class="tsd-anchor"></a>
<h3>currency</h3>
<div class="tsd-signature tsd-kind-icon">currency<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L179">ui/Templates/CoreHelpers.ts
:179</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Formats a currency value to a string using the specified options.</p>
</div>
<ul>
<li><code>content</code>: The number value to format.</li>
<li><code>options</code>: Optional. The options to use (see <a href="icurrencytostringoptions.html">ICurrencyToStringOptions</a>).</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">?: </span><a href="icurrencytostringoptions.html" class="tsd-signature-type">ICurrencyToStringOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">any</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="icurrencytostringoptions.html" class="tsd-signature-type">ICurrencyToStringOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="date" class="tsd-anchor"></a>
<h3>date</h3>
<div class="tsd-signature tsd-kind-icon">date<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L157">ui/Templates/CoreHelpers.ts
:157</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Formats a date value to a date-only string using the specified options.</p>
</div>
<ul>
<li><code>content</code>: The Date value to format.</li>
<li><code>options</code>: Optional. The options to use (see <a href="idatetostringoptions.html">IDateToStringOptions</a>).</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">?: </span><a href="idatetostringoptions.html" class="tsd-signature-type">IDateToStringOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">any</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="idatetostringoptions.html" class="tsd-signature-type">IDateToStringOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="datetime" class="tsd-anchor"></a>
<h3>date<wbr>Time</h3>
<div class="tsd-signature tsd-kind-icon">date<wbr>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L172">ui/Templates/CoreHelpers.ts
:172</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Formats a date value to a date and time string using the specified
options.</p>
</div>
<ul>
<li><code>content</code>: The Date value to format.</li>
<li><code>options</code>: Optional. The options to use (see <a href="idatetostringoptions.html">IDateToStringOptions</a>).</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">?: </span><a href="idatetostringoptions.html" class="tsd-signature-type">IDateToStringOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">any</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="idatetostringoptions.html" class="tsd-signature-type">IDateToStringOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="email" class="tsd-anchor"></a>
<h3>email</h3>
<div class="tsd-signature tsd-kind-icon">email<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L212">ui/Templates/CoreHelpers.ts
:212</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Renders one or several email values in <code>mailto:</code> hyperlinks.</p>
</div>
<ul>
<li><code>value</code>: The string or array of strings that contains a list of semicolon-separated email
values. When multiple values are passed, each value is displayed in a
separate hyperlink.</li>
<li><code>companyDomain</code>: Optional. The string that contains your own domain (e.g.:
coveo.com). When specified, this parameter allows email addresses
coming from your own domain to be displayed in a shortened format
(e.g.: Full Name), whereas email addresses coming from an external
domain will be displayed in an extended format (e.g.: Full Name
(domain.com)). If this parameter is not specified, then the shortened
format will automatically be used.</li>
<li><code>me</code>: Optional. The string that contains the current username. If it is
specified, then the email address containing the current username will
be replaced by the localized string 'Me'.</li>
<li><code>lengthLimit</code>: Optional. The number of email addresses that you want to display
before an ellipse is added (e.g.: 'From Joe, John and 5 others').<br/>
The default value is 2.</li>
<li><code>truncateName</code>: Optional. When the username is available from the email address,
then you can specify if you want to truncate the full name. (e.g.:
'John S.' instead of 'John Smith').<br/>
The default value is <code>false</code>.</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string[]</span>, companyDomain<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, me<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, lengthLimit<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, truncateName<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string[]</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> companyDomain: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> me: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> lengthLimit: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> truncateName: <span class="tsd-signature-type">boolean</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="emaildatetime" class="tsd-anchor"></a>
<h3>email<wbr>Date<wbr>Time</h3>
<div class="tsd-signature tsd-kind-icon">email<wbr>Date<wbr>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L187">ui/Templates/CoreHelpers.ts
:187</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Formats a date value to a date and time string using options suitable for
email dates</p>
</div>
<ul>
<li><code>content</code>: The Date value to format.</li>
<li><code>options</code>: Optional. The options to use (see <a href="idatetostringoptions.html">IDateToStringOptions</a>).</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">?: </span><a href="idatetostringoptions.html" class="tsd-signature-type">IDateToStringOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">any</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="idatetostringoptions.html" class="tsd-signature-type">IDateToStringOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="encodecarriagereturn" class="tsd-anchor"></a>
<h3>encode<wbr>Carriage<wbr>Return</h3>
<div class="tsd-signature tsd-kind-icon">encode<wbr>Carriage<wbr>Return<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L333">ui/Templates/CoreHelpers.ts
:333</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Replace all carriage return in a string by a <br /> tag</p>
</div>
<ul>
<li><code>value</code>: The string value to replace the carriage returns in.</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="fromfiletypetoicon" class="tsd-anchor"></a>
<h3>from<wbr>File<wbr>Type<wbr>ToIcon</h3>
<div class="tsd-signature tsd-kind-icon">from<wbr>File<wbr>Type<wbr>ToIcon<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L254">ui/Templates/CoreHelpers.ts
:254</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Generates an icon based on the file type of the current result. The icon
will be contained inside a <code><span></code> element with the appropriate CSS
class.</p>
</div>
<ul>
<li><code>result</code>: Optional. The current result object inside your template. In
underscore, it is referenced as <code>obj</code>. By default, the result
will be resolved automatically from your current template function (
Meaning the nearest result in the current call stack execution inside
your template)</li>
<li><code>options</code>: Optional. The options to use (see <a href="iiconoptions.html">IIconOptions</a>).</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>result<span class="tsd-signature-symbol">?: </span><a href="iqueryresult.html" class="tsd-signature-type">IQueryResult</a>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> result: <a href="iqueryresult.html" class="tsd-signature-type">IQueryResult</a></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <span class="tsd-signature-type">any</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="highlight" class="tsd-anchor"></a>
<h3>highlight</h3>
<div class="tsd-signature tsd-kind-icon">highlight<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L87">ui/Templates/CoreHelpers.ts
:87</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Highlights a string using the provided highlight information.</p>
</div>
<ul>
<li><code>content</code>: The URI to shorten.</li>
<li><code>highlights</code>: Optional. The highlight information to use.</li>
<li><code>cssClass</code>: Optional. The name of the CSS class to use for highlighting.</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, highlights<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">IHighlight[]</span>, cssClass<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> highlights: <span class="tsd-signature-type">IHighlight[]</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> cssClass: <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="highlightstreamhtml" class="tsd-anchor"></a>
<h3>highlight<wbr>StreamHTML</h3>
<div class="tsd-signature tsd-kind-icon">highlight<wbr>StreamHTML<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L130">ui/Templates/CoreHelpers.ts
:130</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>This helper operates exactly like the <a href="icorehelpers.html#highlightstreamtext">highlightStreamText</a> helper, except
that it should be used to highlight HTML content. The helper takes care
of not highlighting the HTML markup.</p>
</div>
<ul>
<li><code>content</code>: The string content to highlight</li>
<li><code>termsToHighlight</code>: The terms to highlight (see <a href="ihighlightterm.html">IHighlightTerm</a>)</li>
<li><code>phraseToHighlight</code>: The phrases to highlight (see <a href="ihighlightphrase.html">IHighlightPhrase</a>)</li>
<li><code>options</code>: Optional. The options defined below as <a href="istreamhighlightoptions.html">IStreamHighlightOptions</a></li>
</ul>
<p><strong>Note:</strong></p>
<blockquote>
<p><code>highlightStreamHTML</code> should only be used for very particular/specific use cases (e.g., augmenting the result template with additional information rather than the typical excerpt/title), and is not a proper replacement for actually having the correct title and excerpt on your results.</p>
<p>Using incorrect result titles or excerpts on your search interface also causes relevancy to suffer greatly, as the index uses the title and excerpt to find relevant results. Consequently, end users are more likely to see results whose titles do not match their query.</p>
<p>Moreover, the recommended method to implement simple title and/or excerpt highlighting is to simply use the <a href="../components/excerpt.html">Excerpt</a> and <a href="../components/resultlink.html">ResultLink</a> components.</p>
</blockquote>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, termsToHighlight<span class="tsd-signature-symbol">: </span><a href="ihighlightterm.html" class="tsd-signature-type">IHighlightTerm</a>, phrasesToHighlight<span class="tsd-signature-symbol">: </span><a href="ihighlightphrase.html" class="tsd-signature-type">IHighlightPhrase</a>, options<span class="tsd-signature-symbol">?: </span><a href="istreamhighlightoptions.html" class="tsd-signature-type">IStreamHighlightOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>termsToHighlight: <a href="ihighlightterm.html" class="tsd-signature-type">IHighlightTerm</a></h5>
</li>
<li>
<h5>phrasesToHighlight: <a href="ihighlightphrase.html" class="tsd-signature-type">IHighlightPhrase</a></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="istreamhighlightoptions.html" class="tsd-signature-type">IStreamHighlightOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="highlightstreamtext" class="tsd-anchor"></a>
<h3>highlight<wbr>Stream<wbr>Text</h3>
<div class="tsd-signature tsd-kind-icon">highlight<wbr>Stream<wbr>Text<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L107">ui/Templates/CoreHelpers.ts
:107</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Highlights the provided terms in a given string.<br/>
By default, the terms to highlight are the current query and the
associated stemming words from the index.
The only required parameter is the content, which specify the string that needs to be highlighted.
The other parameters will normally be automatically resolved for you from the current result object.</p>
</div>
<ul>
<li><code>content</code>: The string content to highlight</li>
<li><code>termsToHighlight</code>: The terms to highlight (see <a href="ihighlightterm.html">IHighlightTerm</a>)</li>
<li><code>phraseToHighlight</code>: The phrases to highlight (see <a href="ihighlightphrase.html">IHighlightPhrase</a>)</li>
<li><code>options</code>: Optional. The options defined below as <a href="istreamhighlightoptions.html">IStreamHighlightOptions</a></li>
</ul>
<p><strong>Note:</strong></p>
<blockquote>
<p><code>highlightStreamText</code> should only be used for very particular/specific use cases (e.g., augmenting the result template with additional information rather than the typical excerpt/title), and is not a proper replacement for actually having the correct title and excerpt on your results.</p>
<p>Using incorrect result titles or excerpts on your search interface also causes relevancy to suffer greatly, as the index uses the title and excerpt to find relevant results. Consequently, end users are more likely to see results whose titles do not match their query.</p>
<p>Moreover, the recommended method to implement simple title and/or excerpt highlighting is to simply use the <a href="../components/excerpt.html">Excerpt</a> and <a href="../components/resultlink.html">ResultLink</a> components.</p>
</blockquote>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, termsToHighlight<span class="tsd-signature-symbol">: </span><a href="ihighlightterm.html" class="tsd-signature-type">IHighlightTerm</a>, phrasesToHighlight<span class="tsd-signature-symbol">: </span><a href="ihighlightphrase.html" class="tsd-signature-type">IHighlightPhrase</a>, options<span class="tsd-signature-symbol">?: </span><a href="istreamhighlightoptions.html" class="tsd-signature-type">IStreamHighlightOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>termsToHighlight: <a href="ihighlightterm.html" class="tsd-signature-type">IHighlightTerm</a></h5>
</li>
<li>
<h5>phrasesToHighlight: <a href="ihighlightphrase.html" class="tsd-signature-type">IHighlightPhrase</a></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="istreamhighlightoptions.html" class="tsd-signature-type">IStreamHighlightOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="image" class="tsd-anchor"></a>
<h3>image</h3>
<div class="tsd-signature tsd-kind-icon">image<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L226">ui/Templates/CoreHelpers.ts
:226</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Formats an HTML image tag (<code><img></code>).</p>
</div>
<ul>
<li><code>src</code>: The image source URI</li>
<li><code>options</code>: Optional. The options to use (see <a href="iimageutilsoptions.html">IImageUtilsOptions</a>)</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>src<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><a href="iimageutilsoptions.html" class="tsd-signature-type">IImageUtilsOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>src: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="iimageutilsoptions.html" class="tsd-signature-type">IImageUtilsOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="ismobiledevice" class="tsd-anchor"></a>
<h3>is<wbr>Mobile<wbr>Device</h3>
<div class="tsd-signature tsd-kind-icon">is<wbr>Mobile<wbr>Device<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L341">ui/Templates/CoreHelpers.ts
:341</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Detect if the results is being rendered in a mobile device.</p>
</div>
<p>If it's not a mobile device, the helper return null ;</p>
<p>If it's a mobile device, return the type of device (Android, iPhone, iPad) etc.</p>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="loadtemplate" class="tsd-anchor"></a>
<h3>load<wbr>Template</h3>
<div class="tsd-signature tsd-kind-icon">load<wbr>Template<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L271">ui/Templates/CoreHelpers.ts
:271</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Loads a partial template in the current template, by passing the ID of
the template to load, the condition for which this template should be
loaded, and the context object (the object that the loaded template will
use as its data). By default, the context object will be the same as the
template that called this helper function. So, for example, in a
ResultList Component, the contextObject would, by default, be the Query
Results.</p>
</div>
<ul>
<li><code>templateId</code>: The ID of the template to load.</li>
<li><code>condition</code>: Optional. The boolean condition to determine if this template should
load for this result set. Most of the time this would be a condition of
the type if raw.somefield == 'something'.</li>
<li><code>contextObject</code>: Optional. The object that should be used by the loaded template
as its contextObject.</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>templateId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, condition<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, contextObject<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>templateId: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> condition: <span class="tsd-signature-type">boolean</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> contextObject: <span class="tsd-signature-type">any</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="number" class="tsd-anchor"></a>
<h3>number</h3>
<div class="tsd-signature tsd-kind-icon">number<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L150">ui/Templates/CoreHelpers.ts
:150</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Formats a numeric value using the format string.</p>
</div>
<ul>
<li><code>content</code>: The numeric value to format.</li>
<li><code>format</code> Optional. The string format to use. See the <a href="https://github.com/klaaspieter/jquery-global#numbers" target="_blank">Globalize</a> library for the list of available formats.</li>
</ul>
<p>When the helper is used in a <a href="../components/fieldvalue.html"><code>FieldValue</code></a> component, this value is automatically retrieved from the specified <a href="../components/fieldvalue.html#options.field"><code>field</code></a>.</p>
<p><strong>Example:</strong></p>
<pre><code class="lang-html"> <span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"CoveoFieldValue"</span> <span class="hljs-attr">data-field</span>=<span class="hljs-string">"@viewcount"</span> <span class="hljs-attr">data-text-caption</span>=<span class="hljs-string">"Views"</span> <span class="hljs-attr">data-helper</span>=<span class="hljs-string">"number"</span> <span class="hljs-attr">data-helper-options-format</span>=<span class="hljs-string">"n0"</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span>
</code></pre>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, format<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">INumberFormatOptions</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>format: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">INumberFormatOptions</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="shorten" class="tsd-anchor"></a>
<h3>shorten</h3>
<div class="tsd-signature tsd-kind-icon">shorten<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L55">ui/Templates/CoreHelpers.ts
:55</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Shortens a string so that its length does not exceed a specific number of
characters. An ellipsis is appended to the string if it exceeds the
maximum length.</p>
</div>
<ul>
<li><code>content</code>: The string to shorten.</li>
<li><code>length</code>: The maximum length of the resulting string.</li>
<li><code>highlights</code>: Optional. If provided, the string will be highlighted
using this highlight information.</li>
<li><code>cssClass</code>: Optional. When highlighting, the name of the CSS class to use.</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, length<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, highlights<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">IHighlight[]</span>, cssClass<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>length: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> highlights: <span class="tsd-signature-type">IHighlight[]</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> cssClass: <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="shortenpath" class="tsd-anchor"></a>
<h3>shorten<wbr>Path</h3>
<div class="tsd-signature tsd-kind-icon">shorten<wbr>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L67">ui/Templates/CoreHelpers.ts
:67</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Shortens a string using an algorithm suitable for file paths. The helper
will insert an ellipsis in the string where text has been removed when
the path exceeds the maximum length.</p>
</div>
<ul>
<li><code>content</code>: The path to shorten.</li>
<li><code>length</code>: The maximum length of the resulting string.</li>
<li><code>highlights</code>: Optional. If provided, the string will be highlighted using
this highlight information.</li>
<li><code>cssClass</code>: Optional. When highlighting, the name of the CSS class to use.</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, length<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, highlights<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">IHighlight[]</span>, cssClass<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>length: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> highlights: <span class="tsd-signature-type">IHighlight[]</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> cssClass: <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="shortenuri" class="tsd-anchor"></a>
<h3>shorten<wbr>Uri</h3>
<div class="tsd-signature tsd-kind-icon">shorten<wbr>Uri<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L79">ui/Templates/CoreHelpers.ts
:79</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Shortens a string using an algorithm suitable for URIs. The helper will
insert an ellipsis in the string where text has been removed when the URI
exceeds the maximum length.</p>
</div>
<ul>
<li><code>content</code>: The URI to shorten.</li>
<li><code>length</code>: The maximum length of the resulting string.</li>
<li><code>highlights</code>: Optional. If provided, the string will be highlighted
using this highlight information.</li>
<li><code>cssClass</code>: Optional. When highlighting, the name of the CSS class to use.</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, length<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, highlights<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">IHighlight[]</span>, cssClass<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>length: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> highlights: <span class="tsd-signature-type">IHighlight[]</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> cssClass: <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="size" class="tsd-anchor"></a>
<h3>size</h3>
<div class="tsd-signature tsd-kind-icon">size<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L313">ui/Templates/CoreHelpers.ts
:313</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Formats a number, which represents a file size in bytes, into a logical unit size.</p>
</div>
<p><strong>Examples:</strong></p>
<blockquote>
<p><code>size(1024) => 1024 B</code></p>
<p><code>size(1025) => 1 KB</code></p>
<p><code>size(10240) => 10 KB</code></p>
</blockquote>
<p><strong>Examples:</strong></p>
<blockquote>
<p><strong>HTML</strong></p>
<pre><code class="lang-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"CoveoFieldValue"</span> <span class="hljs-attr">data-field</span>=<span class="hljs-string">'@size'</span> <span class="hljs-attr">data-helper</span>=<span class="hljs-string">"size"</span> <span class="hljs-attr">data-helper-options-base</span>=<span class="hljs-string">"1"</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span>
</code></pre>
</blockquote>
<blockquote>
<p><strong>Underscore</strong></p>
<pre><code class="lang-erb"><span class="xml"><span class="hljs-tag"><<span class="hljs-name">%=</span></span></span><span class="ruby"> size(raw.size, {<span class="hljs-symbol">base:</span> <span class="hljs-number">0</span>, <span class="hljs-symbol">precision:</span> <span class="hljs-number">2</span>}) </span><span class="xml"><span class="hljs-tag">%></span></span>
</code></pre>
</blockquote>
<ul>
<li><code>value</code>: The number to format</li>
<li><code>options</code> : The options to use (see <a href="isizeoptions.html">ISizeOptions</a>)</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, options<span class="tsd-signature-symbol">?: </span><a href="isizeoptions.html" class="tsd-signature-type">ISizeOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="isizeoptions.html" class="tsd-signature-type">ISizeOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="thumbnail" class="tsd-anchor"></a>
<h3>thumbnail</h3>
<div class="tsd-signature tsd-kind-icon">thumbnail<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L241">ui/Templates/CoreHelpers.ts
:241</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Formats an HTML image tag (<code><img></code>), and automatically uses the result
object to query the REST API to get the thumbnail for this result. For
example, this can be used to great effect when designing a template
showing users or previews of files.</p>
<ul>
<li><code>result</code>: Optional. The current result object inside your template. In
underscore, it is referenced as <code>obj</code>. By default, the result
will be resolved automatically from your current template function (
Meaning the nearest result in the current call stack execution inside
your template)</li>
<li><code>endpoint</code>: Optional. The name of the endpoint to use for your
thumbnail. Default is default.</li>
<li><code>options</code>: Optional. The options to use (see <a href="iimageutilsoptions.html">IImageUtilsOptions</a>).</li>
</ul>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>result<span class="tsd-signature-symbol">?: </span><a href="iqueryresult.html" class="tsd-signature-type">IQueryResult</a>, endpoint<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><a href="iimageutilsoptions.html" class="tsd-signature-type">IImageUtilsOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> result: <a href="iqueryresult.html" class="tsd-signature-type">IQueryResult</a></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> endpoint: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="iimageutilsoptions.html" class="tsd-signature-type">IImageUtilsOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="time" class="tsd-anchor"></a>
<h3>time</h3>
<div class="tsd-signature tsd-kind-icon">time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L164">ui/Templates/CoreHelpers.ts
:164</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Formats a date value to a time-only string using the specified options.</p>
</div>
<ul>
<li><code>content</code>: The Date value to format.</li>
<li><code>options</code>: Optional. The options to use (see <a href="idatetostringoptions.html">IDateToStringOptions</a>).</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">?: </span><a href="idatetostringoptions.html" class="tsd-signature-type">IDateToStringOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>content: <span class="tsd-signature-type">any</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="idatetostringoptions.html" class="tsd-signature-type">IDateToStringOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="timespan" class="tsd-anchor"></a>
<h3>time<wbr>Span</h3>
<div class="tsd-signature tsd-kind-icon">time<wbr>Span<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L284">ui/Templates/CoreHelpers.ts
:284</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Given a number, either in millisecond or second, convert to a HH:MM:SS format.</p>
</div>
<p><strong>Examples</strong></p>
<blockquote>
<p><code>timeSpan(1, {isMilliseconds: false}) => '00:01'</code></p>
<p><code>timeSpan(1000, {isMilliseconds: true}) => '00:01'</code></p>
</blockquote>
<ul>
<li><code>value</code>: The number to convert to a timespan</li>
<li><code>options</code> : The options to use (see <a href="itimespanutilsoptions.html">ITimeSpanUtilsOptions</a>)</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, options<span class="tsd-signature-symbol">: </span><a href="itimespanutilsoptions.html" class="tsd-signature-type">ITimeSpanUtilsOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5>options: <a href="itimespanutilsoptions.html" class="tsd-signature-type">ITimeSpanUtilsOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="translatedcaption" class="tsd-anchor"></a>
<h3>translated<wbr>Caption</h3>
<div class="tsd-signature tsd-kind-icon">translated<wbr>Caption<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in
<a href="https://github.com/coveo/search-ui/tree/master/src/ui/Templates/CoreHelpers.ts#L327">ui/Templates/CoreHelpers.ts
:327</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Given a filetype value, try to return a translated and human readable version.</p>
</div>
<p>If the filetype is known and recognized by the framework, a translated value will be returned.</p>
<p><strong>Examples</strong></p>
<blockquote>
<p><code>translatedCaption('doc') => Document</code></p>
<p><code>translatedCaption('xls') => Spreadsheet Document</code></p>
</blockquote>
<ul>
<li><code>value</code>: The string value to translate</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">ICoreHelpers</span>
</li>
</ul>
</section>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer> </div>
</div>
</div>
<script src="../assets/js/main.js"></script>
<script src="../assets/js/generateMetaData.js"></script>
</body>
</html>