Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_style: ViewStyle,
resizingConstraint?: ResizeConstraints,
shadows?: ViewStyle[],
): FileFormat.Text => ({
_class: 'text',
do_objectID: generateID(`text:${name}-${textNodes.map(node => node.content).join('')}`),
frame,
isFlippedHorizontal: false,
isFlippedVertical: false,
isLocked: false,
isVisible: true,
layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
name,
nameIsFixed: false,
resizingConstraint: makeResizeConstraint(resizingConstraint),
resizingType: FileFormat.ResizeType.Stretch,
rotation: 0,
shouldBreakMaskChain: false,
attributedString: makeAttributedString(textNodes),
style: makeTextStyle((textNodes[0] || { textStyles: {} }).textStyles, shadows),
automaticallyDrawOnUnderlyingPath: false,
dontSynchroniseWithSymbol: false,
// NOTE(akp): I haven't fully figured out the meaning of glyphBounds
glyphBounds: '',
// glyphBounds: '{{0, 0}, {116, 17}}',
lineSpacingBehaviour: FileFormat.LineSpacingBehaviour.ConsistentBaseline,
textBehaviour: FileFormat.TextBehaviour.Fixed,
booleanOperation: FileFormat.BooleanOperation.NA,
exportOptions: {
_class: 'exportOptions',
exportFormats: [],
includedLayerIds: [],
horizontalSpacing: 0,
verticalSpacing: 0,
nameIsFixed: true,
isVisible: true,
do_objectID: generateID(`symbolInstance:${name}:${symbolID}`),
resizingConstraint: makeResizeConstraint(resizingConstraint),
name,
symbolID,
frame,
booleanOperation: FileFormat.BooleanOperation.NA,
isLocked: false,
isFixedToViewport: false,
isFlippedHorizontal: false,
isFlippedVertical: false,
layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
resizingType: FileFormat.ResizeType.Stretch,
rotation: 0,
shouldBreakMaskChain: false,
overrideValues: [],
scale: 1,
exportOptions: {
_class: 'exportOptions',
exportFormats: [],
includedLayerIds: [],
layerOptions: 0,
shouldTrim: false,
},
});
| FileFormat.Bitmap
)[] = [],
style?: ViewStyle,
shadows?: ViewStyle[],
fills?: FileFormat.Fill[],
resizingConstraint?: ResizeConstraints,
): FileFormat.ShapeGroup => ({
_class: 'shapeGroup',
do_objectID: generateID(),
frame,
isLocked: false,
isVisible: true,
name: 'ShapeGroup',
nameIsFixed: false,
resizingConstraint: makeResizeConstraint(resizingConstraint),
resizingType: FileFormat.ResizeType.Stretch,
rotation: 0,
shouldBreakMaskChain: false,
style: makeStyle(style, fills, shadows),
hasClickThrough: false,
layers,
clippingMaskMode: 0,
hasClippingMask: false,
windingRule: FileFormat.WindingRule.EvenOdd,
isFixedToViewport: false,
exportOptions: {
_class: 'exportOptions',
exportFormats: [],
includedLayerIds: [],
layerOptions: 0,
shouldTrim: false,
},
},
}),
isFlippedHorizontal: false,
isFlippedVertical: false,
isFixedToViewport: false,
isLocked: false,
booleanOperation: FileFormat.BooleanOperation.NA,
exportOptions: {
_class: 'exportOptions',
exportFormats: [],
includedLayerIds: [],
layerOptions: 0,
shouldTrim: false,
},
layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
resizingType: FileFormat.ResizeType.Stretch,
shouldBreakMaskChain: false,
hasClickThrough: false,
layers: [],
includeInCloudUpload: true,
includeBackgroundColorInExport: color !== undefined,
horizontalRulerData: {
_class: 'rulerData',
base: 0,
guides: [],
},
verticalRulerData: {
_class: 'rulerData',
base: 0,
guides: [],
},
resizingConstraint: makeResizeConstraint(),
frame: FileFormat.Rect,
path: Pick,
resizingConstraint?: ResizeConstraints,
): FileFormat.ShapePath => ({
_class: 'shapePath',
frame,
do_objectID: generateID(),
isFlippedHorizontal: false,
isFlippedVertical: false,
isLocked: false,
isVisible: true,
layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
name: 'Path',
nameIsFixed: false,
resizingConstraint: makeResizeConstraint(resizingConstraint),
resizingType: FileFormat.ResizeType.Stretch,
rotation: 0,
shouldBreakMaskChain: false,
booleanOperation: FileFormat.BooleanOperation.NA,
edited: false,
...path,
isFixedToViewport: false,
pointRadiusBehaviour: FileFormat.PointsRadiusBehaviour.Rounded,
exportOptions: {
_class: 'exportOptions',
exportFormats: [],
includedLayerIds: [],
layerOptions: 0,
shouldTrim: false,
},
});