> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Type Declarations in a Manifest

## Article: Type Declarations in a Manifest

## Article Link: https://dev.wix.com/docs/site-extensions/editor-react-components/editor-react-types/overview/type-declarations-in-a-manifest.md

## Article Content:

# Type Declarations in a Manifest

When you declare a type in a manifest, several things shape how it behaves, such as the role
you declare it in, the configuration options you attach, and the `defaultValue` you set.

## Declaration roles

A type is declared in one of the following roles. Depending on the role, the declaration
appears in an Editor React Component (ERC), a context provider, or a function.

| Role                          | Declares                                      | Appears in                                                                                     |
| ----------------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Data property                 | Value the Wix user sets in a panel            | ERC `editorElement.data` or context provider `data`                                            |
| Context item                  | Value exposed for other components to bind to | ERC `editorElement.contexts` or context provider `context.items`                               |
| Function parameter and return | Value a function accepts or returns           | Editor Function Library, `dataType: "function"` data item, or `function` inside a context item |

Not every type is allowed in every role. For example, the `container` and `schema` types are data-property only.
They cannot be a context item or a function parameter or return.

## Configuration options

Configuration options are the settings you attach to a declaration to shape what the Wix
user can enter. They constrain authoring only. They don't change the runtime type, and they
never reach your component.

Not every type has options. A `boolean` takes none, while a `link` offers several. Which
options a type accepts depends on the pairing of type and role, so the same type can
offer options in one role and none in another. For example, a `link` data property and a `link`
parameter both take link options, but a `richText` data property takes options while a `richText`
parameter doesn't.

## Default values

A data property can carry a `defaultValue`, the initial value you set in the manifest. For
most types it's the same value your component receives. Set a text field's `defaultValue` to
`'Shop now'` and your component receives `'Shop now'`.

For a few types you provide less than the component receives, and the editor fills in the
rest before your component runs. An `Image` is one example. In the manifest you set only a
`uri` that points to the image, and the editor expands it into the full `Image` object your
component receives, including the `url` and the other fields it derives. So an image
`defaultValue` holds a `uri`, not a finished `Image`.

A function parameter takes no `defaultValue`. Marking a parameter `optional` only lets the
caller leave it out.

Each type page notes its own `defaultValue` shape when it differs from the value the
component receives.