Input/Output Types
Optionally, you can specify the input and output type of you code block. This will be used to suggest blocks to follow yours in a sequence, and help users provide an input to your block.
If you don't provide a type, your block will not be able to accept an input and will not display an output, but can still run.
Supported types:
| Type | Data Type (what your code will see) | Example | Notes |
|---|---|---|---|
| text | String | "Hello world!" | |
| number | Number | 12 | |
| image | String | "PNG\r\n\u001a\n\u0000\u0000\u0000" | Binary image data |
| location | Array of numbers | [ 37.77, -122.41 ] | (lat, lng) |
| dictionary | Object | { foo: "bar" } | |
| chart | Object | { April: 20, May: 25, June: 30 } | Keys must be strings and values must be numbers |
| table | Array of Objects | [ { name: 'Tim', age: 30 }, { name: 'Jess', age: 25 } ] | Keys in all objects must match |
| boolean | Boolean | true | true or false |
More types will be added in the future, like dates, times, URLs and more.