@squareys/webdecks-sdk - v0.0.0
    Preparing search index...

    Class Paragraph

    A paragraph of the document, addressed by its index in the body. Cheap state is exposed as property getters read straight from the engine; navigation returns cached wrappers; the authoring mutators chain.

    Hierarchy (View Summary)

    Index
    • get isValid(): boolean

      Whether this wrapper still refers to a live engine object.

      Returns boolean

    • set _index(value: number): void

      Parameters

      • value: number

      Returns void

    • get textLength(): number

      UTF-8 byte length of the paragraph's flat text.

      Returns number

    • get alignment(): number

      Horizontal alignment (see Alignment).

      Returns number

    • get style(): number

      Paragraph style ordinal (see ParagraphStyle).

      Returns number

    • get indentLevel(): number

      Discrete list/indent level.

      Returns number

    • get spacingBefore(): number

      Space above the paragraph, in pixels at 96dpi.

      Returns number

    • get spacingAfter(): number

      Space below the paragraph, in pixels at 96dpi.

      Returns number

    • get runCount(): number

      Number of formatting runs in the paragraph.

      Returns number

    • get text(): string

      The paragraph's text as a string.

      Returns string

      Allocates a string; prefer Paragraph.getText with a buffer in hot loops.

    • get runs(): Run[]

      The paragraph's runs.

      Returns Run[]

      Allocates an array; pass a reusable one to avoid it.

    • Reference equality is the identity test — prefer a === b. This is retained only for the rare cross-realm case where two wrappers describe the same handle by value. Reads the raw index so comparing a stale wrapper never throws.

      Parameters

      • other: Handle<unknown> | null

      Returns boolean

    • A readable identity for logs and diagnostics, never [object Object].

      Returns string

    • Read the paragraph text: with no argument, returns a string; with a buffer, fills it with UTF-8 and returns the full byte length (which may exceed the buffer).

      Returns string

    • Read the paragraph text: with no argument, returns a string; with a buffer, fills it with UTF-8 and returns the full byte length (which may exceed the buffer).

      Parameters

      Returns number

    • The index-th run, or null if out of range.

      Parameters

      • index: number

      Returns Run | null

    • The run covering byte offset byteOffset (its formatting is the formatting at that byte). Returns null for an out-of-range offset.

      Parameters

      • byteOffset: number

      Returns Run | null

    • Collect the paragraph's runs into out (or a fresh array).

      Parameters

      • out: Run[] = []

      Returns Run[]

    • Set this paragraph's style, scoping the caret to it first (see ParagraphStyle).

      Parameters

      • style: number

      Returns this

    • Select the whole paragraph.

      Returns this

    • Set paragraph spacing: space before/after in pixels, and a line-height multiple.

      Parameters

      • before: number
      • after: number
      • lineMultiple: number

      Returns this

    • Set paragraph indents in pixels: left, right, and first-line (relative to left).

      Parameters

      • left: number
      • right: number
      • firstLine: number

      Returns this

    • Set the keep-together / keep-with-next flags (a bitmask).

      Parameters

      • keepMask: number

      Returns this

    • Set paragraph borders on the given edges.

      Parameters

      • edgeMask: number
      • color: number
      • width: number
      • style: number
      • shade: number

      Returns this

    • Force (or clear) a page break before this paragraph.

      Parameters

      • on: boolean

      Returns this

    • Set the list style (a paragraph style + list-style ordinal).

      Parameters

      • style: number
      • listStyle: number

      Returns this

    • Set the list level and its starting number.

      Parameters

      • level: number
      • start: number

      Returns this

    • Add a tab stop at position pixels with the given alignment and leader style.

      Parameters

      • position: number
      • alignment: number
      • leader: number

      Returns this

    • Add a hyperlink over the byte range [start, end); returns its id.

      Parameters

      • start: number
      • end: number
      • url: string

      Returns number

    • Add a bookmark over the byte range [start, end); returns its id.

      Parameters

      • start: number
      • end: number
      • name: string

      Returns number

    • Attach an image-wrap mode to this (image) paragraph.

      Parameters

      • wrap: number

      Returns this

    • Float this (image) paragraph at the given position and size, in pixels.

      Parameters

      • x: number
      • y: number
      • width: number
      • height: number

      Returns this