-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e905aaa
commit 5cbbbb3
Showing
14 changed files
with
227 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [Widget](./pages.widget.md) | ||
|
||
## Widget type | ||
|
||
The type definition for the widget's default function. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export type Widget<T extends WidgetRenderProps> = ( | ||
props: T | ||
) => React.JSX.Element; | ||
``` | ||
|
||
**References:** [WidgetRenderProps](./pages.widgetrenderprops.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetConfig](./pages.widgetconfig.md) | ||
|
||
## WidgetConfig interface | ||
|
||
The exported `config` function's definition. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface WidgetConfig | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| ------------------------------------- | --------- | ------ | -------------------------------------------------------------------------------------------------------- | | ||
| [name?](./pages.widgetconfig.name.md) | | string | _(Optional)_ The name of the widget feature. If not defined uses the widget filename (without extension) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetConfig](./pages.widgetconfig.md) > [name](./pages.widgetconfig.name.md) | ||
|
||
## WidgetConfig.name property | ||
|
||
The name of the widget feature. If not defined uses the widget filename (without extension) | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
name?: string; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetModule](./pages.widgetmodule.md) > [config](./pages.widgetmodule.config.md) | ||
|
||
## WidgetModule.config property | ||
|
||
The exported config function | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
config?: WidgetConfig; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetModule](./pages.widgetmodule.md) > [default](./pages.widgetmodule.default.md) | ||
|
||
## WidgetModule.default property | ||
|
||
The exported default widget function. This is expected to be a React Component. If undefined then will be used to generate the HTML instead. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
default?: Widget<U>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetModule](./pages.widgetmodule.md) | ||
|
||
## WidgetModule interface | ||
|
||
The type to include in any widget file. It defines the available functions and fields that are available to the template. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface WidgetModule<U extends WidgetRenderProps> | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| ------------------------------------------- | --------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| [config?](./pages.widgetmodule.config.md) | | [WidgetConfig](./pages.widgetconfig.md) | _(Optional)_ The exported config function | | ||
| [default?](./pages.widgetmodule.default.md) | | [Widget](./pages.widget.md)<!-- --><U> | _(Optional)_ The exported default widget function. This is expected to be a React Component. If undefined then will be used to generate the HTML instead. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetProps](./pages.widgetprops.md) > [\_\_meta](./pages.widgetprops.__meta.md) | ||
|
||
## WidgetProps.\_\_meta property | ||
|
||
Additional metadata added by the toolchain | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
__meta: { | ||
mode: "development" | "production"; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetProps](./pages.widgetprops.md) > [document](./pages.widgetprops.document.md) | ||
|
||
## WidgetProps.document property | ||
|
||
The entire document returned after applying the stream to a single entity | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
document: T; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetProps](./pages.widgetprops.md) | ||
|
||
## WidgetProps interface | ||
|
||
The shape of the data passed directly to the different template functions | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface WidgetProps<T = Record<string, any>> | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| ------------------------------------------- | --------- | ---------------------------------------- | ------------------------------------------------------------------------- | | ||
| [\_\_meta](./pages.widgetprops.__meta.md) | | { mode: "development" \| "production"; } | Additional metadata added by the toolchain | | ||
| [document](./pages.widgetprops.document.md) | | T | The entire document returned after applying the stream to a single entity | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetRenderProps](./pages.widgetrenderprops.md) | ||
|
||
## WidgetRenderProps interface | ||
|
||
The shape of the data passed directly to the template's render function. Extends the [TemplateProps](./pages.templateprops.md) interface and has the additions of a path and a relativePrefixToRoot field. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface WidgetRenderProps<T = any> extends WidgetProps<T> | ||
``` | ||
**Extends:** [WidgetProps](./pages.widgetprops.md)<!-- --><T> | ||
## Properties | ||
| Property | Modifiers | Type | Description | | ||
| ------------------------------------------------------------------------- | --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| [path](./pages.widgetrenderprops.path.md) | | string | The path that the generated file will live at on the site, as defined by the [GetPath](./pages.getpath.md) function. | | ||
| [relativePrefixToRoot](./pages.widgetrenderprops.relativeprefixtoroot.md) | | string | The relative path from the generated page to the root of the site. i.e. The path example/path/foo would have the relativePrefixToRoot of '../../'. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetRenderProps](./pages.widgetrenderprops.md) > [path](./pages.widgetrenderprops.path.md) | ||
|
||
## WidgetRenderProps.path property | ||
|
||
The path that the generated file will live at on the site, as defined by the [GetPath](./pages.getpath.md) function. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
path: string; | ||
``` |
13 changes: 13 additions & 0 deletions
13
packages/pages/docs/api/pages.widgetrenderprops.relativeprefixtoroot.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/pages](./pages.md) > [WidgetRenderProps](./pages.widgetrenderprops.md) > [relativePrefixToRoot](./pages.widgetrenderprops.relativeprefixtoroot.md) | ||
|
||
## WidgetRenderProps.relativePrefixToRoot property | ||
|
||
The relative path from the generated page to the root of the site. i.e. The path example/path/foo would have the relativePrefixToRoot of '../../'. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
relativePrefixToRoot: string; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters