@mescius/dsimageviewer
Version:
Document Solutions Image Viewer
261 lines (236 loc) • 57.4 kB
HTML
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ViewerOptions | Document Solutions Image Viewer - v8.0.4</title><meta name="description" content="Documentation for Document Solutions Image Viewer - v8.0.4"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><link rel="stylesheet" href="../assets/custom.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
<div class="tsd-toolbar-contents container">
<div class="table-cell" id="tsd-search" data-base="..">
<div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Document Solutions Image Viewer - v8.0.4</a></div>
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
<div class="container container-main">
<div class="col-8 col-content">
<div class="tsd-page-title">
<ul class="tsd-breadcrumb">
<li><a href="../index.html">Document Solutions Image Viewer - v8.0.4</a></li>
<li><a href="ViewerOptions.html">ViewerOptions</a></li></ul>
<h1>Class ViewerOptions</h1></div>
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography"><p>Image Viewer options.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><span class="hl-0">friendlyFileName:</span><span class="hl-1"> </span><span class="hl-3">"sample.png"</span><span class="hl-1"> });</span>
</code></pre>
</div></section>
<section class="tsd-panel tsd-hierarchy">
<h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
<li><span class="target">ViewerOptions</span></li></ul></section>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
<h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex=0><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></svg> Index</h5></summary>
<div class="tsd-accordion-details">
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Properties</h3>
<div class="tsd-index-list"><a href="ViewerOptions.html#viewerBackground" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12" id="icon-1024-path"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)" id="icon-1024-text"></path></svg><span>viewer<wbr/>Background</span></a>
<a href="ViewerOptions.html#customIcons" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>custom<wbr/>Icons</span></a>
<a href="ViewerOptions.html#friendlyFileName" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>friendly<wbr/>File<wbr/>Name</span></a>
<a href="ViewerOptions.html#file" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>file</span></a>
<a href="ViewerOptions.html#gifOptions" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>gif<wbr/>Options</span></a>
<a href="ViewerOptions.html#imageQuality" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>image<wbr/>Quality</span></a>
<a href="ViewerOptions.html#hideToolbar" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>hide<wbr/>Toolbar</span></a>
<a href="ViewerOptions.html#language" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>language</span></a>
<a href="ViewerOptions.html#maxImageSize" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>max<wbr/>Image<wbr/>Size</span></a>
<a href="ViewerOptions.html#onInitialized" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>on<wbr/>Initialized</span></a>
<a href="ViewerOptions.html#saveButton" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>save<wbr/>Button</span></a>
<a href="ViewerOptions.html#theme" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>theme</span></a>
<a href="ViewerOptions.html#undo" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>undo</span></a>
<a href="ViewerOptions.html#zoomOptions" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>zoom<wbr/>Options</span></a>
<a href="ViewerOptions.html#openParameters" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>open<wbr/>Parameters</span></a>
<a href="ViewerOptions.html#shortcuts" class="tsd-index-link tsd-kind-property tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>shortcuts</span></a>
</div></section></div></details></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-class"><a id="viewerBackground" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>viewer<wbr/>Background</span><a href="#viewerBackground" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" id="icon-anchor-a"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" id="icon-anchor-b"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" id="icon-anchor-c"></path></svg></a></h3>
<div class="tsd-signature">viewer<wbr/>Background<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = "rgb(128,128,128)"</span></div>
<div class="tsd-comment tsd-typography"><p>Viewer client area background color.</p>
<h3>Default</h3><p>rgb(128,128,128)</p>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="customIcons" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>custom<wbr/>Icons</span><a href="#customIcons" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">custom<wbr/>Icons<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{ </span>[iconKey: <span class="tsd-signature-type">string</span>]<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Element</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-comment tsd-typography"><p>Use this option to change the default SVG icons to custom ones.
Available icon keys: 'about', 'download', 'flip-horizontal', 'flip-vertical', 'magnify-minus-outline', 'magnify-plus-outline', 'magnify', 'open', 'print', 'rotate', 'edit-undo', 'edit-redo'.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><br/><span class="hl-1"> </span><span class="hl-0">customIcons:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">'open'</span><span class="hl-0">:</span><span class="hl-1"> </span><span class="hl-3">'<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M9.516 14.016q1.875 0 3.188-1.313t1.313-3.188-1.313-3.188-3.188-1.313-3.188 1.313-1.313 3.188 1.313 3.188 3.188 1.313zM15.516 14.016l4.969 4.969-1.5 1.5-4.969-4.969v-0.797l-0.281-0.281q-1.781 1.547-4.219 1.547-2.719 0-4.617-1.875t-1.898-4.594 1.898-4.617 4.617-1.898 4.594 1.898 1.875 4.617q0 0.984-0.469 2.227t-1.078 1.992l0.281 0.281h0.797z"></path></svg>'</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">});</span>
</code></pre>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-index-signature">
<h5><span class="tsd-signature-symbol">[</span>iconKey: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-type">Element</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5></li></ul></div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="friendlyFileName" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>friendly<wbr/>File<wbr/>Name</span><a href="#friendlyFileName" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">friendly<wbr/>File<wbr/>Name<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = ""</span></div>
<div class="tsd-comment tsd-typography"><p>Used when file name not available.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-0">viewer</span><span class="hl-1">.</span><span class="hl-0">options</span><span class="hl-1">.</span><span class="hl-0">friendlyFileName</span><span class="hl-1"> = </span><span class="hl-3">"myFileName.png"</span><span class="hl-1">;</span><br/><span class="hl-0">viewer</span><span class="hl-1">.</span><span class="hl-2">applyOptions</span><span class="hl-1">();</span>
</code></pre>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="file" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>file</span><a href="#file" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">file<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = ""</span></div>
<div class="tsd-comment tsd-typography"><p>Specifies the Image file name, URL, or binary data to be loaded in the Viewer.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><span class="hl-0">file:</span><span class="hl-1"> </span><span class="hl-3">'sample.png'</span><span class="hl-1"> } );</span>
</code></pre>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="gifOptions" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>gif<wbr/>Options</span><a href="#gifOptions" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">gif<wbr/>Options<span class="tsd-signature-symbol">?:</span> <a href="../types/GifOptions.html" class="tsd-signature-type" data-tsd-kind="Type alias">GifOptions</a></div>
<div class="tsd-comment tsd-typography"><p>GIF image format options.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><br/><span class="hl-1"> </span><span class="hl-0">gifOptions:</span><span class="hl-1"> { </span><br/><span class="hl-1"> </span><span class="hl-0">autoPlay:</span><span class="hl-1"> </span><span class="hl-4">true</span><span class="hl-1">, </span><span class="hl-5">// start GIF animation automatically</span><br/><span class="hl-1"> </span><span class="hl-0">cumulative:</span><span class="hl-1"> </span><span class="hl-4">false</span><span class="hl-1">, </span><span class="hl-5">// disable cumulative frame rendering (clear previous frame appearance)</span><br/><span class="hl-1"> </span><span class="hl-0">playOnClick:</span><span class="hl-1"> </span><span class="hl-4">true</span><span class="hl-1">, </span><span class="hl-5">// play on click</span><br/><span class="hl-1"> </span><span class="hl-0">playOnHover:</span><span class="hl-1"> </span><span class="hl-4">false</span><span class="hl-1">, </span><span class="hl-5">// do not play on hover</span><br/><span class="hl-1"> </span><span class="hl-0">speed:</span><span class="hl-1"> </span><span class="hl-7">2</span><span class="hl-1"> </span><span class="hl-5">// double the speed </span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> });</span>
</code></pre>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="imageQuality" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>image<wbr/>Quality</span><a href="#imageQuality" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">image<wbr/>Quality<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div>
<div class="tsd-comment tsd-typography"><p>The image quality to use for image formats that utilize lossy compression, such as JPEG and WEBP.
The value should be a number between 0 and 1, where 0 represents the lowest quality and 1 represents the highest quality.
If this option is not specified, the default value of 0.92 is used.
Please note that this option exclusively affects image editing capabilities only.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-0">imageQuality:</span><span class="hl-1"> </span><span class="hl-7">0.5</span><span class="hl-1"> </span><span class="hl-5">// Set image quality to medium.</span><br/><span class="hl-1">});</span>
</code></pre>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="hideToolbar" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>hide<wbr/>Toolbar</span><a href="#hideToolbar" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">hide<wbr/>Toolbar<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div>
<div class="tsd-comment tsd-typography"><p>Specifies whether to hide the toolbar.</p>
<h3>Default</h3><p>false</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><span class="hl-0">hideToolbar:</span><span class="hl-1"> </span><span class="hl-4">true</span><span class="hl-1"> } );</span>
</code></pre>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="language" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>language</span><a href="#language" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">language<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div>
<div class="tsd-comment tsd-typography"><p>User interface language.
Note, in order to use the language option,
you must specify the language option value during
the viewer initialization phase.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-5">// Set UI language to Japanese:</span><br/><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-0">selector</span><span class="hl-1">, { </span><span class="hl-0">language:</span><span class="hl-1"> </span><span class="hl-3">'ja'</span><span class="hl-1"> });</span>
</code></pre>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-5">// Define custom translations:</span><br/><span class="hl-4">function</span><span class="hl-1"> </span><span class="hl-2">loadImageViewer</span><span class="hl-1">(</span><span class="hl-0">selector</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">myTranslations</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-3">"toolbar"</span><span class="hl-0">:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">"open"</span><span class="hl-0">:</span><span class="hl-1"> </span><span class="hl-3">"Öffnen"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-3">"save"</span><span class="hl-0">:</span><span class="hl-1"> </span><span class="hl-3">"Speichern"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-3">"print"</span><span class="hl-0">:</span><span class="hl-1"> </span><span class="hl-3">"Drucken"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-3">"save-as"</span><span class="hl-0">:</span><span class="hl-1"> </span><span class="hl-3">"Speichern unter"</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> };</span><br/><span class="hl-1"> </span><span class="hl-5">// Initialize translations:</span><br/><span class="hl-1"> </span><span class="hl-0">DsImageViewer</span><span class="hl-1">.</span><span class="hl-0">i18n</span><span class="hl-1">.</span><span class="hl-2">init</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-0">resources:</span><span class="hl-1"> { </span><span class="hl-0">myLang:</span><span class="hl-1"> { </span><span class="hl-0">translation:</span><span class="hl-1"> </span><span class="hl-0">myTranslations</span><span class="hl-1"> } }</span><br/><span class="hl-1"> }).</span><span class="hl-2">then</span><span class="hl-1">(</span><span class="hl-4">function</span><span class="hl-1">(</span><span class="hl-0">t</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-5">// Translations initialized and ready to go.</span><br/><span class="hl-1"> </span><span class="hl-5">// Now create Image viewer:</span><br/><span class="hl-1"> </span><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-0">selector</span><span class="hl-1">, { </span><span class="hl-0">language:</span><span class="hl-1"> </span><span class="hl-3">'myLang'</span><span class="hl-1"> });</span><br/><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span><br/><span class="hl-2">loadImageViewer</span><span class="hl-1">(</span><span class="hl-3">'#root'</span><span class="hl-1">);</span>
</code></pre>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="maxImageSize" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>max<wbr/>Image<wbr/>Size</span><a href="#maxImageSize" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">max<wbr/>Image<wbr/>Size<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{ </span>width<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>height<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-comment tsd-typography"><p>Use the maxImageSize option to limit the allowed image size used by the edit actions.</p>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>width<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5></li>
<li class="tsd-parameter">
<h5>height<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5></li></ul></div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="onInitialized" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>on<wbr/>Initialized</span><a href="#onInitialized" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">on<wbr/>Initialized<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>viewer<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">void</span><span class="tsd-signature-symbol">)</span></div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-signature">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-class">
<li class="tsd-signature" id="__type-2.__type-3"><span class="tsd-signature-symbol">(</span>viewer<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">void</span></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>The onInitialized handler will be called immediately after the viewer is instantiated.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><br/><span class="hl-1"> </span><span class="hl-2">onInitialized</span><span class="hl-0">:</span><span class="hl-1"> (</span><span class="hl-0">viewer</span><span class="hl-1">)</span><span class="hl-4">=></span><span class="hl-1"> { </span><br/><span class="hl-1"> </span><span class="hl-5">// put viewer initialization code here. </span><br/><span class="hl-1"> } </span><br/><span class="hl-1">});</span>
</code></pre>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5>viewer: <span class="tsd-signature-type">any</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="saveButton" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>save<wbr/>Button</span><a href="#saveButton" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">save<wbr/>Button<span class="tsd-signature-symbol">?:</span> <a href="../types/SaveButtonOptions.html" class="tsd-signature-type" data-tsd-kind="Type alias">SaveButtonOptions</a></div>
<div class="tsd-comment tsd-typography"><p>Options for customizing the behavior and appearance of the "Save" button.</p>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="theme" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>theme</span><a href="#theme" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">theme<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span></div>
<div class="tsd-comment tsd-typography"><p>Use theme option to change default viewer theme.
Available built-in themes are:
gc-blue, viewer, dark, dark-yellow, light, light-blue.
Set this option to false if you want to disable theme loading - this can be helpful if you have already included theme css.</p>
<h3>Default</h3><p>Default theme is gc-blue.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-5">// Require built-in light theme:</span><br/><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><span class="hl-0">theme:</span><span class="hl-1"> </span><span class="hl-3">"light"</span><span class="hl-1"> });</span>
</code></pre>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-5">// Require built-in dark theme:</span><br/><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><span class="hl-0">theme:</span><span class="hl-1"> </span><span class="hl-3">"dark"</span><span class="hl-1"> });</span>
</code></pre>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-5">// Load external light theme css using relative URL:</span><br/><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><span class="hl-0">theme:</span><span class="hl-1"> </span><span class="hl-3">"themes/light.css"</span><span class="hl-1"> });</span>
</code></pre>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-5">// Load external dark theme css using an absolute URL:</span><br/><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><span class="hl-0">theme:</span><span class="hl-1"> </span><span class="hl-3">"http://localhost:8080/themes/dark.css"</span><span class="hl-1"> });</span>
</code></pre>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-5">// <link href="~/Content/light-blue.css" rel="stylesheet" /></span><br/><span class="hl-5">// Do not load theme:</span><br/><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><span class="hl-0">theme:</span><span class="hl-1"> </span><span class="hl-4">false</span><span class="hl-1"> } );</span>
</code></pre>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="undo" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>undo</span><a href="#undo" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">undo<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><a href="../types/UndoStorageOptions.html" class="tsd-signature-type" data-tsd-kind="Type alias">UndoStorageOptions</a><span class="tsd-signature-symbol"> = ...</span></div>
<div class="tsd-comment tsd-typography"><p>Undo state storage options.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-5">// Disable undo storage:</span><br/><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-0">selector</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-0">undo:</span><span class="hl-1"> </span><span class="hl-4">false</span><br/><span class="hl-1">});</span>
</code></pre>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-5">// Do not track "Open" and "Close" commands:</span><br/><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-0">selector</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-0">undo:</span><span class="hl-1"> { </span><span class="hl-0">skipCommands:</span><span class="hl-1"> </span><span class="hl-3">"Open"</span><span class="hl-1"> }</span><br/><span class="hl-1">});</span>
</code></pre>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="zoomOptions" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>zoom<wbr/>Options</span><a href="#zoomOptions" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">zoom<wbr/>Options<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{ </span>minZoom<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>maxZoom<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>dropdownZoomFactorValues<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-comment tsd-typography"><p>Zoom control options.</p>
<h3>Example</h3><pre><code class="language-javascript"><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><br/><span class="hl-1"> </span><span class="hl-0">zoomOptions:</span><span class="hl-1"> { </span><br/><span class="hl-1"> </span><span class="hl-0">minZoom:</span><span class="hl-1"> </span><span class="hl-7">0.05</span><span class="hl-1">, </span><br/><span class="hl-1"> </span><span class="hl-0">maxZoom:</span><span class="hl-1"> </span><span class="hl-7">5</span><span class="hl-1">, </span><br/><span class="hl-1"> </span><span class="hl-0">dropdownZoomFactorValues:</span><span class="hl-1"> [</span><span class="hl-7">0.05</span><span class="hl-1">, </span><span class="hl-7">0.1</span><span class="hl-1">, </span><span class="hl-7">0.3</span><span class="hl-1">, </span><span class="hl-7">0.5</span><span class="hl-1">, </span><span class="hl-7">0.7</span><span class="hl-1">, </span><span class="hl-7">1</span><span class="hl-1">, </span><span class="hl-7">1.5</span><span class="hl-1">, </span><span class="hl-7">2</span><span class="hl-1">, </span><span class="hl-7">3</span><span class="hl-1">, </span><span class="hl-7">5</span><span class="hl-1">] </span><br/><span class="hl-1"> }</span><br/><span class="hl-1">});</span>
</code></pre>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5><code class="tsd-tag ts-flagOptional">Optional</code> min<wbr/>Zoom<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography"><p>Defines min zoom factor</p>
<h3>Default</h3><p>0.25 (25%)</p>
</div></li>
<li class="tsd-parameter">
<h5><code class="tsd-tag ts-flagOptional">Optional</code> max<wbr/>Zoom<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography"><p>Defines max zoom factor</p>
<h3>Default</h3><p>3 (300%)</p>
</div></li>
<li class="tsd-parameter">
<h5><code class="tsd-tag ts-flagOptional">Optional</code> dropdown<wbr/>Zoom<wbr/>Factor<wbr/>Values<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5>
<div class="tsd-comment tsd-typography"><p>Defines zoom factor array to show in Zoom Control Dropdown in Toolbar</p>
<h3>Default</h3><p>[0.5, 1, 1.5, 2, 3]</p>
</div></li></ul></div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="openParameters" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>open<wbr/>Parameters</span><a href="#openParameters" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">open<wbr/>Parameters<span class="tsd-signature-symbol">?:</span> <a href="../types/OpenParameters.html" class="tsd-signature-type" data-tsd-kind="Type alias">OpenParameters</a></div>
<div class="tsd-comment tsd-typography"><p>Default image open parameters.</p>
</div></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="shortcuts" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>shortcuts</span><a href="#shortcuts" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">shortcuts<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{ </span>[keyCode: <span class="tsd-signature-type">string</span>]<span class="tsd-signature-symbol">: </span><a href="../types/KeyboardShortcutDefinition.html" class="tsd-signature-type" data-tsd-kind="Type alias">KeyboardShortcutDefinition</a><span class="tsd-signature-symbol"> | </span><a href="../types/KeyboardShortcutDefinition.html" class="tsd-signature-type" data-tsd-kind="Type alias">KeyboardShortcutDefinition</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></div>
<div class="tsd-comment tsd-typography"><p>Keyboard shortcuts. Available built-in keyboard shortcut tool names: "zoomIn" | "zoomOut" | "zoomActualSize" | "zoomPageWidth" | "rotate" | "rotateBackward" |
"open" | "print" | "undo" | "redo" | "confirmChanges" | "cancelChanges".</p>
<h3>Example</h3><p>Override keyboard shortcut "Ctrl +"</p>
<pre><code class="language-javascript"><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">, { </span><br/><span class="hl-1"> </span><span class="hl-0">shortcuts:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">107</span><span class="hl-0">:</span><span class="hl-1"> [{</span><br/><span class="hl-1"> </span><span class="hl-0">ctrl:</span><span class="hl-1"> </span><span class="hl-4">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">tool</span><span class="hl-0">:</span><span class="hl-1"> </span><span class="hl-4">function</span><span class="hl-1">(</span><span class="hl-0">event</span><span class="hl-1">) { </span><br/><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1">.</span><span class="hl-0">zoom</span><span class="hl-1"> = { </span><span class="hl-0">mode:</span><span class="hl-1"> </span><span class="hl-7">0</span><span class="hl-1">, </span><span class="hl-0">factor:</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1">.</span><span class="hl-0">actualZoomFactor</span><span class="hl-1"> + </span><span class="hl-7">0.1</span><span class="hl-1"> };</span><br/><span class="hl-1"> </span><span class="hl-0">event</span><span class="hl-1">.</span><span class="hl-2">preventDefault</span><span class="hl-1">();</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> }, {</span><br/><span class="hl-1"> </span><span class="hl-0">meta:</span><span class="hl-1"> </span><span class="hl-4">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">tool</span><span class="hl-0">:</span><span class="hl-1"> </span><span class="hl-4">function</span><span class="hl-1">(</span><span class="hl-0">event</span><span class="hl-1">) { </span><br/><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1">.</span><span class="hl-0">zoom</span><span class="hl-1"> = { </span><span class="hl-0">mode:</span><span class="hl-1"> </span><span class="hl-7">0</span><span class="hl-1">, </span><span class="hl-0">factor:</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1">.</span><span class="hl-0">actualZoomFactor</span><span class="hl-1"> + </span><span class="hl-7">0.1</span><span class="hl-1"> };</span><br/><span class="hl-1"> </span><span class="hl-0">event</span><span class="hl-1">.</span><span class="hl-2">preventDefault</span><span class="hl-1">();</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> }]</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">});</span>
</code></pre>
<p>Remove all default shortcuts</p>
<pre><code class="language-javascript"><span class="hl-4">var</span><span class="hl-1"> </span><span class="hl-0">viewer</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-2">DsImageViewer</span><span class="hl-1">(</span><span class="hl-3">"#root"</span><span class="hl-1">);</span><br/><span class="hl-0">viewer</span><span class="hl-1">.</span><span class="hl-0">options</span><span class="hl-1">.</span><span class="hl-0">shortcuts</span><span class="hl-1"> = {};</span><br/><span class="hl-0">viewer</span><span class="hl-1">.</span><span class="hl-2">applyOptions</span><span class="hl-1">();</span>
</code></pre>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-index-signature">
<h5><span class="tsd-signature-symbol">[</span>keyCode: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><a href="../types/KeyboardShortcutDefinition.html" class="tsd-signature-type" data-tsd-kind="Type alias">KeyboardShortcutDefinition</a><span class="tsd-signature-symbol"> | </span><a href="../types/KeyboardShortcutDefinition.html" class="tsd-signature-type" data-tsd-kind="Type alias">KeyboardShortcutDefinition</a><span class="tsd-signature-symbol">[]</span></h5></li></ul></div></section></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fil