<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Small question about Tutorial App in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/225462#M570</link>
    <description>&lt;P&gt;Hello Stefan,&lt;/P&gt;&lt;P&gt;I realy wish I could give you more the one Kudo, great answer. Sorry for giving you the extra work.&lt;/P&gt;&lt;P&gt;It helped met to better understand,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Oct 2023 12:56:54 GMT</pubDate>
    <dc:creator>henk_stobbe</dc:creator>
    <dc:date>2023-10-16T12:56:54Z</dc:date>
    <item>
      <title>Small question about Tutorial App</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/224970#M544</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;(do no worries everything works now (-;)&lt;/P&gt;
&lt;P&gt;Small question about below,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; const formatter: FormatOptions&amp;lt;Unit, ConvertableUnit&amp;gt; = {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; maximumFractionDigits: chartPrecision,&lt;/P&gt;
&lt;P&gt;This means we have a formatter of type FormatOptions expecting two props.&lt;/P&gt;
&lt;P&gt;Where in the documentation can I find the FormatOptions type?&lt;/P&gt;
&lt;P&gt;I assume this is the interface input-ToUnid and output-FromUnit but I guess this is defined in the Runtime,&lt;/P&gt;
&lt;P&gt;Am I missing something?&lt;/P&gt;
&lt;P&gt;KR Henk&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 10:56:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/224970#M544</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2023-10-10T10:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Smal question about Tutorial App</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/224973#M545</link>
      <description>&lt;P&gt;Hi again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can find the type reference at&amp;nbsp;&lt;A href="https://developer.dynatrace.com/reference/sdks/units/#formatoptions" target="_blank"&gt;https://developer.dynatrace.com/reference/sdks/units/#formatoptions&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The properties of &lt;CODE&gt;FormatOptions&lt;/CODE&gt; tell the formatter how it should behave, for example, to which unit it should convert the input or if it should abbreviate the number.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 10:56:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/224973#M545</guid>
      <dc:creator>stefan_eggersto</dc:creator>
      <dc:date>2023-10-10T10:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Smal question about Tutorial App</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/224975#M546</link>
      <description>&lt;P&gt;Stefan please make my day&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Looking at your link,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henk_stobbe_0-1696938121166.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/14518iFD4E7C91BD9935C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="henk_stobbe_0-1696938121166.png" alt="henk_stobbe_0-1696938121166.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is&amp;nbsp;&lt;SPAN&gt;const formatter: FormatOptions&amp;lt;&lt;STRONG&gt;To&lt;/STRONG&gt;Unit, ConvertableUnit&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Not a better, or am I still missing something?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;KR Henk&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 11:44:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/224975#M546</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2023-10-10T11:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Small question about Tutorial App</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/225444#M569</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/11427"&gt;@henk_stobbe&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;It took me some time to dig into that since the typing of this package is all but trivial. Long story short:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The documentation is mixing types (e.g. &lt;CODE&gt;ConvertableUnit&lt;/CODE&gt;)&amp;nbsp;and type parameters (&lt;CODE&gt;FromUnit&lt;/CODE&gt; and &lt;CODE&gt;ToUnit&lt;/CODE&gt;). Only types should be documented there.&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;In the tutorial, the definition of &lt;CODE&gt;formatter&lt;/CODE&gt; needs to refer to types, so only &lt;CODE&gt;const formatter: FormatOptions&amp;lt;Unit, ConvertableUnit&amp;gt;&lt;/CODE&gt; is valid, but not&amp;nbsp;&lt;CODE&gt;const formatter: FormatOptions&amp;lt;FromUnit, ToUnit&amp;gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now the longer story with some background information &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; The relevant parts of the type definition of &lt;CODE&gt;FormatOptions&lt;/CODE&gt; is following:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;export&lt;/SPAN&gt; &lt;SPAN&gt;interface&lt;/SPAN&gt; &lt;SPAN&gt;FormatOptions&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;FromUnit&lt;/SPAN&gt; &lt;SPAN&gt;extends&lt;/SPAN&gt; &lt;SPAN&gt;Unit&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;ToUnit&lt;/SPAN&gt; &lt;SPAN&gt;extends&lt;/SPAN&gt; &lt;SPAN&gt;ConvertableUnit&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; {&lt;BR /&gt;&lt;/SPAN&gt;    ...&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;input&lt;/SPAN&gt;&lt;SPAN&gt;?:&lt;/SPAN&gt; &lt;SPAN&gt;FromUnit&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt;?:&lt;/SPAN&gt; &lt;SPAN&gt;ToUnit&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    ...&lt;BR /&gt;}&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;DIV&gt;This means:&lt;/DIV&gt;
&lt;DIV&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;FormatOptions&lt;/CODE&gt; is a generic interface with two type parameters&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;Unit&lt;/CODE&gt; and &lt;CODE&gt;ConvertableUnit&lt;/CODE&gt; are types provided by the SDK. &lt;CODE&gt;units.currency.usd&lt;/CODE&gt;&lt;SPAN&gt; satisfies the type &lt;/SPAN&gt;&lt;CODE&gt;Unit&lt;/CODE&gt;, so y&lt;SPAN&gt;ou can write the following valid assignment:&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;const myUnit: Unit = units.currency.usd;&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;CODE&gt;FromUnit&lt;/CODE&gt; and &lt;CODE&gt;ToUnit&lt;/CODE&gt; are just the names of the type parameters and only valid within this type definition&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;According to this signature,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;CODE&gt;FromUnit&lt;/CODE&gt; needs to be any type that extends &lt;CODE&gt;Unit&lt;/CODE&gt;, &lt;CODE&gt;ToUnit&lt;/CODE&gt; needs to be any type that extends &lt;CODE&gt;ConvertableUnit&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;DIV&gt;To sum it up: &lt;CODE&gt;Unit&lt;/CODE&gt; and &lt;CODE&gt;ConvertableUnit&lt;/CODE&gt; are relevant for consumers, &lt;CODE&gt;ToUnit&lt;/CODE&gt; and &lt;CODE&gt;FromUnit&lt;/CODE&gt; are just the names of the type parameters of &lt;CODE&gt;FormatterOptions.&lt;/CODE&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;You can read more on generics in TypeScript at&amp;nbsp;&lt;A href="https://www.typescriptlang.org/docs/handbook/2/generics.html" target="_blank"&gt;https://www.typescriptlang.org/docs/handbook/2/generics.html&lt;/A&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Oct 2023 11:17:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/225444#M569</guid>
      <dc:creator>stefan_eggersto</dc:creator>
      <dc:date>2023-10-16T11:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Small question about Tutorial App</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/225462#M570</link>
      <description>&lt;P&gt;Hello Stefan,&lt;/P&gt;&lt;P&gt;I realy wish I could give you more the one Kudo, great answer. Sorry for giving you the extra work.&lt;/P&gt;&lt;P&gt;It helped met to better understand,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 12:56:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/225462#M570</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2023-10-16T12:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Small question about Tutorial App</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/225569#M573</link>
      <description>&lt;P&gt;Great answer (tip) - thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 10:31:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Small-question-about-Tutorial-App/m-p/225569#M573</guid>
      <dc:creator>radek_jasinski</dc:creator>
      <dc:date>2023-10-17T10:31:19Z</dc:date>
    </item>
  </channel>
</rss>

