Back to Sst

TSDoc

www/src/content/docs/dummy/tsdoc.mdx

4.13.111.3 KB
Original Source

import Segment from '../../../components/tsdoc/Segment.astro'; import Section from '../../../components/tsdoc/Section.astro'; import NestedTitle from '../../../components/tsdoc/NestedTitle.astro'; import InlineSection from '../../../components/tsdoc/InlineSection.astro';

<div class="tsdoc"> <Section type="about"> Returns a locale object for the specified definition with `locale.format` and `locale.formatPrefix` methods.

This section has more from about the FormatSpecifier.

:::note You can also add notes. By specifying the ZipFile property within the Code property, specify index.function_name as the handler. :::

Simple Example

Here's a simple example.

ts
new FormatSpecifier("param1");

Complicated Example

Here's a more complicated example.

ts
new FormatSpecifier("param1", "param2", "param3");

For more info refer to our other docs.

</Section>

Constructor

<Segment> <Section type="signature"> ```ts new FormatSpecifier(specifier, addend?): FormatSpecifier ``` </Section> <Section type="parameters"> #### Parameters
  • <p><code class="key">specifier</code> [<code class="type">FormatSpecifierObject</code>](#FormatSpecifierObject)</p>

    A specifier object.

  • <p><code class="key">addend?</code> <code class="primitive">number</code><code class="symbol"> | </code><code class="primitive">string</code><code class="symbol"> & </code><code class="primitive">boolean</code></p>

    A number to add.

</Section> <InlineSection> **Returns** [<code class="type">FormatSpecifier</code>](#FormatSpecifier)<code class="symbol">[]</code><code class="symbol"> | </code><code class="primitive">null</code> </InlineSection> </Segment>

Methods

noop

<Segment> <Section type="signature"> ```ts noop(): void ``` </Section>

This function doesn't do anything. </Segment>

simpleArgs

<Segment> <Section type="signature"> ```ts simpleArgs(true, false ,true): void ``` </Section>

This function takes some simple args.

<Section type="parameters"> #### Parameters
  • <p><code class="key">isTrue</code> <code class="primitive">boolean</code></p>
  • <p><code class="key">isFalse?</code> <code class="primitive">boolean</code></p>
  • <p><code class="key">isAny?</code> <code class="primitive">boolean</code></p>
</Section> </Segment>

fullArgs

<Segment> <Section type="signature"> ```ts fullArgs(true, false ,true): FormatSpecifier ``` </Section>

This function takes full args.

<Section type="parameters"> <InlineSection> **Type** <code class="primitive">Object</code> </InlineSection>
  • <p><code class="key">prop1?</code> <code class="primitive">boolean</code></p> <InlineSection> **Default** <code class="primitive">true</code> </InlineSection>

    A simple prop to add.

  • <p><code class="key">prop2?</code> <code class="symbol">&ldquo;</code><code class="primitive">x86_64</code><code class="symbol">&rdquo;</code><code class="symbol"> | </code><code class="symbol">&ldquo;</code><code class="primitive">arm_64</code><code class="symbol">&rdquo;</code></p> <InlineSection> **Default** Uses x86 by default `x86_64`. But this description of the default is really long and runs more than one single line. </InlineSection>

    A complex prop to add with a description that is longer than one line. This matters because

    A simple example.

    ts
    { prop2: "x86_64" }
    

    A more complicated multi-line example.

    ts
    {
      prop2: "x86_64"
    }
    
  • <p><code class="key">prop3?</code> [<code class="type">FormatSpecifier</code>](#FormatSpecifier)<code class="symbol">[]</code><code class="symbol"> | </code><code class="primitive">null</code></p> <InlineSection> **Default** <code class="primitive">true</code> </InlineSection>

    Just pass something in.

    ts
    {
      prop2: "x86_64"
    }
    
</Section> <InlineSection> **Returns** [<code class="type">FormatSpecifier</code>](#FormatSpecifier)<code class="symbol">[]</code><code class="symbol"> | </code><code class="primitive">null</code> </InlineSection>

Here's an example.

diff
  function demo() {
+   return fullArgs(true, false ,true);
  }

And another example.

ts
const a = 1;
const b = a + 1;

fullArgs(true, false ,true);
</Segment>

Properties

primitiveProp

<Segment> The ARN of the resource. <InlineSection> **Type** <code class="symbol">&ldquo;</code><code class="primitive">x86_64</code><code class="symbol">&rdquo;</code><code class="symbol"> | </code><code class="symbol">&ldquo;</code><code class="primitive">arm_64</code><code class="symbol">&rdquo;</code> </InlineSection> </Segment>

objectProp

<Segment> A simple object prop. <Section type="parameters"> <InlineSection> **Type** <code class="primitive">Object</code> </InlineSection>
  • <p><code class="key">resource1</code> <code class="primitive">string</code></p>
  • <p><code class="key">resource2</code> [<code class="type">FormatSpecifier</code>](#FormatSpecifier)</p>
</Section> </Segment>

objectPropNested

<Segment> A nested object prop. <Section type="parameters"> <InlineSection> **Type** <code class="primitive">Object</code> </InlineSection> - <p>[<code class="key">resource1</code>](#) <code class="primitive">Output</code><code class="symbol">&lt;</code><code class="primitive">Object</code><code class="symbol">&gt;</code></p> - <p>[<code class="key">objectKey1</code>](#) <code class="primitive">Object</code></p> - <p>[<code class="key">objectKey11</code>](#) <code class="primitive">Object</code><code class="symbol">[]</code></p> - <p>[<code class="key">key111</code>](#) <code class="primitive">boolean</code></p> - <p>[<code class="key">objectKey112</code>](#) <code class="primitive">Object</code></p> - <p>[<code class="key">key1111</code>](#) <code class="primitive">string</code></p> - <p>[<code class="key">key1112</code>](#) <code class="primitive">string</code></p> - <p>[<code class="key">key2</code>](#) <code class="primitive">boolean</code></p> - <p>[<code class="key">resource2</code>](#) [<code class="type">FormatSpecifier</code>](#FormatSpecifier)</p> </Section> </Segment>

<NestedTitle id="1" Tag="h4" parent="objectPropNested.">objectKey1</NestedTitle>

<Segment> A simple object prop. <InlineSection> **Type** <code class="primitive">Output</code><code class="symbol">&lt;</code><code class="primitive">Object</code><code class="symbol">&gt;</code> </InlineSection> </Segment>

<NestedTitle id="2" Tag="h5" parent="objectPropNested.resource1.">objectKey1</NestedTitle>

<Segment> A simple object prop. <InlineSection> **Type** <code class="primitive">Object</code> </InlineSection> </Segment>

<NestedTitle id="3" Tag="h5" parent="objectPropNested.resource1.objectKey1.">objectKey11</NestedTitle>

<Segment> A simple object prop. <InlineSection> **Type** <code class="primitive">Object</code><code class="symbol">[]</code> </InlineSection> </Segment>

<NestedTitle id="4" Tag="h5" parent="objectPropNested.resource1.objectKey1.objectKey11[].">objectKey112</NestedTitle>

<Segment> A simple object prop. <InlineSection> **Type** <code class="primitive">Object</code> </InlineSection> </Segment>

<NestedTitle id="5" Tag="h5" parent="objectPropNested.resource1.objectKey1.objectKey11[].objectKey112.">key1111</NestedTitle>

<Segment> A simple prop. <InlineSection> **Type** <code class="primitive">string</code> </InlineSection> </Segment>

DummyArgs

simpleArg

<Segment> The CPU architecture of the lambda function. <InlineSection> **Type** <code class="symbol">&ldquo;</code><code class="primitive">x86_64</code><code class="symbol">&rdquo;</code><code class="symbol"> | </code><code class="symbol">&ldquo;</code><code class="primitive">arm_64</code><code class="symbol">&rdquo;</code> </InlineSection> <InlineSection> **Default** Uses x86 by default `x86_64`. But this description of the default is really long and runs more than one single line. </InlineSection>

For example,

ts
new Function(stack, "Function", {
  architecture: "arm_64",
})
</Segment>

objectPropSimple?

<Segment> A prop that takes an object with simple keys. <Section type="parameters"> <InlineSection> **Type** <code class="primitive">Object</code> </InlineSection>
  • <p><code class="key">isTrue</code> <code class="primitive">boolean</code></p>
  • <p><code class="key">isFalse?</code> <code class="primitive">boolean</code></p>
  • <p><code class="key">isAny?</code> <code class="primitive">boolean</code></p>
</Section> <InlineSection> **Default** <code class="primitive">undefined</code> </InlineSection>
ts
new Function(stack, "Function", {
  architecture: "arm_64",
})
</Segment>

objectPropFull?

<Segment> A prop that takes an object with full keys. <Section type="parameters"> <InlineSection> **Type** <code class="primitive">Object</code> </InlineSection>
  • <p><code class="key">prop1?</code> <code class="primitive">boolean</code></p> <InlineSection> **Default** <code class="primitive">true</code> </InlineSection>

    A simple prop to add.

    ts
    {
      prop1: true
    }
    
  • <p><code class="key">prop2?</code> <code class="symbol">&ldquo;</code><code class="primitive">x86_64</code><code class="symbol">&rdquo;</code><code class="symbol"> | </code><code class="symbol">&ldquo;</code><code class="primitive">arm_64</code><code class="symbol">&rdquo;</code></p> <InlineSection> **Default** Uses x86 by default `x86_64`. But this description of the default is really long and runs more than one single line. </InlineSection>

    A complex prop to add with a description that is longer than one line. This matters because

    A simple example.

    ts
    { prop2: "x86_64" }
    

    A more complicated multi-line example.

    ts
    {
      prop2: "x86_64"
    }
    
  • <p><code class="key">prop3?</code> [<code class="type">FormatSpecifier</code>](#FormatSpecifier)<code class="symbol">[]</code><code class="symbol"> | </code><code class="primitive">null</code></p> <InlineSection> **Default** <code class="primitive">true</code> </InlineSection>

    Just pass something in.

    ts
    {
      prop2: "x86_64"
    }
    
</Section> <InlineSection> **Default** <code class="primitive">undefined</code> </InlineSection>
ts
new Function(stack, "Function", {
  architecture: "arm_64",
})
</Segment>

transform?

<Segment> [Transform](/docs/transform/) how this component is created. <Section type="parameters"> <InlineSection> **Type** <code class="primitive">Object</code> </InlineSection>
  • <p><code class="key">resource1?</code> [<code class="type">FormatSpecifier</code>](#FormatSpecifier)<code class="symbol"> | </code><code class="symbol">(</code><code class="primitive">args</code><code class="symbol">: </code>[<code class="type">FormatSpecifier</code>](#FormatSpecifier)<code class="symbol"> => </code>[<code class="type">FormatSpecifier</code>](#FormatSpecifier)<code class="symbol"> | </code><code class="primitive">void</code><code class="symbol">)</code></p>
  • <p><code class="key">resource1?</code> [<code class="type">FormatSpecifier</code>](#FormatSpecifier)<code class="symbol"> | </code><code class="symbol">(</code><code class="primitive">args</code><code class="symbol">: </code>[<code class="type">FormatSpecifier</code>](#FormatSpecifier)<code class="symbol"> => </code>[<code class="type">FormatSpecifier</code>](#FormatSpecifier)<code class="symbol"> | </code><code class="primitive">void</code><code class="symbol">)</code></p>
</Section> <InlineSection> **Default** <code class="primitive">undefined</code> </InlineSection> </Segment> </div>