TemplateCustomizationObjects

DSHDLib. Namespace

TemplateCustomizationObjects

Source:

Type Definitions

TemplateCustomizationObject

Description:
Source:
Properties:
Name Type Description
elements Object.<string, DSHDLib.TemplateCustomizationObjects.TemplateCustomizationObjectElementUpdates> A map of data to populate based on element name matches
classes Object.<string, DSHDLib.TemplateCustomizationObjects.TemplateCustomizationObjectElementUpdates> A map of data to populate based on element class name matches
replacements Object.<string, DSHDLib.TemplateCustomizationObjects.TemplateCustomizationObjectReplacements> A map of replacements to make based on matched properties
An object containing data to populate a template. Read full documentation here
Type:
  • Object

TemplateCustomizationObjectElementUpdates

Description:
Source:
Tutorials:
Properties:
Name Type Attributes Description
color string <optional>
A color to set on matching text, shape and line elements (RGB/CMYK/SPOT)
color_map Object.<string, string> <optional>
Replace the RGB color of any supplied key with with a new color (RGB/CMYK/SPOT) on matching text, shape and line elements
text string | Array.<string> <optional>
Text to replace on matching text elements. If supplied as an array, one item will be randomly selected (or provide a seed for repeatable output)
text_markup string <optional>
Text to replace on matching text elements, including basic HTML tags (br, b, i, u, sup, sub)
text_prompt Object <optional>
Use AI to generate text for matching text elements
Properties
Name Type Attributes Default Description
prompt string <optional>
The prompt to supply to the LLM
count number <optional>
1 The number of variants to generate. Max: 10
desired_length number <optional>
The desired number of characters in each variant (non-exact)
tone string <optional>
The tone of the output. One of: "formal", "professional", "casual", "friendly", "persuasive", "informative", "humorous", "empathetic", "urgent"
auto_fit bool | DSHDLib.Editors.ProjectData.NewElements.TextAutoFitProperties <optional>
If supplied as a boolean, a value indicating weither to update font size dynamically to fit the supplied text within any matching textbox's current width/line count
font Object <optional>
Update the font on matching text elements
Properties
Name Type Attributes Default Description
font_file_id number <optional>
The specific ID of a font to reference
family string <optional>
The name of the font family to set
bold bool <optional>
false A value indicating weither to use a bold version of the new font (if available)
italic bool <optional>
false A value indicating weither to use an italic version of the new font (if available)
text_token_map Object.<string, string> <optional>
Auto-replace the supplied tokens found on matching text elements, maintaining future replaceability
text_options Array.<string> <optional>
The list of options to set on matching text elements for users to choose from in the editor
text_options_prompt Object <optional>
Use AI to generate text_options for matching text elements
Properties
Name Type Attributes Default Description
prompt string <optional>
The prompt to supply to the LLM
count number <optional>
1 The number of variants to generate. Max: 10
desired_length number <optional>
The desired number of characters in each variant (non-exact)
tone string <optional>
The tone of the output. One of: "formal", "professional", "casual", "friendly", "persuasive", "informative", "humorous", "empathetic", "urgent"
hyperlink string <optional>
Set a hyperlink on matching text elements
rtl bool <optional>
Set whether text is Right-to-Left on matching text elements
stroke Object <optional>
Update the stroke on matching text, shape and image elements
Properties
Name Type Attributes Description
color string <optional>
The color to apply (RGB/CMYK/SPOT)
url string <optional>
A public or signed url reference or a data url for a svg, png or jpg file. This will either be placed in a matching zone or replace a placeholder shape element
asset Object <optional>
Populate a matching zone or replace a shape with an existing image, vector, or video from either a project asset or a library asset
Properties
Name Type Attributes Description
store string <optional>
Specifies where the asset is referenced. One of: "project", "library"
asset_type string <optional>
One of: "image", "vector", "video"
asset_id number <optional>
Autogenerated ID assgined to a previously stored asset
asset_code string <optional>
Custom supplied ID representing an asset
position_relative_to_original Object <optional>
Override the default position (relative to the matching zone/shape) for images placed via the "url" property
Properties
Name Type Attributes Description
horizontal_align string <optional>
A horizontal position of "left", "center" or "top"
horizontal_align string <optional>
A vertical position of "top", "center" or "bottom"
media_position Object <optional>
Define the positioning and scaling of media (supplied via url or asset) within a specified zone
Properties
Name Type Attributes Description
scale_width number <optional>
Width scaling factor of the media, as a percentage of the zone's total width
scale_height number <optional>
Height scaling factor of the media, as a percentage of the zone's total height
x number <optional>
Horizontal center position of the media, as a percentage of the zone's width
y number <optional>
Vertical center position of the media, as a percentage of the zone's height
masked_media Object <optional>
Set or update a masked image in matching shape elements
Properties
Name Type Attributes Description
url string <optional>
A public or signed url reference or a data url for a png or jpg file that will be masked in matching shape elements
blend_mode string <optional>
Blend mode used to control how the element interacts visually with layers below
color_overlay Object <optional>
A color overlay to apply to a matching masked image
Properties
Name Type Attributes Description
color string <optional>
The color to apply (RGB/CMYK/SPOT)
percentage number <optional>
A number between 0 and 1 representing the intensity of the color overlay
saturation number <optional>
A number between -1 and 1 representing the saturation to apply to the masked image
opacity number <optional>
Update the opacity on matching elements. A number between 0 (fully transparent/invisible) and 1 (fully opaque)
shadow Object <optional>
Update an existing shadow on matching text elements
Properties
Name Type Attributes Description
color string <optional>
The color to apply (RGB/CMYK/SPOT)
color_overlay Object <optional>
A color overlay to apply to any matching image elements
Properties
Name Type Attributes Description
color string <optional>
The color to apply (RGB/CMYK/SPOT)
percentage number <optional>
A number between 0 and 1 representing the intensity of the color overlay
saturation number <optional>
A number between -1 and 1 representing the saturation to apply to the new image set via the "url" property or existing matching image elements
blend_mode string <optional>
The blend mode to set on matched elements. One of: "none", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"
reposition Object <optional>
Reposition matching elements either absolutely or relatively
Properties
Name Type Attributes Default Description
top number <optional>
Distance from the top edge in the unit type of the template
left number <optional>
Distance from the left edge in the unit type of the template
relative bool <optional>
false Whether top/left represent absolute values on the canvas or relative distances from the current position
An object containing data to populate a matched element. Read full documentation here
Type:
  • Object

TemplateCustomizationObjectReplacements

Description:
Source:
Tutorials:
Properties:
Name Type Attributes Description
color Object.<string, string> <optional>
Update any instances of the matched color with the new color (RGB/CMYK/SPOT)
text Object.<string, string> <optional>
Update any text elements with the fully matched text with the replacement text
text_substring Object.<string, string> <optional>
Update any text (token) found within text elements with the replacement text
text_token_map Object.<string, string> <optional>
Similar to text_substring but maintaining future replaceability. Only stores the token keys found on specific text elements
An object containing data to replace matched element properties. Read full documentation here
Type:
  • Object