partials
import {...} from "@canvas-commons/2d/lib/partials";
Classes
Interfaces
Type Aliases
CanvasRepetition
type CanvasRepetition = null'repeat''repeat-x''repeat-y''no-repeat'
CanvasStyle
type CanvasStyle = nullColorGradientPattern
DesiredLength
type DesiredLength = Lengthnull
Represents a desired length used internally by layout Nodes.
When the desired length is set to null it represents a default value for
whatever property it describes.
FlexBasis
type FlexBasis = Lengthnull
FlexContent
type FlexContent = 'normal''center''start''end''space-between''space-around''space-evenly''stretch'
FlexDirection
type FlexDirection = 'row''row-reverse''column''column-reverse'
FlexItems
type FlexItems = 'auto''center''start''end''stretch''baseline'
FlexWrap
type FlexWrap = 'nowrap''wrap''wrap-reverse'
GradientType
type GradientType = 'linear''conic''radial'
LayoutMode
type LayoutMode = booleannull
Length
type Length = number`${number}%`
Represents a length used by most layout properties.
The value can be either:
number- the desired length in pixels${number}%- a string with the desired length in percents, for example'50%'
LengthLimit
type LengthLimit = Lengthnull
Represents a length limit used by layout properties such as max-width.
PartialRoughConfig
type PartialRoughConfig = PartialRoughConfig
Partial rough configuration with defaults applied.
PossibleCanvasStyle
type PossibleCanvasStyle = nullPossibleColorGradientPattern
RoughFillStyle
type RoughFillStyle = 'hachure''solid''zigzag''cross-hatch''dots''dashed''zigzag-line'
Fill style options for rough shapes.
hachure: Parallel lines filling the shape (default)solid: Solid fill with slight irregularityzigzag: Zigzag pattern fillingcross-hatch: Crossed parallel linesdots: Dotted pattern fillingdashed: Dashed lines fillingzigzag-line: Zigzag lines filling
TextAlign
type TextAlign = CanvasTextAlign'justify'
Line-level text alignment. Extends CanvasTextAlign with 'justify',
which distributes line-end slack across word gaps. Justification only
affects non-last lines of a paragraph; the last line falls back to the
start orientation.
TextExclusion
type TextExclusion = TextShapeExclusionhorizontalPadding?: numberkind: 'node'node: SignalValueNodeverticalPadding?: number
A region of a <Txt> block that text wraps around. Coordinates are
Txt-local and center-origin, the same space every other node uses. A node
exclusion instead reads its shape from a live Node.
TextShapeExclusion
type TextShapeExclusion = height: numberhorizontalPadding?: numberkind: 'rect'verticalPadding?: numberwidth: numberx: numbery: numberhorizontalPadding?: numberkind: 'polygon'points: x: numbery: number[]verticalPadding?: number
A region of a <Txt> block that text wraps around, given by its own
geometry. A rect's x/y is its center and polygon points sit in
the same space.
TextWrap
type TextWrap = boolean'pre'
VerticalAlign
type VerticalAlign = 'top''middle''bottom'
Vertical placement of text when the rendered text block is shorter than
the configured height. 'top' (default) aligns to the top edge,
'middle' centers, 'bottom' aligns to the bottom edge.
WordBreak
type WordBreak = 'normal''keep-all'
Functions
blur
public blurvalue?: SignalValuenumber: Filter
Create a blur filter.
Parameters
value?: SignalValuenumberThe value of the filter in pixels.
brightness
public brightnessvalue?: SignalValuenumber: Filter
Create a brightness filter.
Parameters
value?: SignalValuenumberThe value of the filter.
contrast
public contrastvalue?: SignalValuenumber: Filter
Create a contrast filter.
Parameters
value?: SignalValuenumberThe value of the filter.
getDefaultRoughConfig
public getDefaultRoughConfig(): RoughConfig
Get default rough configuration.
grayscale
public grayscalevalue?: SignalValuenumber: Filter
Create a grayscale filter.
Parameters
value?: SignalValuenumberThe value of the filter.
hue
public huevalue?: SignalValuenumber: Filter
Create a hue filter.
Parameters
value?: SignalValuenumberThe value of the filter in degrees.
invert
public invertvalue?: SignalValuenumber: Filter
Create an invert filter.
Parameters
value?: SignalValuenumberThe value of the filter.
mergeRoughConfig
public mergeRoughConfigconfig: PartialRoughConfig: RoughConfig
Merge partial rough configuration with defaults.
Parameters
config: PartialRoughConfigPartial configuration to merge
saturate
public saturatevalue?: SignalValuenumber: Filter
Create a saturate filter.
Parameters
value?: SignalValuenumberThe value of the filter.
sepia
public sepiavalue?: SignalValuenumber: Filter
Create a sepia filter.
Parameters
value?: SignalValuenumberThe value of the filter.