Edit in GitHubLog an issue

groupLayer

Represents a group layer

Constructors

constructor

+ new GroupLayer(id: number, docId: number): GroupLayer

Overrides void

Parameters:

NameType
id
number
docId
number

Properties

isGroupLayer

isGroupLayer: boolean

Accessors

bounds

get bounds(): PsCommon.Bounds

Inherited from [Layer]/ps_reference/classes/layer/).bounds

Bounds of the layer, including the effects

Copied to your clipboard
const { left, top, right, bottom } = layer.bounds

boundsNoEffects

get boundsNoEffects(): PsCommon.Bounds

Inherited from Layer.boundsNoEffects

Bounds of the layer excluding effects

Copied to your clipboard
const { left, top, right, bottom } = layer.boundsNoEffects

children

get children(): LayerTypes[]

The child layers of this group layer

Copied to your clipboard
group.children.forEach((child) => {
...
})

kind

get kind(): LayerKind

Inherited from Layer.kind

Kind of the layer

Copied to your clipboard
if (layer.kind === LayerKind.TEXT) {
...
}

linkedLayers

get linkedLayers(): Layer[]

Inherited from Layer.linkedLayers

Layers linked to this layer

Copied to your clipboard
const layers = layerAA.linkedLayers
layers.forEach((layer) => {
...
})

parent

get parent(): GroupLayer | null

Inherited from Layer.parent

The group layer this layer is in, null if layer has no parent

Methods

delete

delete(): void

Inherited from Layer.delete

Deletes this layer from the document.

Copied to your clipboard
const layers = document.layers
layers && layers[0] && layers[0].delete()

number of layer elements deleted


duplicate

duplicate(targetDocument?: Document, name?: string): Promise‹Layer

Inherited from Layer.duplicate

Duplicates the layer, creating a copy above it in layer stack, and returns the newly created layer.

Copied to your clipboard
// duplicate a layer
const copyLayer = await layer.duplicate()
// extract to a new document
const exportDoc = psApp.documents[1]
const exportedLayer = await layer.duplicate(exportDoc)

async

Parameters:

NameTypeDescription
targetDocument?
if specified, duplicate to a different document target.
name?
string
-

flip

flip(axis: "horizontal" | "vertical" | "both"): Promise‹void›

Inherited from Layer.flip

Flips the layer on one or both axis.

Copied to your clipboard
// flip horizontally
await layer.flip("horizontal")

async

Parameters:

NameTypeDescription
axis
"horizontal" | "vertical" | "both"
Which axis (or both) to flip the layer on. - "horizontal": flip layer on horizontal axis - "vertical": flip layer on vertical axis - "both": flip layer on both axes

link(targetLayer: Layer): Layer[]

Inherited from Layer.link

Creates a link between this layer and the target layer if not already linked, and returns a list of layers linked to this layer.

Copied to your clipboard
// link two layers together
const linkedLayers = strokes.link(fillLayer)
linkedLayers.forEach((layer) => console.log(layer.name))
> "strokes"
> "fillLayer"

Parameters:

NameTypeDescription
targetLayer
layer to link with

array of linked layers


moveAbove

moveAbove(target?: LayerTypes): void

Inherited from Layer.moveAbove

Moves the layer to a position above the target layer or group. If no target layer is defined, move this layer up one slot.

Copied to your clipboard
foregroundLayer.moveAbove(backingLayer)
// foregroundLayer
// backingLayer

Parameters:

NameTypeDescription
target?
LayerTypes
layer or group that will proceed this layer.

moveBelow

moveBelow(target?: LayerTypes): void

Inherited from Layer.moveBelow

Moves the layer to a position below the target layer or group. If no target layer is defined, move this layer down one slot.

Copied to your clipboard
backingLayer.moveBelow(foregroundLayer)
// foregroundLayer
// backingLayer

Parameters:

NameTypeDescription
target?
LayerTypes
layer or group that will preceed this layer.

nudge

nudge(horizontal: number | PercentValue | PixelValue, vertical: number | PercentValue | PixelValue): Promise‹void›

Inherited from Layer.nudge

Moves the layer.

Copied to your clipboard
// nudge the layer to the left by 200px
await layer.nudge(-200, 0)
// move the layer one height down
let percent = (v) => ({ _unit: "percentUnit", _value: v })
await layer.nudge(percent(0), percent(100))

async

Parameters:

NameTypeDescription
horizontal
number | PercentValue | PixelValue
Numeric value to offset layer by in pixels or percent
vertical
number | PercentValue | PixelValue
Numeric value to offset layer by in pixels or percent

rotate

rotate(angle: number | AngleValue, options?: object): Promise‹void›

Inherited from Layer.rotate

Rotates the layer.

Copied to your clipboard
// rotate 90 deg counter clockwise
await layer.rotate(-90)

async

Parameters:

angle: number | AngleValue

Angle to rotate the layer by in degrees

Optional options: object

NameTypeDescription
interpolation?
InterpolationMethod
Interpolation method to use when resampling the image @default InterpolationMethod.bilinear

scale

scale(width: number | PercentValue, height: number | PercentValue, options?: object): Promise‹void›

Inherited from Layer.scale

Scales the layer.

Copied to your clipboard
await layer.scale(80, 80)

async

Parameters:

width: number | PercentValue

Numeric percentage to scale layer horizontally

height: number | PercentValue

Numeric percentage to scale layer vertically

Optional options: object

NameTypeDescription
interpolation?
InterpolationMethod
Interpolation method to use when resampling the image @default InterpolationMethod.bilinear

skew

skew(angleH: number | AngleValue, angleV: number | AngleValue, options?: object): Promise‹void›

Inherited from Layer.skew

Applies a skew to the layer.

Copied to your clipboard
// parellelogram shape
await layer.skew(-15, 0)

async

Parameters:

angleH: number | AngleValue

Horizontal angle to skew by

angleV: number | AngleValue

Vertical angle to skew by

Optional options: object

NameType
interpolation?
InterpolationMethod

unlink(): Promise‹void›

Inherited from Layer.unlink

Unlinks the layer from any existing links.

Copied to your clipboard
// detach layer from any existing links
await layer.unlink()

async

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2026 Adobe. All rights reserved.