@pixerate/editor 0.191.0 → 0.192.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -280,6 +280,16 @@ export interface ShapeLayerInfo {
280
280
  annotationId?: string;
281
281
  }
282
282
  /** A new type layer: its text, where it goes, and its character and paragraph style. */
283
+ /** A Type Mask: text laid out like `TextLayerInit` (no layer is made), selected by `mode`. */
284
+ export interface TypeMaskInit extends Omit<TextLayerInit, keyof LayerPlacement | 'name' | 'opacity' | 'blend'> {
285
+ /** Horizontal (default) or vertical: the characters stacked top to bottom, centred on `x`. */
286
+ orientation?: 'horizontal' | 'vertical';
287
+ mode?: SelectionMode;
288
+ /** Feather radius in px (default 0). */
289
+ feather?: number;
290
+ /** Soft glyph edges (default true). */
291
+ antiAlias?: boolean;
292
+ }
283
293
  export interface TextLayerInit extends LayerPlacement {
284
294
  text: string;
285
295
  /**
@@ -1804,6 +1814,15 @@ export declare class ImageEditorController {
1804
1814
  * text wrapped in `box`. Refused without a text shaper. Returns its id.
1805
1815
  */
1806
1816
  addTextLayer(init: TextLayerInit): string;
1817
+ /**
1818
+ * Type Mask (horizontal or vertical): a selection in the shape of `text`, laid out and drawn as
1819
+ * `addTextLayer` would place it (font, size, tracking, box, rotation), combined with the current
1820
+ * selection by `mode`. Vertical type stacks the characters top to bottom, centred on `x`. No
1821
+ * layer is added. One undo step. Returns whether anything is selected.
1822
+ */
1823
+ selectTextShape(init: TypeMaskInit): boolean;
1824
+ /** A type layer laid out and drawn from `init` (not added): the shared part of `addTextLayer` and the type masks. */
1825
+ private layoutTypeLayer;
1807
1826
  /**
1808
1827
  * Replaces text [start, end) (default all of it) with `text`; inserted text takes the style at
1809
1828
  * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
@@ -280,6 +280,16 @@ export interface ShapeLayerInfo {
280
280
  annotationId?: string;
281
281
  }
282
282
  /** A new type layer: its text, where it goes, and its character and paragraph style. */
283
+ /** A Type Mask: text laid out like `TextLayerInit` (no layer is made), selected by `mode`. */
284
+ export interface TypeMaskInit extends Omit<TextLayerInit, keyof LayerPlacement | 'name' | 'opacity' | 'blend'> {
285
+ /** Horizontal (default) or vertical: the characters stacked top to bottom, centred on `x`. */
286
+ orientation?: 'horizontal' | 'vertical';
287
+ mode?: SelectionMode;
288
+ /** Feather radius in px (default 0). */
289
+ feather?: number;
290
+ /** Soft glyph edges (default true). */
291
+ antiAlias?: boolean;
292
+ }
283
293
  export interface TextLayerInit extends LayerPlacement {
284
294
  text: string;
285
295
  /**
@@ -1804,6 +1814,15 @@ export declare class ImageEditorController {
1804
1814
  * text wrapped in `box`. Refused without a text shaper. Returns its id.
1805
1815
  */
1806
1816
  addTextLayer(init: TextLayerInit): string;
1817
+ /**
1818
+ * Type Mask (horizontal or vertical): a selection in the shape of `text`, laid out and drawn as
1819
+ * `addTextLayer` would place it (font, size, tracking, box, rotation), combined with the current
1820
+ * selection by `mode`. Vertical type stacks the characters top to bottom, centred on `x`. No
1821
+ * layer is added. One undo step. Returns whether anything is selected.
1822
+ */
1823
+ selectTextShape(init: TypeMaskInit): boolean;
1824
+ /** A type layer laid out and drawn from `init` (not added): the shared part of `addTextLayer` and the type masks. */
1825
+ private layoutTypeLayer;
1807
1826
  /**
1808
1827
  * Replaces text [start, end) (default all of it) with `text`; inserted text takes the style at
1809
1828
  * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.