@onodocs/canvas 0.2.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.
Files changed (50) hide show
  1. package/LICENSE +10 -0
  2. package/LICENSING.md +33 -0
  3. package/README.md +229 -0
  4. package/SDK.md +229 -0
  5. package/index.js +2428 -0
  6. package/package.json +44 -0
  7. package/types/canvas/canvas-axis-aligned-transform.d.ts +12 -0
  8. package/types/canvas/canvas-effect-surface.d.ts +9 -0
  9. package/types/canvas/canvas-materializer.d.ts +9 -0
  10. package/types/canvas/canvas-native-text.d.ts +6 -0
  11. package/types/canvas/canvas-physical-clips.d.ts +4 -0
  12. package/types/canvas/canvas-positioned-text-replay.d.ts +10 -0
  13. package/types/canvas/canvas-raster-replay.d.ts +7 -0
  14. package/types/canvas/canvas-shadow-replay.d.ts +19 -0
  15. package/types/canvas/canvas-soft-edge-replay.d.ts +9 -0
  16. package/types/canvas/canvas-table-border-replay.d.ts +7 -0
  17. package/types/canvas/canvas-target-pixel-alignment.d.ts +9 -0
  18. package/types/canvas/canvas-vector-shape-replay.d.ts +4 -0
  19. package/types/canvas/evaluation-watermark.d.ts +3 -0
  20. package/types/canvas/index.d.ts +30 -0
  21. package/types/canvas/presentation.d.ts +54 -0
  22. package/types/canvas/text-selection.d.ts +7 -0
  23. package/types/canvas/transport.d.ts +5 -0
  24. package/types/foundation/bounded-number-representation-cjk.d.ts +17 -0
  25. package/types/foundation/bounded-number-representation-decimal-roman-latin.d.ts +6 -0
  26. package/types/foundation/bounded-number-representation-hebrew.d.ts +5 -0
  27. package/types/foundation/bounded-number-representation-korean.d.ts +15 -0
  28. package/types/foundation/bounded-number-representation-mechanics.d.ts +17 -0
  29. package/types/foundation/bounded-number-representation-writer-alphabets.d.ts +22 -0
  30. package/types/foundation/bounded-number-representation-writer-tables.d.ts +13 -0
  31. package/types/foundation/bounded-number-representation.d.ts +18 -0
  32. package/types/foundation/browser-text.d.ts +23 -0
  33. package/types/foundation/chart-number-format.d.ts +3 -0
  34. package/types/foundation/device-rounding.d.ts +3 -0
  35. package/types/foundation/font-resources.d.ts +14 -0
  36. package/types/foundation/geometry-path.d.ts +27 -0
  37. package/types/foundation/host-task.d.ts +3 -0
  38. package/types/foundation/image-resources.d.ts +39 -0
  39. package/types/foundation/index.d.ts +17 -0
  40. package/types/foundation/page-interaction.d.ts +90 -0
  41. package/types/foundation/path-bounds.d.ts +10 -0
  42. package/types/foundation/raster-color-effect.d.ts +55 -0
  43. package/types/foundation/raster-source-rectangle.d.ts +8 -0
  44. package/types/foundation/vector-shape-fill.d.ts +34 -0
  45. package/types/foundation/vector-shape-shadow.d.ts +17 -0
  46. package/types/foundation/vector-shape.d.ts +56 -0
  47. package/types/foundation/writer-unmapped-ooxml-number-format.d.ts +6 -0
  48. package/types/render-api/index.d.ts +4 -0
  49. package/types/render-api/page-display-list.d.ts +508 -0
  50. package/types/render-api/page-source.d.ts +23 -0
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@onodocs/canvas",
3
+ "version": "0.2.0",
4
+ "private": false,
5
+ "description": "OnoDocs canvas viewer, selection and HTML attachments for prepared Word document pages.",
6
+ "homepage": "https://onodocs.com/developers/",
7
+ "keywords": [
8
+ "docx",
9
+ "word",
10
+ "document",
11
+ "rendering",
12
+ "onodocs"
13
+ ],
14
+ "license": "SEE LICENSE IN LICENSE",
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "onodocsReleaseDate": "2026-10-07",
19
+ "onodocsEnvironment": "live",
20
+ "type": "module",
21
+ "sideEffects": false,
22
+ "main": "./index.js",
23
+ "types": "./types/canvas/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./types/canvas/index.d.ts",
27
+ "import": "./index.js"
28
+ }
29
+ },
30
+ "dependencies": {},
31
+ "files": [
32
+ "*.js",
33
+ "types",
34
+ "README.md",
35
+ "SDK.md",
36
+ "LICENSING.md",
37
+ "LICENSE"
38
+ ],
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/onodocs/onodocs.git"
42
+ },
43
+ "gitHead": "95967333a361ecd96d5cb764a619c07a8ab2bddf"
44
+ }
@@ -0,0 +1,12 @@
1
+ /** Spec: `spec/pipeline/render/canvas/_index.md#axis-aligned-device-rectangle-projection`. */
2
+ import type { CanvasPaintTarget } from "../render-api/index.js";
3
+ type AxisAlignedTransform = ReturnType<CanvasPaintTarget["getTransform"]>;
4
+ export declare function positiveAxisAlignedTransform(target: CanvasPaintTarget): AxisAlignedTransform | undefined;
5
+ export declare function rectangleForDeviceBounds(transform: AxisAlignedTransform, left: number, top: number, deviceWidth: number, deviceHeight: number): Readonly<{
6
+ readonly x: number;
7
+ readonly y: number;
8
+ readonly width: number;
9
+ readonly height: number;
10
+ }> | undefined;
11
+ export {};
12
+ //# sourceMappingURL=canvas-axis-aligned-transform.d.ts.map
@@ -0,0 +1,9 @@
1
+ /** Spec: pipeline.render.canvas.effect-surfaces */
2
+ import type { CanvasPaintTarget } from "../render-api/index.js";
3
+ interface EffectSurface {
4
+ readonly canvas: HTMLCanvasElement;
5
+ readonly context: CanvasRenderingContext2D;
6
+ }
7
+ export declare function effectSurfaceFor(target: CanvasPaintTarget, width: number, height: number): EffectSurface;
8
+ export {};
9
+ //# sourceMappingURL=canvas-effect-surface.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { type CanvasImageResourceMaterializer, type CanvasPaintTarget, type PageDisplayList } from "../render-api/index.js";
2
+ /**
3
+ * Spec: `spec/pipeline/render/canvas/_index.md#canvas-materialization`; `spec/document/body/section/pagination-and-paint.md#section-local-pagination-and-paint`; `spec/pipeline/render/page-display-list/authored-section-page-identity.md#authored-section-page-identity`.
4
+ * Spec: `spec/document/body/text/paragraph/shading/_index.md#visible-body-paragraph-shading`; `spec/pipeline/render/canvas/paragraph-border-paint-replay.md#mechanical-display-list-and-canvas-replay`; `spec/pipeline/render/page-display-list/positioned-text/authored-bar-tab.md#mechanical-authored-bar-replay`.
5
+ * Spec: `spec/document/body/table/fixed-grid/border/device-replay.md#device-minimum-representation-and-replay`; `spec/pipeline/render/canvas/section-column-separator-device-minimum-replay.md#section-column-separator-device-minimum-replay`.
6
+ * Spec: `spec/pipeline/render/vector-graphics/_index.md`; `spec/pipeline/render/vector-graphics/preset-shape/transport-and-publication.md#direct-preset-shape-display-list-command`.
7
+ */
8
+ export declare function materializePageDisplayListToCanvas(displayList: PageDisplayList, target: CanvasPaintTarget, resources?: CanvasImageResourceMaterializer): void;
9
+ //# sourceMappingURL=canvas-materializer.d.ts.map
@@ -0,0 +1,6 @@
1
+ /** Specs: `spec/pipeline/layout/text/font/browser-native-text-realization.md`; `spec/pipeline/layout/text/font/actual-font-shaped-geometry.md`. */
2
+ /** Spec: `spec/pipeline/render/canvas/_index.md#scratch-raster-reuse`. */
3
+ import type { BrowserTextOperation } from "../foundation/index.js";
4
+ import type { CanvasPaintTarget } from "../render-api/index.js";
5
+ export declare function drawNativeText(target: CanvasPaintTarget, operation: BrowserTextOperation, color: string): void;
6
+ //# sourceMappingURL=canvas-native-text.d.ts.map
@@ -0,0 +1,4 @@
1
+ /** Spec: spec/document/body/drawing/group/wordprocessing-group.md */
2
+ import type { CanvasPaintTarget, PaintPositionedTextCommand } from "../render-api/index.js";
3
+ export declare function replayPhysicalClips(target: CanvasPaintTarget, clips: PaintPositionedTextCommand["physicalClips"]): void;
4
+ //# sourceMappingURL=canvas-physical-clips.d.ts.map
@@ -0,0 +1,10 @@
1
+ /** Spec: pipeline.layout.text.font.browser-native-text-realization */
2
+ /** Spec: document.body.drawing.vml.textboxes */
3
+ import type { CanvasPaintTarget, PaintPositionedTextCommand } from "../render-api/index.js";
4
+ /**
5
+ * Spec: `spec/pipeline/render/canvas/_index.md#mechanical-positioned-glyph-replay`; `spec/pipeline/render/canvas/run-effects.md`; `spec/pipeline/render/canvas/run-shading-replay.md#run-shading-replay`.
6
+ * Spec: `spec/pipeline/render/canvas/run-highlight-replay.md#target-pixel-aligned-highlight-replay`; `spec/document/body/text/run/border/paint-publication.md#sealed-display-list-and-canvas-replay`; `spec/pipeline/render/canvas/text-decoration-replay.md#mechanical-underline-and-strike-replay`.
7
+ * Spec: `spec/pipeline/render/canvas/emphasis-marks.md#canvas-emphasis-mark-replay`; `spec/pipeline/render/page-display-list/positioned-text/ruby.md#canvas-glyph-path-replay`; `spec/pipeline/render/page-display-list/direct-run-revision-markup.md#mechanical-canvas-replay`.
8
+ */
9
+ export declare function drawPositionedText(target: CanvasPaintTarget, command: PaintPositionedTextCommand): void;
10
+ //# sourceMappingURL=canvas-positioned-text-replay.d.ts.map
@@ -0,0 +1,7 @@
1
+ /** Spec: spec/document/body/drawing/group/wordprocessing-group.md */
2
+ import { type CanvasImageResourceMaterializer, type CanvasPaintTarget, type PaintCommand } from "../render-api/index.js";
3
+ /** Spec: `spec/pipeline/render/page-display-list/inline-raster-image.md#inline-raster-image-command`; `spec/pipeline/render/canvas/raster-sampling/_index.md#mechanical-raster-sampling-replay`; `spec/pipeline/render/canvas/raster-alpha-replay.md#drawingml-raster-alpha-replay`; `spec/document/body/drawing/vector-image/_index.md#svg-first-native-image-realization`. */
4
+ export declare function drawInlineRasterImage(target: CanvasPaintTarget, command: Extract<PaintCommand, {
5
+ readonly kind: "inlineRasterImage";
6
+ }>, resources: CanvasImageResourceMaterializer): void;
7
+ //# sourceMappingURL=canvas-raster-replay.d.ts.map
@@ -0,0 +1,19 @@
1
+ /** Spec: document.body.drawing.shape.outer-shadow */
2
+ import type { PositionedVectorShapeShadow } from "../foundation/index.js";
3
+ import type { CanvasPaintTarget, PaintInlineRasterImageClip, PaintRasterImageTransform } from "../render-api/index.js";
4
+ /** Spec: pipeline.render.canvas.effect-surfaces */
5
+ export declare class ShadowBounds {
6
+ #private;
7
+ readonly device: PaintRasterImageTransform;
8
+ readonly transform?: PaintRasterImageTransform | undefined;
9
+ constructor(device: PaintRasterImageTransform, transform?: PaintRasterImageTransform | undefined);
10
+ includeRectangle(left: number, top: number, width: number, height: number, padding?: number): void;
11
+ get rectangle(): Readonly<{
12
+ left: number;
13
+ top: number;
14
+ width: number;
15
+ height: number;
16
+ }> | undefined;
17
+ }
18
+ export declare function drawShadowedContent(target: CanvasPaintTarget, shadow: PositionedVectorShapeShadow, bounds: ShadowBounds, clip: PaintInlineRasterImageClip | null, paint: (target: CanvasPaintTarget) => void): void;
19
+ //# sourceMappingURL=canvas-shadow-replay.d.ts.map
@@ -0,0 +1,9 @@
1
+ /** Spec: document.body.drawing.picture-soft-edges */
2
+ import type { CanvasPaintTarget } from "../render-api/index.js";
3
+ export declare function drawSoftEdgeRaster(target: CanvasPaintTarget, rectangle: Readonly<{
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ }>, radius: number, paint: (target: CanvasPaintTarget) => void): void;
9
+ //# sourceMappingURL=canvas-soft-edge-replay.d.ts.map
@@ -0,0 +1,7 @@
1
+ /** Spec: document.body.table.fixed-grid.border.patterned#dash-endpoint-coverage */
2
+ import type { CanvasPaintTarget, PaintCommand } from "../render-api/index.js";
3
+ /** Spec: `spec/document/body/table/fixed-grid/border/device-replay.md#device-minimum-representation-and-replay`; `spec/pipeline/render/canvas/table-border-device-minimum-replay.md#table-border-device-minimum-replay`. */
4
+ export declare function fillTableBorderRectangle(target: CanvasPaintTarget, command: Extract<PaintCommand, {
5
+ readonly kind: "fillRectangle";
6
+ }>): void;
7
+ //# sourceMappingURL=canvas-table-border-replay.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { CanvasPaintTarget } from "../render-api/index.js";
2
+ /** Spec: `spec/pipeline/render/canvas/run-highlight-replay.md#target-pixel-aligned-highlight-replay`; `spec/pipeline/render/canvas/_index.md#target-pixel-aligned-rectangle-replay`. */
3
+ export declare function fillTargetPixelAlignedRectangle(target: CanvasPaintTarget, rectangle: Readonly<{
4
+ readonly x: number;
5
+ readonly y: number;
6
+ readonly width: number;
7
+ readonly height: number;
8
+ }>): void;
9
+ //# sourceMappingURL=canvas-target-pixel-alignment.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { CanvasPaintTarget, PaintVectorShapeCommand } from "../render-api/index.js";
2
+ /** Specs: `spec/pipeline/render/vector-graphics/preset-shape/transport-and-publication.md#direct-preset-shape-display-list-command`; `spec/pipeline/render/vector-graphics/preset-shape/contours-and-record-order.md#ordered-records-with-independent-paint-gates`; `spec/document/body/drawing/vml/gradient-fills.md`. */
3
+ export declare function drawVectorShape(target: CanvasPaintTarget, command: PaintVectorShapeCommand): void;
4
+ //# sourceMappingURL=canvas-vector-shape-replay.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Spec: pipeline.sdk.licensing */
2
+ export declare function paintEvaluationWatermark(context: CanvasRenderingContext2D, width: number, height: number): void;
3
+ //# sourceMappingURL=evaluation-watermark.d.ts.map
@@ -0,0 +1,30 @@
1
+ /** Spec: pipeline.sdk.page-source */
2
+ import { type PageInteraction } from "../foundation/index.js";
3
+ import type { DocumentSource, PageSize } from "../render-api/index.js";
4
+ import type { DocumentView, ViewOptions } from "./presentation.js";
5
+ export { materializePageDisplayListToCanvas } from "./canvas-materializer.js";
6
+ export { encode, decode } from "./transport.js";
7
+ export type * from "../render-api/index.js";
8
+ export type { DocumentView, ViewOptions, ViewAnchor, DocumentAttachment, AttachmentOptions, AttachmentPlacement } from "./presentation.js";
9
+ export interface DocumentPage {
10
+ readonly index: number;
11
+ readonly size: PageSize;
12
+ readonly interaction: PageInteraction;
13
+ render(canvas: HTMLCanvasElement, options?: Readonly<{
14
+ dpi?: number;
15
+ signal?: AbortSignal;
16
+ }>): Promise<void>;
17
+ }
18
+ export interface CanvasDocument {
19
+ readonly pages: readonly DocumentPage[];
20
+ readonly disposed: boolean;
21
+ readonly view: DocumentView | undefined;
22
+ mount(container: HTMLElement, options?: ViewOptions): DocumentView;
23
+ refresh(): void;
24
+ dispose(): void;
25
+ }
26
+ export declare function createDocument(source: DocumentSource, options?: Readonly<{
27
+ container?: HTMLElement;
28
+ viewOptions?: ViewOptions;
29
+ }>): CanvasDocument;
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,54 @@
1
+ /** Spec: pipeline.semantic.document-update */
2
+ /** Spec: pipeline.sdk.presentation */
3
+ import type { DocumentFragment, DocumentHit, DocumentPoint } from "../render-api/index.js";
4
+ import type { DocumentPage, PageSize } from "./index.js";
5
+ export interface ViewOptions {
6
+ readonly zoom?: number | "fit-width";
7
+ readonly gap?: number;
8
+ readonly title?: string;
9
+ }
10
+ export interface DocumentAttachment {
11
+ readonly element: HTMLElement;
12
+ readonly disposed: boolean;
13
+ dispose(): void;
14
+ }
15
+ export type ViewAnchor = DocumentFragment | Pick<DocumentPage, "index" | "size">;
16
+ export type AttachmentPlacement = "overlay" | `inside-${"top" | "center" | "bottom"}-${"left" | "center" | "right"}` | `outside-${"top" | "right" | "bottom" | "left"}`;
17
+ export type AttachmentOptions = Readonly<{
18
+ anchor: ViewAnchor;
19
+ offset?: DocumentPoint;
20
+ size?: PageSize;
21
+ }> & (Readonly<{
22
+ placement?: "overlay";
23
+ inset?: never;
24
+ gap?: never;
25
+ }> | Readonly<{
26
+ placement: Extract<AttachmentPlacement, `inside-${string}`>;
27
+ inset?: number;
28
+ gap?: never;
29
+ }> | Readonly<{
30
+ placement: Extract<AttachmentPlacement, `outside-${string}`>;
31
+ gap?: number;
32
+ inset?: never;
33
+ }>);
34
+ export interface DocumentView {
35
+ readonly element: HTMLElement;
36
+ readonly disposed: boolean;
37
+ whenRendered(): Promise<void>;
38
+ setZoom(zoom: number | "fit-width"): void;
39
+ toClient(pageIndex: number, point: DocumentPoint): DocumentPoint;
40
+ fromClient(point: DocumentPoint): Readonly<{
41
+ pageIndex: number;
42
+ point: DocumentPoint;
43
+ }> | undefined;
44
+ hitTest(point: DocumentPoint): DocumentHit | undefined;
45
+ scrollTo(anchor: ViewAnchor, options?: ScrollIntoViewOptions): boolean;
46
+ attach(element: HTMLElement, options: AttachmentOptions): DocumentAttachment;
47
+ dispose(): void;
48
+ }
49
+ export declare function mountDocument(document: Readonly<{
50
+ pages: readonly DocumentPage[];
51
+ }>, container: HTMLElement, options: ViewOptions | undefined, onDispose: () => void): DocumentView & {
52
+ refresh(): void;
53
+ };
54
+ //# sourceMappingURL=presentation.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { PageTextLine } from "../render-api/index.js";
2
+ import type { DocumentPage } from "./index.js";
3
+ /** Spec: pipeline.sdk.presentation */
4
+ export declare function mountTextSelection(pageText: readonly PageTextLine[], viewport: HTMLElement, shells: readonly HTMLElement[], pageBounds: readonly DocumentPage["size"][], nearby: ReadonlySet<number>, signal: AbortSignal): {
5
+ paint: () => void;
6
+ };
7
+ //# sourceMappingURL=text-selection.d.ts.map
@@ -0,0 +1,5 @@
1
+ /** Spec: pipeline.sdk.page-source */
2
+ import type { PageDisplayList, DocumentManifest } from "../render-api/index.js";
3
+ export declare function encode(page: PageDisplayList | DocumentManifest): string;
4
+ export declare function decode<T extends PageDisplayList | DocumentManifest>(value: string): T;
5
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1,17 @@
1
+ import type { BoundedNumberRepresentation } from "./bounded-number-representation.js";
2
+ import { type BoundedNumberRepresentationCheckpoint, type BoundedNumberRepresentationResult } from "./bounded-number-representation-mechanics.js";
3
+ export declare const chineseCountingDigits: readonly ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
4
+ export declare const chineseCountingLargeUnits: readonly ["万", "亿", "兆", "京", "垓", "秭", "穰", "沟", "涧", "正", "载"];
5
+ export declare const simplifiedLegalDigits: readonly ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
6
+ export declare const simplifiedLegalLargeUnits: readonly ["万", "亿"];
7
+ export declare const traditionalLegalDigits: readonly ["零", "壹", "貳", "參", "肆", "伍", "陸", "柒", "捌", "玖"];
8
+ export declare const traditionalLegalLargeUnits: readonly ["萬", "億"];
9
+ export declare const japaneseLegalDigits: readonly ["零", "壱", "弐", "参", "四", "伍", "六", "七", "八", "九"];
10
+ type CjkIdeographicRepresentation = "chineseCounting" | "chineseCountingThousand" | "ideographDigital" | "japaneseCounting" | "taiwaneseCounting" | "taiwaneseCountingThousand" | "chineseLegalSimplified" | "ideographLegalTraditional" | "japaneseLegal";
11
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/cjk.md#writer-cjk-ideographic-representations`. */
12
+ export declare function isCjkIdeographicRepresentation(representation: BoundedNumberRepresentation): representation is CjkIdeographicRepresentation;
13
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/cjk.md#writer-cjk-ideographic-representations`. */
14
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/cjk.md#writer-cjk-ideographic-representations`. */
15
+ export declare function formatCjkIdeographicNumber(value: bigint, representation: CjkIdeographicRepresentation, checkpoint: BoundedNumberRepresentationCheckpoint | undefined): BoundedNumberRepresentationResult;
16
+ export {};
17
+ //# sourceMappingURL=bounded-number-representation-cjk.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { type BoundedNumberRepresentationResult } from "./bounded-number-representation-mechanics.js";
2
+ type DecimalRomanLatinRepresentation = "decimal" | "decimalZero" | "decimalFullWidth" | "decimalFullWidth2" | "upperRoman" | "lowerRoman" | "upperLatin" | "lowerLatin";
3
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/decimal-roman-latin.md#decimal-roman-and-latin-representations`. */
4
+ export declare function formatDecimalRomanLatinNumber(value: bigint, representation: DecimalRomanLatinRepresentation): BoundedNumberRepresentationResult;
5
+ export {};
6
+ //# sourceMappingURL=bounded-number-representation-decimal-roman-latin.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { type BoundedNumberRepresentationResult } from "./bounded-number-representation-mechanics.js";
2
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/hebrew.md#writer-hebrew-numeral-representation`. */
3
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/hebrew.md#writer-hebrew-numeral-representation`. */
4
+ export declare function formatWriterHebrewNumber(value: bigint): BoundedNumberRepresentationResult;
5
+ //# sourceMappingURL=bounded-number-representation-hebrew.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { BoundedNumberRepresentation } from "./bounded-number-representation.js";
2
+ import { type BoundedNumberRepresentationCheckpoint, type BoundedNumberRepresentationResult } from "./bounded-number-representation-mechanics.js";
3
+ export declare const koreanDigital: readonly ["영", "일", "이", "삼", "사", "오", "육", "칠", "팔", "구"];
4
+ export declare const koreanDigital2: readonly ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
5
+ export declare const koreanCountingDigits: readonly ["일", "이", "삼", "사", "오", "육", "칠", "팔", "구"];
6
+ export declare const koreanLegalOnes: readonly ["하나", "둘", "셋", "넷", "다섯", "여섯", "일곱", "여덟", "아홉"];
7
+ export declare const koreanLegalTens: readonly ["열", "스물", "서른", "마흔", "쉰", "예순", "일흔", "여든", "아흔"];
8
+ type KoreanRepresentation = "koreanDigital" | "koreanDigital2" | "koreanCounting" | "koreanLegal";
9
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/korean.md#writer-korean-digital-counting-and-legal-representations`. */
10
+ export declare function isKoreanRepresentation(representation: BoundedNumberRepresentation): representation is KoreanRepresentation;
11
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/korean.md#writer-korean-digital-counting-and-legal-representations`. */
12
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/korean.md#writer-korean-digital-counting-and-legal-representations`. */
13
+ export declare function formatKoreanNumber(value: bigint, representation: KoreanRepresentation, checkpoint: BoundedNumberRepresentationCheckpoint | undefined): BoundedNumberRepresentationResult;
14
+ export {};
15
+ //# sourceMappingURL=bounded-number-representation-korean.d.ts.map
@@ -0,0 +1,17 @@
1
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/shared-mechanics.md#shared-bounded-representation-mechanics`. */
2
+ export type BoundedNumberRepresentationResult = Readonly<{
3
+ readonly kind: "formatted";
4
+ readonly text: string;
5
+ }> | Readonly<{
6
+ readonly kind: "invalid" | "out-of-range";
7
+ }>;
8
+ export type BoundedNumberRepresentationCheckpoint = () => void;
9
+ export type BoundedNumberRepresentationFailure = Exclude<BoundedNumberRepresentationResult, Readonly<{
10
+ readonly kind: "formatted";
11
+ readonly text: string;
12
+ }>>;
13
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/shared-mechanics.md#shared-bounded-representation-mechanics`. */
14
+ export declare function formattedResult(text: string): BoundedNumberRepresentationResult;
15
+ export declare function invalidResult(): BoundedNumberRepresentationFailure;
16
+ export declare function outOfRangeResult(): BoundedNumberRepresentationFailure;
17
+ //# sourceMappingURL=bounded-number-representation-mechanics.d.ts.map
@@ -0,0 +1,22 @@
1
+ import type { BoundedNumberRepresentation } from "./bounded-number-representation.js";
2
+ export declare const russianLower: readonly ["а", "б", "в", "г", "д", "е", "ж", "з", "и", "к", "л", "м", "н", "о", "п", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ы", "э", "ю", "я"];
3
+ export declare const russianUpper: readonly ["А", "Б", "В", "Г", "Д", "Е", "Ж", "З", "И", "К", "Л", "М", "Н", "О", "П", "Р", "С", "Т", "У", "Ф", "Х", "Ц", "Ч", "Ш", "Щ", "Ы", "Э", "Ю", "Я"];
4
+ export declare const arabicAlpha: readonly ["أ", "ب", "ت", "ث", "ج", "ح", "خ", "د", "ذ", "ر", "ز", "س", "ش", "ص", "ض", "ط", "ظ", "ع", "غ", "ف", "ق", "ك", "ل", "م", "ن", "ه", "و", "ى"];
5
+ export declare const arabicAbjad: readonly ["ا", "ب", "ج", "د", "ه", "و", "ز", "ح", "ط", "ي", "ك", "ل", "م", "ن", "س", "ع", "ف", "ص", "ق", "ر", "ش", "ت", "ث", "خ", "ذ", "ض", "ظ", "غ"];
6
+ export declare const hebrew2: readonly ["א", "ב", "ג", "ד", "ה", "ו", "ז", "ח", "ט", "י", "כ", "ל", "מ", "נ", "ס", "ע", "פ", "צ", "ק", "ר", "ש", "ת"];
7
+ export declare const thaiLetters: readonly ["ก", "ข", "ค", "ง", "จ", "ฉ", "ช", "ซ", "ฌ", "ญ", "ฎ", "ฏ", "ฐ", "ฑ", "ฒ", "ณ", "ด", "ต", "ถ", "ท", "ธ", "น", "บ", "ป", "ผ", "ฝ", "พ", "ฟ", "ภ", "ม", "ย", "ร", "ฤ", "ล", "ฦ", "ว", "ศ", "ษ", "ส", "ห", "ฬ", "อ", "ฮ"];
8
+ export declare const hindiVowels: readonly ["क", "ख", "ग", "घ", "ङ", "च", "छ", "ज", "झ", "ञ", "ट", "ठ", "ड", "ढ", "ण", "त", "थ", "द", "ध", "न", "प", "फ", "ब", "भ", "म", "य", "र", "ल", "व", "श", "ष", "स", "ह"];
9
+ export declare const aiueo: readonly ["ア", "イ", "ウ", "エ", "オ", "カ", "キ", "ク", "ケ", "コ", "サ", "シ", "ス", "セ", "ソ", "タ", "チ", "ツ", "テ", "ト", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "ヒ", "フ", "ヘ", "ホ", "マ", "ミ", "ム", "メ", "モ", "ヤ", "ユ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ワ", "ヲ", "ン"];
10
+ export declare const aiueoFullWidth: readonly ["ア", "イ", "ウ", "エ", "オ", "カ", "キ", "ク", "ケ", "コ", "サ", "シ", "ス", "セ", "ソ", "タ", "チ", "ツ", "テ", "ト", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "ヒ", "フ", "ヘ", "ホ", "マ", "ミ", "ム", "メ", "モ", "ヤ", "ユ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ワ", "ヲ", "ン"];
11
+ export declare const iroha: readonly ["イ", "ロ", "ハ", "ニ", "ホ", "ヘ", "ト", "チ", "リ", "ヌ", "ル", "ヲ", "ワ", "カ", "ヨ", "タ", "レ", "ソ", "ツ", "ネ", "ナ", "ラ", "ム", "ウ", "ヰ", "ノ", "オ", "ク", "ヤ", "マ", "ケ", "フ", "コ", "エ", "テ", "ア", "サ", "キ", "ユ", "メ", "ミ", "シ", "ヱ", "ヒ", "モ", "セ", "ス", "ン"];
12
+ export declare const irohaFullWidth: readonly ["イ", "ロ", "ハ", "ニ", "ホ", "ヘ", "ト", "チ", "リ", "ヌ", "ル", "ヲ", "ワ", "カ", "ヨ", "タ", "レ", "ソ", "ツ", "ネ", "ナ", "ラ", "ム", "ウ", "ヰ", "ノ", "オ", "ク", "ヤ", "マ", "ケ", "フ", "コ", "エ", "テ", "ア", "サ", "キ", "ユ", "メ", "ミ", "シ", "ヱ", "ヒ", "モ", "セ", "ス", "ン"];
13
+ export declare const ganada: readonly ["가", "나", "다", "라", "마", "바", "사", "아", "자", "차", "카", "타", "파", "하"];
14
+ export declare const chosung: readonly ["ㄱ", "ㄴ", "ㄷ", "ㄹ", "ㅁ", "ㅂ", "ㅅ", "ㅇ", "ㅈ", "ㅊ", "ㅋ", "ㅌ", "ㅍ", "ㅎ"];
15
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/_index.md#writer-alphabet-representations`. */
16
+ type WriterAlphabetRepresentation = "upperAlphabetic" | "lowerAlphabetic" | "russianLower" | "russianUpper" | "arabicAlpha" | "arabicAbjad" | "hebrew2" | "thaiLetters" | "hindiVowels" | "aiueo" | "aiueoFullWidth" | "iroha" | "irohaFullWidth" | "ganada" | "chosung";
17
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/bijective.md#writer-bijective-representations`; `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/hindi-vowels.md#writer-hindi-vowel-representation`; `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/kana-recycled-symbols.md#writer-kana-recycled-symbols`; `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/korean-recycled-symbols.md#writer-korean-recycled-symbols`. */
18
+ export declare function isWriterAlphabetRepresentation(representation: BoundedNumberRepresentation): representation is WriterAlphabetRepresentation;
19
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/bijective.md#writer-bijective-representations`; `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/hindi-vowels.md#writer-hindi-vowel-representation`; `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/kana-recycled-symbols.md#writer-kana-recycled-symbols`; `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/korean-recycled-symbols.md#writer-korean-recycled-symbols`. */
20
+ export declare function formatWriterAlphabetNumber(value: bigint, representation: WriterAlphabetRepresentation): import("./bounded-number-representation-mechanics.js").BoundedNumberRepresentationResult;
21
+ export {};
22
+ //# sourceMappingURL=bounded-number-representation-writer-alphabets.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { BoundedNumberRepresentation } from "./bounded-number-representation.js";
2
+ import { type BoundedNumberRepresentationResult } from "./bounded-number-representation-mechanics.js";
3
+ export declare const writerCircledNumbers: readonly ["①", "②", "③", "④", "⑤", "⑥", "⑦", "⑧", "⑨", "⑩", "⑪", "⑫", "⑬", "⑭", "⑮", "⑯", "⑰", "⑱", "⑲", "⑳", "㉑", "㉒", "㉓", "㉔", "㉕", "㉖", "㉗", "㉘", "㉙", "㉚", "㉛", "㉜", "㉝", "㉞", "㉟", "㊱", "㊲", "㊳", "㊴", "㊵", "㊶", "㊷", "㊸", "㊹", "㊺", "㊻", "㊼", "㊽", "㊾", "㊿"];
4
+ export declare const ideographTraditional: readonly ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"];
5
+ export declare const ideographZodiac: readonly ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"];
6
+ type WriterTableRepresentation = "decimalEnclosedCircle" | "decimalEnclosedCircleChinese" | "ideographEnclosedCircle" | "ideographTraditional" | "ideographZodiac";
7
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/writer-tables.md#writer-circled-stem-and-branch-representations`. */
8
+ export declare function isWriterTableRepresentation(representation: BoundedNumberRepresentation): representation is WriterTableRepresentation;
9
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/writer-tables.md#writer-circled-stem-and-branch-representations`. */
10
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/writer-tables.md#writer-circled-stem-and-branch-representations`. */
11
+ export declare function formatWriterTableNumber(value: bigint, representation: WriterTableRepresentation): BoundedNumberRepresentationResult;
12
+ export {};
13
+ //# sourceMappingURL=bounded-number-representation-writer-tables.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { type BoundedNumberRepresentationCheckpoint, type BoundedNumberRepresentationResult } from "./bounded-number-representation-mechanics.js";
2
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/_index.md#bounded-number-representation`; `spec/pipeline/foundation/bounded-number-representation/decimal-roman-latin.md#decimal-roman-and-latin-representations`; `spec/pipeline/foundation/bounded-number-representation/writer-tables.md#writer-circled-stem-and-branch-representations`; `spec/pipeline/foundation/bounded-number-representation/hebrew.md#writer-hebrew-numeral-representation`; `spec/pipeline/foundation/bounded-number-representation/cjk.md#writer-cjk-ideographic-representations`; `spec/pipeline/foundation/bounded-number-representation/korean.md#writer-korean-digital-counting-and-legal-representations`; `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/bijective.md#writer-bijective-representations`; `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/hindi-vowels.md#writer-hindi-vowel-representation`; `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/kana-recycled-symbols.md#writer-kana-recycled-symbols`; `spec/pipeline/foundation/bounded-number-representation/writer-alphabets/korean-recycled-symbols.md#writer-korean-recycled-symbols`. */
3
+ export type BoundedNumberRepresentation = "decimal" | "decimalZero" | "decimalFullWidth" | "decimalFullWidth2" | "decimalEnclosedCircle" | "decimalEnclosedCircleChinese" | "ideographEnclosedCircle" | "ideographTraditional" | "ideographZodiac" | "chineseCounting" | "chineseCountingThousand" | "ideographDigital" | "japaneseCounting" | "taiwaneseCounting" | "taiwaneseCountingThousand" | "chineseLegalSimplified" | "ideographLegalTraditional" | "japaneseLegal" | "koreanDigital" | "koreanDigital2" | "koreanCounting" | "koreanLegal" | "upperRoman" | "lowerRoman" | "upperLatin" | "lowerLatin" | "upperAlphabetic" | "lowerAlphabetic" | "russianLower" | "russianUpper" | "arabicAlpha" | "arabicAbjad" | "hebrew1" | "hebrew2" | "thaiLetters" | "hindiVowels" | "aiueo" | "aiueoFullWidth" | "iroha" | "irohaFullWidth" | "ganada" | "chosung";
4
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/_index.md#bounded-number-representation`. */
5
+ export type PageNumberingFormat = BoundedNumberRepresentation | "unsupported";
6
+ export type { BoundedNumberRepresentationCheckpoint, BoundedNumberRepresentationResult } from "./bounded-number-representation-mechanics.js";
7
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/sequence-display.md#sequence-display-conversion`. */
8
+ export type SequenceNumberRepresentation = Extract<BoundedNumberRepresentation, "decimal" | "upperRoman" | "lowerRoman" | "upperAlphabetic" | "lowerAlphabetic">;
9
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/sequence-display.md#sequence-display-conversion`. */
10
+ export declare function formatSequenceNumber(value: bigint, representation: SequenceNumberRepresentation): string;
11
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/_index.md#bounded-number-representation`. */
12
+ /** Spec: `spec/pipeline/foundation/bounded-number-representation/_index.md#bounded-number-representation`. */
13
+ export declare function formatBoundedNumberRepresentation(value: bigint, representation: BoundedNumberRepresentation, checkpoint?: BoundedNumberRepresentationCheckpoint): BoundedNumberRepresentationResult;
14
+ export { russianLower, russianUpper, arabicAlpha, arabicAbjad, hebrew2, thaiLetters, hindiVowels, aiueo, aiueoFullWidth, iroha, irohaFullWidth, ganada, chosung } from "./bounded-number-representation-writer-alphabets.js";
15
+ export { koreanDigital, koreanDigital2, koreanCountingDigits, koreanLegalOnes, koreanLegalTens } from "./bounded-number-representation-korean.js";
16
+ export { chineseCountingDigits, chineseCountingLargeUnits, simplifiedLegalDigits, simplifiedLegalLargeUnits, traditionalLegalDigits, traditionalLegalLargeUnits, japaneseLegalDigits } from "./bounded-number-representation-cjk.js";
17
+ export { writerCircledNumbers, ideographTraditional, ideographZodiac } from "./bounded-number-representation-writer-tables.js";
18
+ //# sourceMappingURL=bounded-number-representation.d.ts.map
@@ -0,0 +1,23 @@
1
+ /** Spec: `spec/pipeline/layout/text/font/browser-native-text-realization.md`. */
2
+ export interface BrowserTextOperation {
3
+ readonly kind: "nativeText";
4
+ readonly text: string;
5
+ readonly font: string;
6
+ readonly direction: "ltr" | "rtl";
7
+ readonly kerning: CanvasFontKerning;
8
+ readonly letterSpacing: string;
9
+ readonly language: string;
10
+ readonly x: number;
11
+ readonly y: number;
12
+ readonly a: number;
13
+ readonly b: number;
14
+ readonly c: number;
15
+ readonly d: number;
16
+ readonly width: number;
17
+ readonly inkLeft: number;
18
+ readonly inkRight: number;
19
+ readonly ascent: number;
20
+ readonly descent: number;
21
+ readonly strokeWidth?: number;
22
+ }
23
+ //# sourceMappingURL=browser-text.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Spec: document.body.drawing.chart.axis-number-format */
2
+ export declare function chartAxisNumberLabel(tick: string, formatCode: string | null): string;
3
+ //# sourceMappingURL=chart-number-format.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Spec: pipeline.sdk.page-source */
2
+ export declare function roundHalfAwayFromZero(value: number): number;
3
+ //# sourceMappingURL=device-rounding.d.ts.map
@@ -0,0 +1,14 @@
1
+ /** Spec: pipeline.render.resources */
2
+ export interface FontFaceResource {
3
+ readonly family: string;
4
+ readonly source: string | Uint8Array;
5
+ readonly descriptors: Readonly<{
6
+ weight: string;
7
+ style: string;
8
+ stretch: string;
9
+ ascentOverride: string;
10
+ descentOverride: string;
11
+ lineGapOverride: string;
12
+ }>;
13
+ }
14
+ //# sourceMappingURL=font-resources.d.ts.map
@@ -0,0 +1,27 @@
1
+ /** Spec: `spec/pipeline/layout/publication/layout-document/positioned-text.md#native-text-and-decoration-contracts`. */
2
+ export type GeometryPathOperation = Readonly<{
3
+ readonly kind: "moveTo";
4
+ readonly x: number;
5
+ readonly y: number;
6
+ }> | Readonly<{
7
+ readonly kind: "lineTo";
8
+ readonly x: number;
9
+ readonly y: number;
10
+ }> | Readonly<{
11
+ readonly kind: "quadraticCurveTo";
12
+ readonly controlX: number;
13
+ readonly controlY: number;
14
+ readonly x: number;
15
+ readonly y: number;
16
+ }> | Readonly<{
17
+ readonly kind: "bezierCurveTo";
18
+ readonly control1X: number;
19
+ readonly control1Y: number;
20
+ readonly control2X: number;
21
+ readonly control2Y: number;
22
+ readonly x: number;
23
+ readonly y: number;
24
+ }> | Readonly<{
25
+ readonly kind: "closePath";
26
+ }>;
27
+ //# sourceMappingURL=geometry-path.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Spec: `spec/pipeline/host-task.md#cooperative-host-tasks`. */
2
+ export declare function yieldToHost(): Promise<void>;
3
+ //# sourceMappingURL=host-task.d.ts.map
@@ -0,0 +1,39 @@
1
+ /** Spec: pipeline.render.resources */
2
+ import type { RasterColorEffectPlan } from "./raster-color-effect.js";
3
+ export interface ImageResourceId {
4
+ readonly type: "ResourceId";
5
+ readonly serialized: `r_${string}`;
6
+ }
7
+ export type ImageResourceReference = ImageResourceId | Readonly<{
8
+ type: "SvgImageResourceChoice";
9
+ svgResourceId: ImageResourceId;
10
+ rasterFallbackResourceId?: ImageResourceId;
11
+ }>;
12
+ export interface ImagePixelSize {
13
+ readonly width: number;
14
+ readonly height: number;
15
+ }
16
+ export interface ImageResourceSource {
17
+ readonly bytes: Uint8Array;
18
+ readonly mediaType: "image/bmp" | "image/gif" | "image/jpeg" | "image/png" | "image/svg+xml";
19
+ }
20
+ export interface ImageResourceSelection {
21
+ readonly resource: ImageResourceReference;
22
+ readonly rasterFallbackOnly: boolean;
23
+ readonly optional?: boolean;
24
+ }
25
+ export interface ImageResourceData {
26
+ readonly sources: readonly Readonly<{
27
+ id: string;
28
+ source: ImageResourceSource;
29
+ }>[];
30
+ readonly selections: readonly ImageResourceSelection[];
31
+ }
32
+ export interface RasterImageMaterializer {
33
+ resolveRasterImage(resource: ImageResourceReference, colorEffect?: RasterColorEffectPlan): CanvasImageSource | undefined;
34
+ resolveRasterImageIntrinsicPixelSize(resource: ImageResourceReference, colorEffect?: RasterColorEffectPlan): ImagePixelSize | undefined;
35
+ resolvePreparedRasterImage(resource: ImageResourceReference, size: ImagePixelSize, colorEffect?: RasterColorEffectPlan, flipHorizontal?: boolean, flipVertical?: boolean): CanvasImageSource | undefined;
36
+ dispose(): void;
37
+ }
38
+ export declare function materializeImageResources(data: ImageResourceData, signal?: AbortSignal, onDispose?: () => void): Promise<RasterImageMaterializer>;
39
+ //# sourceMappingURL=image-resources.d.ts.map
@@ -0,0 +1,17 @@
1
+ export * from "./raster-source-rectangle.js";
2
+ export * from "./raster-color-effect.js";
3
+ export * from "./bounded-number-representation.js";
4
+ export * from "./writer-unmapped-ooxml-number-format.js";
5
+ export * from "./vector-shape-fill.js";
6
+ export * from "./vector-shape-shadow.js";
7
+ export * from "./vector-shape.js";
8
+ export * from "./host-task.js";
9
+ export * from "./path-bounds.js";
10
+ export * from "./geometry-path.js";
11
+ export * from "./browser-text.js";
12
+ export * from "./device-rounding.js";
13
+ export * from "./font-resources.js";
14
+ export * from "./page-interaction.js";
15
+ export * from "./image-resources.js";
16
+ export * from "./chart-number-format.js";
17
+ //# sourceMappingURL=index.d.ts.map