Return all fields matching by name.
The name to search for.
Optional
cb: null[Deprecated] Shouldn't be used anymore, please pass null instead.
Optional
exact: booleanOptional flag to indicate if the search should be exact or not. Default is false.
Optional
types: FieldType | FieldType[]Optional type filter. Specify a single type or an array of types to filter by. If not specified, all types will be returned.
Returns the fields matching the specified name.
Return all fields on the specified pages - optionally filtered by type.
Page can be specified by either index or id and either as a single value or an array of values.
Optional
cb: null[Deprecated] Shouldn't be used anymore, please pass null instead.
Optional
types: FieldType | FieldType[]Optional type filter. Specify a single type or an array of types to filter by. If not specified, all types will be returned.
Returns the fields on the specified pages.
Return all fields matching specified tags and are on the specified pages - optionally filtered by type.
Either a single tag or an array of tags to filter by.
Page can be specified by either index or id and either as a single value or an array of values.
[Deprecated] Shouldn't be used anymore, please pass null instead.
Optional flag to indicate if all tags should be matched or any. Default is false.
Optional
types: FieldType | FieldType[]Optional type filter. Specify a single type or an array of types to filter by. If not specified, all types will be returned.
Returns the fields matching the specified tags and pages.
Return all fields matching specified tags - optionally filtered by type.
Either a single tag or an array of tags to filter by.
[Deprecated] Shouldn't be used anymore, please pass null instead.
Optional flag to indicate if all tags should be matched or any. Default is false.
Optional
types: FieldType | FieldType[]Optional type filter. Specify a single type or an array of types to filter by. If not specified, all types will be returned.
Returns the fields matching the specified tags.
Copy the given field. This can be used to simply copy or move a field (in conjunction with DeleteField).
The field to copy identified by id or object
The target page identified by index, id or name.
Optional
cb: null[Deprecated] Shouldn't be used anymore, please pass null instead.
Optional
tags: string[]Optional tags to assign to the field directly at creation time. Note that tags should not contain the '|' character. The tags of the source field will be merged with the specified tags.
The copied field.
Create a new custom field for a specific sub type.
The custom field subtype as identified when registering the custom field.
The page identified by index, id or name.
The position of the field on the page.
The size of the field on the page
Optional
cb: null[Deprecated] Shouldn't be used anymore, please pass null instead.
Optional
tags: string[]Optional tags to assign to the field directly at creation time. Note that tags should not contain the '|' character.
The newly created custom field.
Creates a new field of the specified type.
The field type to create. For custom fields, please use CreateCustomField instead.
The page identified by index, id or name.
The position of the field on the page.
The size of the field on the page
Optional
cb: null[Deprecated] Shouldn't be used anymore, please pass null instead.
Optional
tags: string[]Optional tags to assign to the field directly at creation time. Note that tags should not contain the '|' character.
The newly created field.
Deletes a field from the document.
The field to delete identified by id or object
Flag indicating if the field was deleted or not.
Get the current font size used in a text field as if fit to box would be enabled. This allows to set the fit to box options directly in the parameters. Note that you have to either specify the values or the defaults as below will be used. It will not use the field settings for it automatically.
The text field directly or the id of the text field.
The callback will be triggered once the font size has been calculated and the value is passed as a parameter.
Optional
withWrap: booleanFlag to control if text wrapping should be applied when calculating the font size. Default is false.
Optional
minFontSize: numberThe minimum font size to use when calculating the font size. Default is -1 - meaning no minimum font size.
Optional
maxFontSize: numberThe maximum font size to use when calculating the font size. Default is -1 - meaning no maximum font size.
Get the text as HTML where the rich text format is represented with the MegaEdit rich text format.
The text field directly or the id of the text field.
Optional
cb: null[Deprecated] Shouldn't be used anymore, please pass null instead.
Optional
includeFieldSettings: booleanIf true, we will have styling tags for the field standard format too in the output. If false, we will have only the rich text formatting which differs from the field standard format. Default is false. Use it to display the format externally (e.g. in a HTML context).
Optional
tagLimiters: string[]This is an array of size two where the first element is the opening tag, and the second element is the closing tag used as the tag limiter. Standard value is ['<' , '>'].
Optional
entireTextFlow: booleanIf this is true we will extract the text from an entire text flow if the field is part of it. If false, we will extract only the text from the field itself. Default is false.
The text as HTML variant.
Returns the text flow chain the specified field is part of. It will return a list with at least one field (the source), but if there is a text flow configured, it will return the flow in order of the flow direction.
The text field directly or the id of the text field.
An ordered list of text fields which makue up the entire text flow.
Measure the text within a field and retrieve information about it including the overflow text and the dimensions of the text.
The id of the field or the field object itself. Must be a text field.
The callback is triggered once the measurements are ready.
Renders a field to an image. This is useful to get a preview of the field.
The field to render identified by id or object
The width of the image in pixels. The height will be calculated automatically based on the aspect ratio of the field.
The callback is triggered once the image is ready and the image data is passed as a parameter in base 64 format.
Updates the appareance of a custom field. This is important if the underlaying data has been changed and the field needs to be updated to show the new data.
The custom field directly or the id of the custom field.
Flag indicating if the field was updated or not.
Save a range of fields in a single call. This is to improve performance, but is mandatory for text fields with text flow to ensure the text flow is correctly updated.
The field objects to save.
Sets the image scale or zoom of an image field. Value is between 0 and 100 - and that can be used as a simplified call to use the zoom feature.
The image field directly or the id of the image field.
The zoom value to set. Value is between 0 and 100.
Flag indicating if the image scale was set or not.
Set the text of the field in a limited HTML format. MegaEdit rich text format is only a very small subset and is very limited in what it can represent compared to HTML. This is the prefered method to set text with rich text formatting.
The text field directly or the id of the text field.
The text to set including rich text formatting. Newlines are represented with '
' and Html entities may be decoded.
Optional
cb: ((success?, self?, response?) => void)Optional callback to be triggered once the text has been set.
Optional
success: booleanOptional
self: TextFieldOptional
response: TextChangedResponseOptional
tagLimiters: string[]This is an array of size two where the first element is the opening tag, and the second element is the closing tag used as the tag limiter. Standard value is ['<' , '>'].
Generated using TypeDoc
The fields interface allows to interact with the fields. Retrieve them, manipulate them and perform additional helper operations.