Skip to main content

@uniformdev/canvas

This package enables you to interact with the components and compositions defined in Uniform Canvas.

Functions

info

Coming soon.

Types

CanvasClient

Represents the client that can be used to interact with Uniform Canvas.
- Members
getComponentDefinitions(options)
Gets all component definitions.
  • optionsobject (optional)
    + show child attributes
getCompositionById(options)
Gets the composition with the specified ID.
  • optionsobject
    + show child attributes
Errors:
  • 404 response code- No component with the specified ID was found.
getCompositionBySlug(options)
Gets the composition with the specified slug.
  • optionsobject
    + show child attributes
Errors:
  • 404 response code- No component with the specified slug was found.
getCompositionList(options)
Gets all composition definitions.
  • optionsobject (optional)
    + show child attributes
Returns:
  • CompositionDefinition- The specified options ensure that only a single composition may be returned (i.e. either compositionId or slug is specified).
  • CompositionDefinitionCollection- The specified options may result in multiple compositions being returned (i.e. neither compositionId nor slug is specified).
Errors:
  • 404 response code- Either the compositionId or slug option is specified and no component is found.
For more information, see example in our developer guide.
removeComponentDefinition
removeComposition
updateComponentDefinition
updateComposition

ComponentDefinition

Represents a component definition from a Uniform project.
- Members
canBeCompositionboolean (optional)
If true, the component is a composition component. If false, the component is not a composition component.
createdstring (optional)
Timestamp for when the component was first created.
defaults (optional)
iconstring (optional)
Name of the one of the standard Uniform icons, or the URL for an image that is used to represent the component in Uniform.
idstring
Identifier for the component.
namestring
Name for the component.
parameters (optional)
permissions (optional)
slots (optional)
slugSettings (optional)
titleParameterstring (optional)
Name of the component parameter that is used to describe the component in Uniform.
updatedstring (optional)
Timestamp for when the component was last updated.
useTeamPermissionsboolean (optional)
variants (optional)

ComponentDefinitionCollection

Represents a collection of component definitions from a Uniform project.
- Members
componentDefinitionsComponentDefinition[]
The collection of component definitions.

CompositionDefinition

Represents a composition definition from a Uniform project.
- Members
composition
+ show child attributes
projectIdstring
statenumber
createdstring
Timestamp for when the component was first created.
modifiedstring
Timestamp for when the component was last updated.
patternboolean
resourcesobject

CompositionDefinitionCollection

Represents a collection of composition definitions from a Uniform project.
- Members
The collection of composition definitions.