# FSlide

- Human documentation: [https://docs.univer.ai/reference/facade/slide](https://docs.univer.ai/reference/facade/slide)

- Agent Markdown: [https://docs.univer.ai/reference/facade/slide.md](https://docs.univer.ai/reference/facade/slide.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [facade/slide.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/facade/slide.mdx)

---

The facade class for a slide page.

## Access

Access through:

* [`FUniver.getSlideCommandTarget()`](https://docs.univer.ai/reference/facade/univer.md#getslidecommandtarget)
* [`FPresentation.getSlides()`](https://docs.univer.ai/reference/facade/presentation.md#getslides)
* [`FPresentation.getSlideById()`](https://docs.univer.ai/reference/facade/presentation.md#getslidebyid)
* [`FPresentation.getSlideByIndex()`](https://docs.univer.ai/reference/facade/presentation.md#getslidebyindex)
* [`FPresentation.getActiveSlide()`](https://docs.univer.ai/reference/facade/presentation.md#getactiveslide)
* [`FPresentation.appendSlide()`](https://docs.univer.ai/reference/facade/presentation.md#appendslide)
* [`FPresentation.insertSlide()`](https://docs.univer.ai/reference/facade/presentation.md#insertslide)

## Setup

Register [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) or a preset that includes it. In plugin mode, import `@univerjs-pro/slides/facade`. Additional methods below require their listed plugin packages. See [Facade setup](https://docs.univer.ai/guides/slides/getting-started/facade.md).

## `@univerjs-pro/slides`

### `FSlide.deleteElement`

Removes a page element from this slide.

```typescript
deleteElement(element: FSlidePageElement): boolean
```

**Parameters**

* `element` — Required. The element to remove.

**Returns**

Whether the element was removed successfully.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const element = fSlide.getElements()[0]
if (element) {
  fSlide.deleteElement(element)
}
```

**Types:** [`FSlidePageElement`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getBackground`

Get this slide's explicit background.

```typescript
getBackground(): ISlideBackgroundData | undefined
```

**Returns**

The explicit background.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getBackground())
```

**Types:** [`ISlideBackgroundData`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/slide.type.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getData`

Get the raw slide data.

```typescript
getData(): ISlidePage
```

**Returns**

The slide page data.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getData())
```

**Types:** [`ISlidePage`](https://docs.univer.ai/reference/types/slide-page.md)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getElementById`

Returns a page element by element id.

```typescript
getElementById(id: string): FSlidePageElement | null
```

**Parameters**

* `id` — Required. The element id.

**Returns**

The page element, or `null` when it does not exist.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
const element = fSlide.getElementById('shape-1')
console.log(element)
```

**Types:** [`FSlidePageElement`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getElementPermission`

Returns the permission facade for one element on this Slide.

```typescript
getElementPermission(elementId: string): FSlideObjectPermission
```

**Parameters**

* `elementId` — Required. Stable element id.

**Returns**

Permission facade combining Presentation, Slide, and Element Edit points.

**Examples**

```ts
const slide = univerAPI.getActivePresentation()?.getSlideByIndex(0)
if (!slide) throw new Error('Slide not found.')
const element = slide.getElements()[0]
if (!element) throw new Error('Slide element not found.')
await slide.getElementPermission(element.getId()).setReadOnly()
```

**Types:** [`FSlideObjectPermission`](https://docs.univer.ai/reference/facade/slide-object-permission.md)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getElements`

Returns all page elements on this slide.

```typescript
getElements(): FSlidePageElement[]
```

**Returns**

All page elements in element order.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getElements())
```

**Types:** [`FSlidePageElement`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getGroups`

Returns all group elements on this slide.

```typescript
getGroups(): FGroup[]
```

**Returns**

The groups on this slide.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getGroups())
```

**Types:** [`FGroup`](https://docs.univer.ai/reference/facade/group.md)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getId`

Get the slide id.

```typescript
getId(): string
```

**Returns**

The slide id.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
if (!fPresentation) throw new Error('No active presentation.')
const fSlide = fPresentation.getSlideByIndex(0)
if (!fSlide) throw new Error('Slide not found.')
console.log(fSlide.getId())
```

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getImages`

Returns all images on this slide.

```typescript
getImages(): FImage[]
```

**Returns**

The images on this slide.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getImages())
```

**Types:** [`FImage`](https://docs.univer.ai/reference/facade/image.md)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getName`

Get the slide name.

```typescript
getName(): string
```

**Returns**

The slide name.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getName())
```

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getPageLayout`

Returns this page's model-space size and ordered element bounds.

This model-only query does not include viewport, screen, scroll, or zoom
coordinates and does not require a UI or render plugin.

```typescript
getPageLayout(): ISlideFacadePageLayout
```

**Returns**

Page size and element bounds in Slide model coordinates.

**Examples**

```ts
const presentation = univerAPI.getActivePresentation()
const slide = presentation?.getSlideByIndex(0)
console.log(slide?.getPageLayout())
```

**Types:** [`ISlideFacadePageLayout`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getPageSize`

Get this slide's page size, falling back to the presentation default.

```typescript
getPageSize(): ISlidePageSize
```

**Returns**

The resolved page size.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getPageSize())
```

**Types:** [`ISlidePageSize`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/slide.type.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getPermission`

Returns the Slide page permission facade.

```typescript
getPermission(): FSlideObjectPermission
```

**Returns**

Permission facade combining Presentation and Slide page Edit points.

**Examples**

```ts
const slide = univerAPI.getActivePresentation()?.getSlideByIndex(0)
if (!slide) throw new Error('Slide not found.')
await slide.getPermission().setReadOnly()
```

**Types:** [`FSlideObjectPermission`](https://docs.univer.ai/reference/facade/slide-object-permission.md)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getShape`

Returns a shape by id.

```typescript
getShape(id: string): FShape | FConnectorShape | null
```

**Parameters**

* `id` — Required. The shape id.

**Returns**

The Shape facade, or `null` when it does not exist.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
const fShape = fSlide.getShape('shape-1')
console.log(fShape)
```

**Types:** [`FShape`](https://docs.univer.ai/reference/facade/shape.md) · [`FConnectorShape`](https://docs.univer.ai/reference/facade/connector-shape.md)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getShapes`

Returns all shapes on this slide.

```typescript
getShapes(): Array<FShape | FConnectorShape>
```

**Returns**

The Shape facades on this slide.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
const fShapes = fSlide.getShapes()
console.log(fShapes)
```

**Types:** [`FShape`](https://docs.univer.ai/reference/facade/shape.md) · [`FConnectorShape`](https://docs.univer.ai/reference/facade/connector-shape.md) · [`Array`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getSlide`

Get the underlying slide page model.

```typescript
getSlide(): SlidePage
```

**Returns**

The slide page model.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getSlide())
```

**Types:** [`SlidePage`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/models/slide-page.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getSpeakerNotes`

Get this slide's speaker notes.

```typescript
getSpeakerNotes(): string | undefined
```

**Returns**

The speaker notes, or `undefined` if none are set.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getSpeakerNotes())
```

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getTransition`

Get the transition used when entering this slide during playback.

```typescript
getTransition(): ISlideTransition | undefined
```

**Returns**

The resolved slide transition, or `undefined` if there is no transition.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getTransition())
```

**Types:** [`ISlideTransition`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/slide.type.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.group`

Group two or more slide elements.

```typescript
group(elements: FSlidePageElement[]): FGroup
```

**Parameters**

* `elements` — Required. The elements to group.

**Returns**

The created group.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const element1 = fSlide.getElements()[0]
const element2 = fSlide.getElements()[1]
if (element1 && element2) {
  const group = fSlide.group([element1, element2])
  console.log(group)
}
```

**Types:** [`FGroup`](https://docs.univer.ai/reference/facade/group.md) · [`FSlidePageElement`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.insertElement`

Adds a page element to this slide.

```typescript
insertElement(element: ISlidePageElement, index?: number): FSlidePageElement
```

**Parameters**

* `element` — Required. The slide element data.
* `index` — Optional. The insert index in the element order.

**Returns**

The inserted element.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const shapeElement = fSlide.insertElement(element)
console.log(shapeElement)
```

**Types:** [`FSlidePageElement`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts) · [`ISlidePageElement`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/slide.type.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.insertImage`

Adds an image to this slide.

```typescript
insertImage(imageBuilderInfo: ISlideImageBuilderInfo, index?: number): FImage
```

**Parameters**

* `imageBuilderInfo` — Required. The image builder info returned by `FImageBuilder.build()`.
* `index` — Optional. The insert index in the element order.

**Returns**

The inserted image.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const imageInfo = fSlide
  .newImage()
  .setSource('https://example.com/image.png', univerAPI.Enum.ImageSourceType.URL)
  .setAbsolutePosition(80, 120)
  .setSize(320, 180)
  .setRotation(15)
  .setCrop({
    left: 10,
    top: 10,
    right: 10,
    bottom: 10,
  })
  .setClipShape(univerAPI.Enum.ShapeTypeEnum.RoundRect, { adj1: 5000 })
  .build()
fSlide.insertImage(imageInfo)
```

**Types:** [`FImage`](https://docs.univer.ai/reference/facade/image.md) · [`ISlideImageBuilderInfo`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-image.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.insertImageAsync`

Insert an image from a string source or blob source.

```typescript
insertImageAsync(source: string | IFBlobSource, options?: ISlideImageInsertOptions): Promise<FImage>
```

**Parameters**

* `source` — Required. The image source or blob source.
* `options` — Optional. Default: `{}`. Image insertion options.

**Returns**

The inserted image.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

// Insert an image from a URL.
await fSlide.insertImageAsync('https://example.com/image.png', {
  imageSourceType: univerAPI.Enum.ImageSourceType.URL,
  left: 80,
  top: 120,
  width: 320,
  height: 180,
  rotation: 15,
  crop: {
    left: 10,
    top: 10,
    right: 10,
    bottom: 10,
  },
  prstGeom: univerAPI.Enum.ShapeTypeEnum.RoundRect,
  adjustValues: { adj1: 5000 },
})

// Insert an image from a blob source.
const blobSource = createBlobSourceFromFile(fileInput.files[0])
await fSlide.insertImageAsync(blobSource, {
  imageSourceType: univerAPI.Enum.ImageSourceType.BASE64,
  left: 80,
  top: 120,
  width: 320,
  height: 180,
})
```

**Types:** [`FImage`](https://docs.univer.ai/reference/facade/image.md) · [`Promise`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts) · [`IFBlobSource`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/facade/f-blob.d.ts) · [`ISlideImageInsertOptions`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.insertShape`

Adds a shape to this slide.

```typescript
insertShape(input: IShapeCreateInput): FShape | FConnectorShape | null
```

**Parameters**

* `input` — Required. The common Shape creation input.

**Returns**

The inserted Shape facade, or `null` when creation fails.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const fShape = fSlide.insertShape({
  shapeType: univerAPI.Enum.ShapeTypeEnum.RoundRect,
  transform: { left: 100, top: 120, width: 240, height: 120 },
  visible: true,
  selectable: true,
  shapeData: {
    fill: { fillType: univerAPI.Enum.ShapeFillEnum.SolidFill, color: '#fef3c7' },
    stroke: {
      lineStrokeType: univerAPI.Enum.ShapeLineTypeEnum.SolidLine,
      color: '#d97706',
      width: 2,
    },
  },
})
if (!fShape) throw new Error('Shape could not be inserted.')
fShape.setRotation(-6).setStrokeLineJoinType(univerAPI.Enum.ShapeLineJoinEnum.Round)
const richText = univerAPI
  .newRichText()
  .text('Open ')
  .link('the project brief', 'https://example.com/project-brief')
fShape
  .getText()
  .setRichText(richText)
  .setHorizontalAlign(univerAPI.Enum.HorizontalAlign.CENTER)
  .setVerticalAlign(univerAPI.Enum.VerticalAlign.MIDDLE)
```

**Types:** [`FShape`](https://docs.univer.ai/reference/facade/shape.md) · [`FConnectorShape`](https://docs.univer.ai/reference/facade/connector-shape.md) · [`IShapeCreateInput`](https://unpkg.com/@univerjs-pro/engine-shape@1.0.0-rc.0/lib/types/services/shape-host-adapter.service.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.insertSmartArt`

Inserts an editable SmartArt composite using one of the built-in layout IDs.
All model writes are delegated to the Slide Shape host adapter command path.

```typescript
insertSmartArt(layoutId: string, transform?: IShapeCreateInput['transform']): FShape | FConnectorShape | null
```

**Parameters**

* `layoutId` — Required. The built-in SmartArt layout id.
* `transform` — Optional. The optional position, size, rotation, and flip overrides.

**Returns**

The SmartArt Shape facade, or `null` when the layout or host is unavailable.

**Examples**

Slide — executable with `univer execute`

```ts
const presentation = univerAPI.getActivePresentation()
const slide = presentation?.getActiveSlide()
if (!slide) throw new Error('No active slide')
const smartArt = slide.insertSmartArt(
  'urn:microsoft.com/office/officeart/2005/8/layout/orgChart1',
  { left: 120, top: 90, width: 720, height: 360 },
)
if (!smartArt) throw new Error('Cannot insert SmartArt')
console.log(smartArt.getSmartArtData()?.layout.id)
```

**Types:** [`FShape`](https://docs.univer.ai/reference/facade/shape.md) · [`FConnectorShape`](https://docs.univer.ai/reference/facade/connector-shape.md) · [`IShapeCreateInput`](https://unpkg.com/@univerjs-pro/engine-shape@1.0.0-rc.0/lib/types/services/shape-host-adapter.service.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.newImage`

Returns a builder to create a new image for this slide. The builder will not automatically upload or choose an image.

```typescript
newImage(existing?: FImage | string): FImageBuilder
```

**Parameters**

* `existing` — Optional. An existing image to initialize the builder with for updating or a string element id to create a new image with that id. Omit to create a new image with an auto-generated id.

**Returns**

A new image builder.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const imageInfo = fSlide
  .newImage()
  .setSource('https://example.com/image.png', univerAPI.Enum.ImageSourceType.URL)
  .setAbsolutePosition(80, 120)
  .setSize(320, 180)
  .setRotation(15)
  .setCrop({
    left: 10,
    top: 10,
    right: 10,
    bottom: 10,
  })
  .setClipShape(univerAPI.Enum.ShapeTypeEnum.RoundRect, { adj1: 5000 })
  .build()
fSlide.insertImage(imageInfo)
```

**Types:** [`FImageBuilder`](https://docs.univer.ai/reference/facade/image-builder.md) · [`FImage`](https://docs.univer.ai/reference/facade/image.md)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.removeImage`

Removes an image from this slide.

```typescript
removeImage(image: FImage): boolean
```

**Parameters**

* `image` — Required. The image or image element id to remove.

**Returns**

Whether the image was removed successfully.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const image = fSlide.getImages()[0]
if (image) {
  fSlide.removeImage(image)
}
```

**Types:** [`FImage`](https://docs.univer.ai/reference/facade/image.md)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.setBackground`

Set this slide's explicit background.

```typescript
setBackground(background?: ISlideBackgroundData): this
```

**Parameters**

* `background` — Optional. The slide background. Omit to clear it.

**Returns**

This slide, for chaining.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

// Set a solid background color on this slide.
fSlide.setBackground({
  type: univerAPI.Enum.SlideBackgroundTypeEnum.Solid,
  color: '#4f90ff',
})

// Set a gradient background on this slide.
fSlide.setBackground({
  type: univerAPI.Enum.SlideBackgroundTypeEnum.Gradient,
  angle: 45,
  stops: [
    {
      color: '#4f90ff',
      position: 0,
    },
    {
      color: '#ffffff',
      position: 1,
    },
  ],
})

// Set an image background on this slide.
fSlide.setBackground({
  type: univerAPI.Enum.SlideBackgroundTypeEnum.Image,
  source: 'https://example.com/image.png',
  imageSourceType: univerAPI.Enum.ImageSourceType.URL,
  fit: univerAPI.Enum.SlidePresentationBackgroundGraphicFitEnum.Cover,
})

// Set a pattern background on this slide.
fSlide.setBackground({
  type: univerAPI.Enum.SlideBackgroundTypeEnum.Pattern,
  pattern: 'diagonal',
  foregroundColor: '#4f90ff',
  backgroundColor: '#ffffff',
})
```

**Types:** [`ISlideBackgroundData`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/slide.type.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.setPageSize`

Set this slide's page size.

```typescript
setPageSize(pageSize: Partial<ISlidePageSize>): this
```

**Parameters**

* `pageSize` — Required. The new slide page size.

**Returns**

This slide, for chaining.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
fSlide.setPageSize({
  width: 1280,
  preset: univerAPI.Enum.SlidePageSizePresetEnum.WideScreen16By9,
})
```

**Types:** [`Partial`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts) · [`ISlidePageSize`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/slide.type.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.setShowMasterBackground`

Set whether this slide shows inherited master shapes and background graphics.

```typescript
setShowMasterBackground(show: boolean): this
```

**Parameters**

* `show` — Required. Whether inherited master background content is shown.

**Returns**

This slide, for chaining.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
fSlide.setShowMasterBackground(false)
```

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.setSpeakerNotes`

Set or clear this slide's speaker notes.

```typescript
setSpeakerNotes(speakerNotes?: string): this
```

**Parameters**

* `speakerNotes` — Optional. The speaker notes. Pass an empty string or omit the argument to clear them.

**Returns**

This slide, for chaining.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

fSlide.setSpeakerNotes('Review Q2 revenue')
console.log(fSlide.getSpeakerNotes()) // 'Review Q2 revenue'

fSlide.setSpeakerNotes()
console.log(fSlide.getSpeakerNotes()) // undefined
```

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.setTransition`

Set the transition used when entering this slide during playback.

For example, setting a transition on slide 2 is visible when playback moves from slide 1
to slide 2. Setting a transition on the current slide is not visible when moving to the
next slide unless the next slide has its own transition.

```typescript
setTransition(transition?: ISlideTransition): this
```

**Parameters**

* `transition` — Optional. The slide transition to set. Omit to clear the slide's explicit transition.

**Returns**

This slide, for chaining.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
fSlide.setTransition({
  type: univerAPI.Enum.SlideTransitionTypeEnum.Push,
  duration: 1000,
  direction: univerAPI.Enum.SlideTransitionDirectionEnum.Right,
})
```

**Types:** [`ISlideTransition`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/slide.type.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.ungroup`

Ungroup a slide group.

```typescript
ungroup(group: FGroup): FSlidePageElement[]
```

**Parameters**

* `group` — Required. The group facade or group id to ungroup.

**Returns**

The released child elements.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const group = fSlide.getGroups()[0]
if (group) {
  const releasedElements = fSlide.ungroup(group)
  console.log(releasedElements)
}
```

**Types:** [`FSlidePageElement`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts) · [`FGroup`](https://docs.univer.ai/reference/facade/group.md)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.updateImage`

Updates an existing image on this slide.

```typescript
updateImage(imageBuilderInfo: ISlideImageBuilderInfo): FImage
```

**Parameters**

* `imageBuilderInfo` — Required. The image builder info returned by `FImageBuilder.build()`.

**Returns**

The updated image.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const image = fSlide.getImages()[0]
if (image) {
  const imageInfo = image.toBuilder().setSize(480, 300).build()
  fSlide.updateImage(imageInfo)
}
```

**Types:** [`FImage`](https://docs.univer.ai/reference/facade/image.md) · [`ISlideImageBuilderInfo`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-image.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

## `@univerjs-pro/slides-chart`

### `FSlide.getChart`

```typescript
getChart(chartIdOrElementId: string): FSlideChart | null
```

**Parameters**

* `chartIdOrElementId` — Required.

**Types:** [`FSlideChart`](https://docs.univer.ai/reference/facade/slide-chart.md)

**Package:** [`@univerjs-pro/slides-chart`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-chart.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-chart@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getCharts`

```typescript
getCharts(): FSlideChart[]
```

**Types:** [`FSlideChart`](https://docs.univer.ai/reference/facade/slide-chart.md)

**Package:** [`@univerjs-pro/slides-chart`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-chart.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-chart@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.insertChart`

```typescript
insertChart(info: ISlideChartInfo): Promise<FSlideChart>
```

**Parameters**

* `info` — Required.

**Types:** [`FSlideChart`](https://docs.univer.ai/reference/facade/slide-chart.md) · [`Promise`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts) · [`ISlideChartInfo`](https://unpkg.com/@univerjs-pro/slides-chart@1.0.0-rc.0/lib/types/chart-builder/types.d.ts)

**Package:** [`@univerjs-pro/slides-chart`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-chart.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-chart@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.newChart`

```typescript
newChart<T extends ChartTypeString>(type: T): FSlideChartBuilderOf<T>
```

**Parameters**

* `type` — Required.

**Types:** [`FSlideChartBuilderOf`](https://unpkg.com/@univerjs-pro/slides-chart@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

**Package:** [`@univerjs-pro/slides-chart`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-chart.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-chart@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

## `@univerjs-pro/slides-table`

### `FSlide.getTableAt`

Return a slide table by its order on the slide.

```typescript
getTableAt(index: number): FSlideTable | null
```

**Parameters**

* `index` — Required. The zero-based table index.

**Returns**

The table facade, or `null` when the index is out of range.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
const firstTable = fSlide.getTableAt(0)
console.log(firstTable)
```

**Types:** [`FSlideTable`](https://docs.univer.ai/reference/facade/slide-table.md)

**Package:** [`@univerjs-pro/slides-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getTableById`

Return a slide table by table resource id or element id.

```typescript
getTableById(tableIdOrElementId: string): FSlideTable | null
```

**Parameters**

* `tableIdOrElementId` — Required. The table resource id or table element id.

**Returns**

The table facade, or `null` when it does not exist.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
const table = fSlide.getTableById('status-table')
console.log(table)
```

**Types:** [`FSlideTable`](https://docs.univer.ai/reference/facade/slide-table.md)

**Package:** [`@univerjs-pro/slides-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getTables`

Return all slide tables on this slide.

```typescript
getTables(): FSlideTable[]
```

**Returns**

All table facades in element order.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)
console.log(fSlide.getTables())
```

**Types:** [`FSlideTable`](https://docs.univer.ai/reference/facade/slide-table.md)

**Package:** [`@univerjs-pro/slides-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.insertTable`

Insert a table from builder info.

```typescript
insertTable(tableInfo: ISlideTableBuilderInfo, index?: number): FSlideTable | null
```

**Parameters**

* `tableInfo` — Required. The table builder info.
* `index` — Optional. The slide element insert index.

**Returns**

The inserted table facade, or `null` if the insert failed.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const tableInfo = fSlide.newTable().setRows(3).setColumns(4).build()
fSlide.insertTable(tableInfo)
```

**Types:** [`FSlideTable`](https://docs.univer.ai/reference/facade/slide-table.md) · [`ISlideTableBuilderInfo`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/facade/f-slide-table-builder.d.ts)

**Package:** [`@univerjs-pro/slides-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.insertTableFromData`

Insert a table and fill it with plain text data.

```typescript
insertTableFromData(values: string[][], options?: ICreateSlideTableOptions): FSlideTable | null
```

**Parameters**

* `values` — Required. Two-dimensional plain text values.
* `options` — Optional. Optional ids, layout, and style settings.

**Returns**

The inserted table facade, or `null` if the insert failed.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const table = fSlide.insertTableFromData(
  [
    ['Name', 'Status'],
    ['Facade', 'Ready'],
  ],
  {
    tableId: 'status-table',
  },
)
console.log(table)
```

**Types:** [`FSlideTable`](https://docs.univer.ai/reference/facade/slide-table.md) · [`ICreateSlideTableOptions`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/services/slide-table-resource.service.d.ts)

**Package:** [`@univerjs-pro/slides-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.newTable`

Return a builder for a new slide table.

```typescript
newTable(existing?: FSlideTable | string): FSlideTableBuilder
```

**Parameters**

* `existing` — Optional. An existing table facade or table resource/element id to initialize the builder with for updating. If not specified, the builder will create a new table.

**Returns**

A table builder.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const tableInfo = fSlide
  .newTable()
  .setValues([
    ['Name', 'Owner', 'Status'],
    ['Facade', 'API', 'Ready'],
  ])
  .build()
fSlide.insertTable(tableInfo)
```

**Types:** [`FSlideTableBuilder`](https://docs.univer.ai/reference/facade/slide-table-builder.md) · [`FSlideTable`](https://docs.univer.ai/reference/facade/slide-table.md)

**Package:** [`@univerjs-pro/slides-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.removeTable`

Remove a slide table by facade, table id, or element id.

```typescript
removeTable(table: FSlideTable): boolean
```

**Parameters**

* `table` — Required. The table to remove.

**Returns**

Whether the command succeeded.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const table = fSlide.getTableById('status-table')
if (table) {
  fSlide.removeTable(table)
}
```

**Types:** [`FSlideTable`](https://docs.univer.ai/reference/facade/slide-table.md)

**Package:** [`@univerjs-pro/slides-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.updateTable`

Update a slide table by builder info.

```typescript
updateTable(tableInfo: ISlideTableBuilderInfo): FSlideTable
```

**Parameters**

* `tableInfo` — Required. The table builder info with updated properties. The `table.id` and `element.id` must be provided to identify which table to update.

**Returns**

The updated table facade.

**Examples**

```ts
const fPresentation = univerAPI.getActivePresentation()
const fSlide = fPresentation.getSlideByIndex(0)

const table = fSlide.getTableById('status-table')
const tableInfo = table
  .toBuilder()
  .setValues([
    ['Quarter', 'Owner', 'Status'],
    ['Q1', 'Sales', 'Done'],
  ])
  .setRows(3)
  .setColumns(4)
  .setColumnWidth(105)
  .setRowHeight(60)
  .setAbsolutePosition(80, 120)
  .setSize(420, 180)
  .build()
fSlide.updateTable(tableInfo)
```

**Types:** [`FSlideTable`](https://docs.univer.ai/reference/facade/slide-table.md) · [`ISlideTableBuilderInfo`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/facade/f-slide-table-builder.d.ts)

**Package:** [`@univerjs-pro/slides-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

## `@univerjs-pro/slides-thread-comment`

### `FSlide.createElementCommentAsync`

Creates a comment for any slide element ID, including shapes, text, images, charts, tables, and groups.

```typescript
createElementCommentAsync(elementId: string, content: ThreadComment.ThreadCommentContent, options?: ISlideCommentCreateOptions): Promise<boolean>
```

**Parameters**

* `elementId` — Required. Stable ID returned by the target element Facade, such as `getId()` or `getElementId()`.
* `content` — Required. Plain text or a Univer document body for rich comment content.
* `options` — Optional. Default: `{}`. Optional stable IDs, author, attachments, and creation time.

**Returns**

`true` when the create command succeeds; otherwise, `false`.

**Throws**

If the element does not exist on this slide.

If the content is empty.

**Examples**

```ts
const slide = univerAPI.getActivePresentation()?.getSlideByIndex(0)
const chart = slide?.getCharts()[0]
if (chart) await slide?.createElementCommentAsync(chart.getElementId(), 'Verify the chart source.')
```

**Types:** [`Promise`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts) · [`ThreadComment.ThreadCommentContent`](https://unpkg.com/@univerjs/thread-comment@1.0.0-rc.0/lib/types/services/thread-comment-api.service.d.ts) · [`ISlideCommentCreateOptions`](https://unpkg.com/@univerjs-pro/slides-thread-comment@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

**Package:** [`@univerjs-pro/slides-thread-comment`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-thread-comment.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-thread-comment@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.createPositionCommentAsync`

Creates a free-position comment. Coordinates are normalized to the slide size.

```typescript
createPositionCommentAsync(position: ISlideCommentPosition, content: ThreadComment.ThreadCommentContent, options?: ISlideCommentCreateOptions): Promise<boolean>
```

**Parameters**

* `position` — Required. Normalized position where `(0, 0)` is the top-left and `(1, 1)` is the bottom-right.
* `content` — Required. Plain text or a Univer document body for rich comment content.
* `options` — Optional. Default: `{}`. Optional stable IDs, author, attachments, and creation time.

**Returns**

`true` when the create command succeeds; otherwise, `false`.

**Throws**

If either coordinate is not finite or is outside the inclusive range from 0 to 1.

If the content is empty.

**Examples**

```ts
const slide = univerAPI.getActivePresentation()?.getSlideByIndex(0)
await slide?.createPositionCommentAsync({ x: 0.5, y: 0.25 }, 'Check this area.')
```

**Types:** [`Promise`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts) · [`ISlideCommentPosition`](https://unpkg.com/@univerjs-pro/slides-thread-comment@1.0.0-rc.0/lib/types/facade/f-slide.d.ts) · [`ThreadComment.ThreadCommentContent`](https://unpkg.com/@univerjs/thread-comment@1.0.0-rc.0/lib/types/services/thread-comment-api.service.d.ts) · [`ISlideCommentCreateOptions`](https://unpkg.com/@univerjs-pro/slides-thread-comment@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

**Package:** [`@univerjs-pro/slides-thread-comment`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-thread-comment.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-thread-comment@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getComments`

Returns locally loaded element and free-position comments on this slide.

```typescript
getComments(): ThreadComment.IFacadeThreadCommentInfo[]
```

**Returns**

Every locally loaded comment thread anchored to this slide.

**Examples**

```ts
const comments = univerAPI.getActivePresentation()?.getSlideByIndex(0)?.getComments() ?? []
comments.forEach(({ root, anchor }) => console.log(root.id, anchor))
```

**Types:** [`ThreadComment.IFacadeThreadCommentInfo`](https://unpkg.com/@univerjs/thread-comment@1.0.0-rc.0/lib/types/services/thread-comment-api.service.d.ts)

**Package:** [`@univerjs-pro/slides-thread-comment`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-thread-comment.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-thread-comment@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.getElementComments`

Returns locally loaded comments for one stable slide element ID.

```typescript
getElementComments(elementId: string): ThreadComment.IFacadeThreadCommentInfo[]
```

**Parameters**

* `elementId` — Required. Stable ID of the target slide element.

**Returns**

Matching comment threads for this slide and element.

**Examples**

```ts
const slide = univerAPI.getActivePresentation()?.getSlideByIndex(0)
const element = slide?.getElements()[0]
const comments = element ? (slide?.getElementComments(element.getId()) ?? []) : []
console.log(comments.length)
```

**Types:** [`ThreadComment.IFacadeThreadCommentInfo`](https://unpkg.com/@univerjs/thread-comment@1.0.0-rc.0/lib/types/services/thread-comment-api.service.d.ts)

**Package:** [`@univerjs-pro/slides-thread-comment`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-thread-comment.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-thread-comment@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.listCommentsAsync`

Synchronizes known threads and returns element and free-position comments on this slide.

```typescript
listCommentsAsync(): Promise<ThreadComment.IFacadeThreadCommentInfo[]>
```

**Returns**

A promise resolving to every synchronized comment thread anchored to this slide.

**Examples**

```ts
const slide = univerAPI.getActivePresentation()?.getSlideByIndex(0)
const comments = slide ? await slide.listCommentsAsync() : []
console.log(comments.length)
```

**Types:** [`ThreadComment.IFacadeThreadCommentInfo`](https://unpkg.com/@univerjs/thread-comment@1.0.0-rc.0/lib/types/services/thread-comment-api.service.d.ts) · [`Promise`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts)

**Package:** [`@univerjs-pro/slides-thread-comment`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-thread-comment.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-thread-comment@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)

### `FSlide.listElementCommentsAsync`

Synchronizes known threads and returns comments for one stable slide element ID.

```typescript
listElementCommentsAsync(elementId: string): Promise<ThreadComment.IFacadeThreadCommentInfo[]>
```

**Parameters**

* `elementId` — Required. Stable ID of the target slide element.

**Returns**

A promise resolving to matching synchronized comment threads.

**Examples**

```ts
const slide = univerAPI.getActivePresentation()?.getSlideByIndex(0)
const element = slide?.getElements()[0]
const comments = element ? await slide.listElementCommentsAsync(element.getId()) : []
console.log(comments.length)
```

**Types:** [`ThreadComment.IFacadeThreadCommentInfo`](https://unpkg.com/@univerjs/thread-comment@1.0.0-rc.0/lib/types/services/thread-comment-api.service.d.ts) · [`Promise`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts)

**Package:** [`@univerjs-pro/slides-thread-comment`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides-thread-comment.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides-thread-comment@1.0.0-rc.0/lib/types/facade/f-slide.d.ts)
