ChannelPreviewResult
OCP App SDK / ChannelPreviewResult
ChannelPreviewResult
Result of preview. All previews must be a full HTML page. There must be exactly one preview per
recipient, and they must be added to this result in the same order as the recipients were given to
preview.
Hierarchy
FormResult
.ChannelPreviewResult
Index
Constructors
Properties
Methods
Constructors
constructor()
Signature
new ChannelPreviewResult(previews?: string[]): ChannelPreviewResult;
Parameters
Name | Type | Description |
---|---|---|
previews? | string [] | the complete set of HTML previews, if already known |
Returns
Overrides: FormResult.constructor
Defined in: src/app/lib/ChannelPreviewResult.ts:33
Properties
errors
Protected
object
={}
Index signature
[field
: string
]: string
[]
Type declaration
Inherited from: FormResult.errors
Defined in: src/app/lib/FormResult.ts:4
toasts
Protected
{
`intent`: [`Intent`](app-sdk-api-reference-types-intent);
`message`: `string`;
}[] = []
Inherited from: FormResult.toasts
Defined in: src/app/lib/FormResult.ts:5
Methods
addError()
Add an error to display to the user for a particular form field
Signature
addError(
form: "settings" | "template",
section: string,
field: string,
error: string): ChannelPreviewResult;
Parameters
Name | Type | Description |
---|---|---|
form | "settings" | "template" | the type of content form that the error applies to (settings or template) |
section | string | the section within the form that the error applies to |
field | string | the field within the section that the error applies to |
error | string | message to display to the user |
Returns
Defined in: src/app/lib/ChannelPreviewResult.ts:72
addPreview()
Add a single HTML preview
Signature
addPreview(preview: string): ChannelPreviewResult;
Parameters
Name | Type | Description |
---|---|---|
preview | string | to add |
Returns
Defined in: src/app/lib/ChannelPreviewResult.ts:42
addToast()
Display a toast to user, such as, "Successfully authenticated with " or
"Authentication failed, please check your credentials and try again."
Signature
addToast(intent: Intent, message: string): ChannelPreviewResult;
Parameters
Name | Type | Description |
---|---|---|
intent | Intent | one of the supported intents that will affect how the toast is displayed |
message | string | to display in the toast |
Returns
Inherited from: FormResult.addToast
Defined in: src/app/lib/FormResult.ts:13
setDisplayOptions()
Set options to control how the preview is displayed
Signature
setDisplayOptions(displayOptions: PreviewDisplayOptions): ChannelPreviewResult;
Parameters
Name | Type | Description |
---|---|---|
displayOptions | PreviewDisplayOptions | to control the preview |
Returns
Defined in: src/app/lib/ChannelPreviewResult.ts:60
setPreviews()
Provide the complete set of HTML previews
Signature
setPreviews(previews: string[]): ChannelPreviewResult;
Parameters
Name | Type | Description |
---|---|---|
previews | string [] | to provide |
Returns
Defined in: src/app/lib/ChannelPreviewResult.ts:51
Updated 2 months ago