Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
add more docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr committed Jul 29, 2022
1 parent 249cabc commit 87596f3
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 7 deletions.
37 changes: 30 additions & 7 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ new Code()

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@monadahq/polycons.Code.property.language">language</a></code> | <code>string</code> | *No description.* |
| <code><a href="#@monadahq/polycons.Code.property.path">path</a></code> | <code>string</code> | *No description.* |
| <code><a href="#@monadahq/polycons.Code.property.text">text</a></code> | <code>string</code> | *No description.* |
| <code><a href="#@monadahq/polycons.Code.property.language">language</a></code> | <code>string</code> | The language of the code. |
| <code><a href="#@monadahq/polycons.Code.property.path">path</a></code> | <code>string</code> | A path to the code in the user's file system that can be referenced for bundling purposes. |
| <code><a href="#@monadahq/polycons.Code.property.text">text</a></code> | <code>string</code> | The raw code contents. |

---

Expand All @@ -262,6 +262,10 @@ public readonly language: string;

- *Type:* string

The language of the code.

Currently recognized values: "javascript"

---

##### `path`<sup>Required</sup> <a name="path" id="@monadahq/polycons.Code.property.path"></a>
Expand All @@ -272,6 +276,8 @@ public readonly path: string;

- *Type:* string

A path to the code in the user's file system that can be referenced for bundling purposes.

---

##### `text`<sup>Required</sup> <a name="text" id="@monadahq/polycons.Code.property.text"></a>
Expand All @@ -282,6 +288,8 @@ public readonly text: string;

- *Type:* string

The raw code contents.

---


Expand Down Expand Up @@ -335,7 +343,7 @@ Reference code directly from a string.

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@monadahq/polycons.JSCode.property.language">language</a></code> | <code>string</code> | *No description.* |
| <code><a href="#@monadahq/polycons.JSCode.property.language">language</a></code> | <code>string</code> | The language of the code. |
| <code><a href="#@monadahq/polycons.JSCode.property.path">path</a></code> | <code>string</code> | *No description.* |
| <code><a href="#@monadahq/polycons.JSCode.property.text">text</a></code> | <code>string</code> | Returns the text contents. |

Expand All @@ -349,6 +357,10 @@ public readonly language: string;

- *Type:* string

The language of the code.

Currently recognized values: "javascript"

---

##### `path`<sup>Required</sup> <a name="path" id="@monadahq/polycons.JSCode.property.path"></a>
Expand Down Expand Up @@ -513,9 +525,9 @@ new Process(props: ProcessProps)

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@monadahq/polycons.Process.property.captures">captures</a></code> | <code>{[ key: string ]: <a href="#@monadahq/polycons.Capture">Capture</a>}</code> | *No description.* |
| <code><a href="#@monadahq/polycons.Process.property.code">code</a></code> | <code><a href="#@monadahq/polycons.Code">Code</a></code> | *No description.* |
| <code><a href="#@monadahq/polycons.Process.property.entrypoint">entrypoint</a></code> | <code>string</code> | *No description.* |
| <code><a href="#@monadahq/polycons.Process.property.captures">captures</a></code> | <code>{[ key: string ]: <a href="#@monadahq/polycons.Capture">Capture</a>}</code> | Capture information. |
| <code><a href="#@monadahq/polycons.Process.property.code">code</a></code> | <code><a href="#@monadahq/polycons.Code">Code</a></code> | Reference to code containing the entrypoint function. |
| <code><a href="#@monadahq/polycons.Process.property.entrypoint">entrypoint</a></code> | <code>string</code> | Name of the exported function which will be run. |

---

Expand All @@ -527,6 +539,13 @@ public readonly captures: {[ key: string ]: Capture};

- *Type:* {[ key: string ]: <a href="#@monadahq/polycons.Capture">Capture</a>}

Capture information.

During runtime, a map containing all captured values
will be passed as the first argument of the entrypoint function.

Each key here will be the key for the final value in the map.

---

##### `code`<sup>Required</sup> <a name="code" id="@monadahq/polycons.Process.property.code"></a>
Expand All @@ -537,6 +556,8 @@ public readonly code: Code;

- *Type:* <a href="#@monadahq/polycons.Code">Code</a>

Reference to code containing the entrypoint function.

---

##### `entrypoint`<sup>Required</sup> <a name="entrypoint" id="@monadahq/polycons.Process.property.entrypoint"></a>
Expand All @@ -547,6 +568,8 @@ public readonly entrypoint: string;

- *Type:* string

Name of the exported function which will be run.

---


Expand Down
26 changes: 26 additions & 0 deletions src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,22 @@ export interface ICapturable {
* Reference to a piece of code.
*/
export abstract class Code {
/**
* The language of the code.
*
* Currently recognized values: "javascript"
*/
public abstract readonly language: string;

/**
* The raw code contents.
*/
public abstract readonly text: string;

/**
* A path to the code in the user's file system that can be referenced
* for bundling purposes.
*/
public abstract readonly path: string;
}

Expand Down Expand Up @@ -95,8 +109,20 @@ export interface ProcessProps {
* that exists to be run outside of the scope of a `constructs` application.
*/
export class Process {
/**
* Reference to code containing the entrypoint function.
*/
public readonly code: Code;
/**
* Name of the exported function which will be run.
*/
public readonly entrypoint: string;
/**
* Capture information. During runtime, a map containing all captured values
* will be passed as the first argument of the entrypoint function.
*
* Each key here will be the key for the final value in the map.
*/
public readonly captures: { [name: string]: Capture };

constructor(props: ProcessProps) {
Expand Down

0 comments on commit 87596f3

Please sign in to comment.