laymur 0.13.2 → 0.13.4

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.
@@ -1,3 +1,4 @@
1
+ import type { UICanvasRenderingContext2D } from "../../miscellaneous/canvas";
1
2
  import type { UITextSpan } from "../../miscellaneous/text-span/UITextSpan";
2
3
  import { UITextStyle } from "../../miscellaneous/text-style/UITextStyle";
3
4
  import type { UITextStyleConfig } from "../../miscellaneous/text-style/UITextStyle.Internal";
@@ -15,7 +16,7 @@ export declare function splitTextIntoChunks(text: string): string[];
15
16
  * @param textStyle Resolved text style
16
17
  * @returns Chunk metrics
17
18
  */
18
- export declare function measureTextChunk(context: OffscreenCanvasRenderingContext2D, text: string, textStyle: UITextStyleConfig): UIChunkMetrics;
19
+ export declare function measureTextChunk(context: UICanvasRenderingContext2D, text: string, textStyle: UITextStyleConfig): UIChunkMetrics;
19
20
  /**
20
21
  * Builds text lines with word wrapping.
21
22
  * @param maxWidth Maximum line width in pixels
@@ -36,7 +37,7 @@ export declare function calculateTextSize(lines: UITextLine[]): UITextSize;
36
37
  * @param commonStyle Fallback style
37
38
  * @returns Measured text chunks
38
39
  */
39
- export declare function buildTextChunks(context: OffscreenCanvasRenderingContext2D, textSpans: UITextSpan[], commonStyle: UITextStyle): UITextChunk[];
40
+ export declare function buildTextChunks(context: UICanvasRenderingContext2D, textSpans: UITextSpan[], commonStyle: UITextStyle): UITextChunk[];
40
41
  /**
41
42
  * Calculates text layout parameters.
42
43
  * @param textChunks Measured text chunks
@@ -1,3 +1,4 @@
1
+ import type { UICanvasRenderingContext2D } from "../../miscellaneous/canvas";
1
2
  import type { UITextStyleConfig } from "../../miscellaneous/text-style/UITextStyle.Internal";
2
3
  import type { UITextLine } from "./UIText.Interfaces";
3
4
  /**
@@ -8,7 +9,7 @@ import type { UITextLine } from "./UIText.Interfaces";
8
9
  * @param style Resolved text style
9
10
  * @param context Canvas rendering context
10
11
  */
11
- export declare function renderTextChunk(x: number, y: number, text: string, style: UITextStyleConfig, context: OffscreenCanvasRenderingContext2D): void;
12
+ export declare function renderTextChunk(x: number, y: number, text: string, style: UITextStyleConfig, context: UICanvasRenderingContext2D): void;
12
13
  /**
13
14
  * Renders text lines to canvas.
14
15
  * @param paddingTop Top padding in pixels
@@ -16,4 +17,4 @@ export declare function renderTextChunk(x: number, y: number, text: string, styl
16
17
  * @param lines Text lines to render
17
18
  * @param context Canvas rendering context
18
19
  */
19
- export declare function renderTextLines(paddingTop: number, paddingLeft: number, lines: UITextLine[], context: OffscreenCanvasRenderingContext2D): void;
20
+ export declare function renderTextLines(paddingTop: number, paddingLeft: number, lines: UITextLine[], context: UICanvasRenderingContext2D): void;