Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions runtime/reference/web_platform_apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,34 @@ const worker = new Worker(import.meta.resolve("./worker.js"), {
});
```

## Geometry Interfaces

Starting in Deno 2.8, the
[Geometry Interfaces Module Level 1](https://drafts.fxtf.org/geometry/) types
are available as globals. These are the same types you'd find in a browser:

- [`DOMMatrix`](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix) /
[`DOMMatrixReadOnly`](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly)
— 4×4 transform matrices for 2D and 3D operations.
- [`DOMPoint`](https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint) /
[`DOMPointReadOnly`](https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly)
— points in 2D / 3D space.
- [`DOMRect`](https://developer.mozilla.org/en-US/docs/Web/API/DOMRect) /
[`DOMRectReadOnly`](https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly)
— axis-aligned rectangles.
- [`DOMQuad`](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad) — a
quadrilateral defined by four points.

```ts
const m = new DOMMatrix().translateSelf(10, 20).scaleSelf(2);
const p = new DOMPoint(1, 1).matrixTransform(m);
console.log(p.x, p.y); // 12 22
```

These types are useful for graphics work — applying transforms to canvas
drawings, computing layout math, or porting browser code that depends on
geometry types.

## Deviations of other APIs from spec

### Cache API
Expand Down