@gtkx/cairo 1.6.0 → 2.0.0-beta.10
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.
- package/README.md +47 -44
- package/dist/index.d.ts +0 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -13
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -33
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +11 -7
- package/src/index.ts +0 -14
- package/src/types.ts +0 -33
package/README.md
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
<h1 align="center">GTKX</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
The React framework for Linux
|
|
9
|
-
Write native
|
|
10
|
-
Real
|
|
8
|
+
The React framework for Linux.<br />
|
|
9
|
+
Write native GNOME applications with React and TypeScript.
|
|
10
|
+
Real Adwaita and GTK4 widgets with standard web tooling.
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
14
|
<a href="https://www.npmjs.com/package/create-gtkx"><img src="https://img.shields.io/npm/v/create-gtkx?color=cb3837&logo=npm&label=create-gtkx" alt="npm version" /></a>
|
|
15
15
|
<a href="https://www.npmjs.com/package/create-gtkx"><img src="https://img.shields.io/npm/dm/create-gtkx?color=cb3837&logo=npm&label=downloads" alt="npm downloads" /></a>
|
|
16
|
-
<img src="https://img.shields.io/badge/node-%E2%89%
|
|
16
|
+
<img src="https://img.shields.io/badge/node-%E2%89%A526.7-339933?logo=node.js&logoColor=white" alt="Node >= 26.7" />
|
|
17
17
|
<a href="https://github.com/gtkx-org/gtkx/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MPL--2.0-blue.svg" alt="License: MPL-2.0" /></a>
|
|
18
18
|
<a href="https://github.com/gtkx-org/gtkx/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/gtkx-org/gtkx/ci.yml?branch=main&logo=github&label=CI" alt="CI status" /></a>
|
|
19
19
|
<img src="https://img.shields.io/badge/TypeScript-strict-3178c6?logo=typescript&logoColor=white" alt="TypeScript" />
|
|
@@ -38,11 +38,12 @@
|
|
|
38
38
|
|
|
39
39
|
## Demo
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
This app starts with an Adwaita application shell, renders native GTK4 widgets inside it, and uses ordinary React hooks and events:
|
|
42
42
|
|
|
43
43
|
```tsx
|
|
44
44
|
import * as Gtk from "@gtkx/gi/gtk";
|
|
45
|
-
import {
|
|
45
|
+
import { AdwApplication, AdwApplicationWindow, AdwHeaderBar, AdwToolbarView } from "@gtkx/jsx/adw";
|
|
46
|
+
import { GtkBox, GtkButton, GtkLabel } from "@gtkx/jsx/gtk";
|
|
46
47
|
import { createRoot, quit } from "@gtkx/react";
|
|
47
48
|
import { useState } from "react";
|
|
48
49
|
|
|
@@ -50,38 +51,40 @@ const Counter = () => {
|
|
|
50
51
|
const [count, setCount] = useState(0);
|
|
51
52
|
|
|
52
53
|
return (
|
|
53
|
-
<
|
|
54
|
+
<AdwApplicationWindow
|
|
54
55
|
title="Hello GTKX"
|
|
55
56
|
defaultWidth={400}
|
|
56
57
|
defaultHeight={300}
|
|
57
58
|
onCloseRequest={quit}
|
|
58
59
|
>
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
<AdwToolbarView topBar={<AdwHeaderBar />}>
|
|
61
|
+
<GtkBox
|
|
62
|
+
orientation={Gtk.Orientation.VERTICAL}
|
|
63
|
+
spacing={20}
|
|
64
|
+
marginTop={40}
|
|
65
|
+
marginBottom={40}
|
|
66
|
+
marginStart={40}
|
|
67
|
+
marginEnd={40}
|
|
68
|
+
valign={Gtk.Align.CENTER}
|
|
69
|
+
halign={Gtk.Align.CENTER}
|
|
70
|
+
>
|
|
71
|
+
<GtkLabel cssClasses={["title-1"]}>Welcome to GTKX!</GtkLabel>
|
|
72
|
+
<GtkLabel cssClasses={["title-2"]}>{`Count: ${String(count)}`}</GtkLabel>
|
|
73
|
+
<GtkButton
|
|
74
|
+
label="Increment"
|
|
75
|
+
onClicked={() => setCount((c) => c + 1)}
|
|
76
|
+
cssClasses={["suggested-action", "pill"]}
|
|
77
|
+
/>
|
|
78
|
+
</GtkBox>
|
|
79
|
+
</AdwToolbarView>
|
|
80
|
+
</AdwApplicationWindow>
|
|
78
81
|
);
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
const App = () => (
|
|
82
|
-
<
|
|
85
|
+
<AdwApplication>
|
|
83
86
|
<Counter />
|
|
84
|
-
</
|
|
87
|
+
</AdwApplication>
|
|
85
88
|
);
|
|
86
89
|
|
|
87
90
|
createRoot().render(<App />);
|
|
@@ -91,9 +94,9 @@ This is the [`hello-world`](https://github.com/gtkx-org/gtkx/tree/main/examples/
|
|
|
91
94
|
|
|
92
95
|
## Why GTKX
|
|
93
96
|
|
|
94
|
-
###
|
|
97
|
+
### Adwaita-first application development
|
|
95
98
|
|
|
96
|
-
|
|
99
|
+
GTKX uses Adwaita as the foundation for applications, windows, navigation, dialogs, and adaptive layouts, with the complete GTK4 toolkit underneath. It adds a declarative React layer and an integrated TypeScript toolchain to the GNOME platform:
|
|
97
100
|
|
|
98
101
|
- a React reconciler that exposes every GObject as a JSX element,
|
|
99
102
|
- a CLI for scaffolding, development, and production builds,
|
|
@@ -102,29 +105,29 @@ GTK4 is mature, and GtkBuilder XML can lay out a static interface, but nothing r
|
|
|
102
105
|
- a Testing Library-style API for querying and driving your widgets in tests,
|
|
103
106
|
- and a Model Context Protocol (MCP) server that exposes your live app to AI agents.
|
|
104
107
|
|
|
105
|
-
###
|
|
108
|
+
### Native GNOME widgets, without a compatibility layer
|
|
106
109
|
|
|
107
|
-
React Native and similar frameworks hide the native toolkit so one API can run everywhere. GTKX
|
|
110
|
+
React Native and similar frameworks hide the native toolkit so one API can run everywhere. GTKX renders real Adwaita and GTK4 widgets and exposes any other GObject-Introspection library on your system. It is GNOME-native and Linux-only by design.
|
|
108
111
|
|
|
109
112
|
### Why Node.js, and why generated bindings
|
|
110
113
|
|
|
111
114
|
GTKX runs on Node.js, which puts native modules, the npm ecosystem, and the tooling built for Node.js APIs within reach. GJS is GNOME's own runtime, built on SpiderMonkey rather than V8; node-gtk runs on Node.js but is lightly maintained, on the older nan/V8 ABI rather than N-API, and still centered on GTK3. The [Why GTKX guide](https://gtkx.dev/guide/why-gtkx) covers what running on Node.js means day to day.
|
|
112
115
|
|
|
113
|
-
GTKX generates the TypeScript types and
|
|
116
|
+
GTKX generates the TypeScript types and native FFI calls from the same GObject-Introspection data, so the types cannot drift from the calls they back. `Adw-1` is the sole default GIR root; its GIR include pulls in `Gtk-4.0`, so codegen covers both complete API surfaces. Neither belongs in a GTKX 2 `libraries` list.
|
|
114
117
|
|
|
115
|
-
At runtime, the native Rust core calls straight into the system
|
|
118
|
+
At runtime, the native Rust core calls straight into the system Adwaita, GTK4, and GLib libraries through libffi, without loading libgirepository at all.
|
|
116
119
|
|
|
117
120
|
## Quick start
|
|
118
121
|
|
|
119
|
-
GTKX is Linux-only and needs Node.js
|
|
122
|
+
GTKX is Linux-only and needs Node.js 26.7 or later. See [Requirements](#requirements).
|
|
120
123
|
|
|
121
124
|
Scaffold a new app with the `create-gtkx` initializer:
|
|
122
125
|
|
|
123
126
|
```sh
|
|
124
|
-
npm create gtkx
|
|
127
|
+
npm create gtkx@beta
|
|
125
128
|
```
|
|
126
129
|
|
|
127
|
-
The same command works with other package managers: `pnpm create gtkx` or `yarn create gtkx`.
|
|
130
|
+
The same command works with other package managers: `pnpm create gtkx@beta` or `yarn create gtkx@beta`.
|
|
128
131
|
|
|
129
132
|
Then run your new app:
|
|
130
133
|
|
|
@@ -145,8 +148,8 @@ The documentation at **[gtkx.dev](https://gtkx.dev)** includes a step-by-step tu
|
|
|
145
148
|
|
|
146
149
|
GTKX is Linux-only. You need:
|
|
147
150
|
|
|
148
|
-
- Linux with the
|
|
149
|
-
- Node.js
|
|
151
|
+
- Linux with the Adwaita (1.8 or later), GTK4 (4.20 or later), and GLib development libraries
|
|
152
|
+
- Node.js 26.7 or later
|
|
150
153
|
|
|
151
154
|
The `@gtkx/native` addon ships prebuilt for x64 and arm64 glibc Linux; other targets need to build it from the GTKX repository, which requires a Rust toolchain.
|
|
152
155
|
|
|
@@ -154,10 +157,10 @@ The `@gtkx/native` addon ships prebuilt for x64 and arm64 glibc Linux; other tar
|
|
|
154
157
|
|
|
155
158
|
Explore the [example apps](https://github.com/gtkx-org/gtkx/tree/main/examples):
|
|
156
159
|
|
|
157
|
-
- [`hello-world`](https://github.com/gtkx-org/gtkx/tree/main/examples/hello-world): the counter above.
|
|
158
|
-
- [`gtk-demo`](https://github.com/gtkx-org/gtkx/tree/main/examples/gtk-demo):
|
|
159
|
-
- [`browser`](https://github.com/gtkx-org/gtkx/tree/main/examples/browser):
|
|
160
|
-
- [`animations`](https://github.com/gtkx-org/gtkx/tree/main/examples/animations):
|
|
160
|
+
- [`hello-world`](https://github.com/gtkx-org/gtkx/tree/main/examples/hello-world): the Adwaita counter above.
|
|
161
|
+
- [`gtk-demo`](https://github.com/gtkx-org/gtkx/tree/main/examples/gtk-demo): the official GTK4 widget showcase in an Adwaita application shell, covering lists, dialogs, gestures, CSS, and OpenGL.
|
|
162
|
+
- [`browser`](https://github.com/gtkx-org/gtkx/tree/main/examples/browser): an Adwaita browser built around `WebKitWebView`.
|
|
163
|
+
- [`animations`](https://github.com/gtkx-org/gtkx/tree/main/examples/animations): an Adwaita showcase for `@gtkx/animated`, with React Spring animations driven by the GTK frame clock.
|
|
161
164
|
- [`navigation`](https://github.com/gtkx-org/gtkx/tree/main/examples/navigation): a tour of `@gtkx/navigation`, React Navigation's stack, tab, and drawer navigators rendered with libadwaita.
|
|
162
165
|
- [`tutorial`](https://github.com/gtkx-org/gtkx/tree/main/examples/tutorial): the Tasks app the documentation builds.
|
|
163
166
|
|
|
@@ -167,7 +170,7 @@ GTKX is stable and ready for production use.
|
|
|
167
170
|
|
|
168
171
|
## Contributing
|
|
169
172
|
|
|
170
|
-
Contributions are welcome. See [CONTRIBUTING.md](https://github.com/gtkx-org/gtkx/blob/main/CONTRIBUTING.md), the [Code of Conduct](https://github.com/gtkx-org/gtkx/blob/main/CODE_OF_CONDUCT.md), and the [security policy](https://github.com/gtkx-org/gtkx/blob/main/SECURITY.md). Building the repo needs Node.js
|
|
173
|
+
Contributions are welcome. See [CONTRIBUTING.md](https://github.com/gtkx-org/gtkx/blob/main/CONTRIBUTING.md), the [Code of Conduct](https://github.com/gtkx-org/gtkx/blob/main/CODE_OF_CONDUCT.md), and the [security policy](https://github.com/gtkx-org/gtkx/blob/main/SECURITY.md). Building the repo needs Node.js 26.7 or later, pnpm, and a Rust toolchain.
|
|
171
174
|
|
|
172
175
|
## License
|
|
173
176
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
|
-
/** @public */
|
|
2
1
|
export { Context } from "./context.js";
|
|
3
|
-
/** @public */
|
|
4
2
|
export { Device } from "./device.js";
|
|
5
|
-
/** @public */
|
|
6
3
|
export * from "./enums.js";
|
|
7
|
-
/** @public */
|
|
8
4
|
export { FontFace, FtFontFace, FtSynthesize, ToyFontFace } from "./font-face.js";
|
|
9
|
-
/** @public */
|
|
10
5
|
export { FontOptions } from "./font-options.js";
|
|
11
|
-
/** @public */
|
|
12
6
|
export { Matrix } from "./matrix.js";
|
|
13
|
-
/** @public */
|
|
14
7
|
export { Path } from "./path.js";
|
|
15
|
-
/** @public */
|
|
16
8
|
export { LinearPattern, MeshPattern, Pattern, RadialPattern } from "./pattern.js";
|
|
17
|
-
/** @public */
|
|
18
9
|
export { Region } from "./region.js";
|
|
19
|
-
/** @public */
|
|
20
10
|
export { ScaledFont } from "./scaled-font.js";
|
|
21
|
-
/** @public */
|
|
22
11
|
export * from "./structs.js";
|
|
23
|
-
/** @public */
|
|
24
12
|
export { ImageSurface, RecordingSurface, Surface } from "./surface.js";
|
|
25
|
-
/** @public */
|
|
26
13
|
export type * from "./types.js";
|
|
27
|
-
/** @public */
|
|
28
14
|
export { statusToString, version, versionString } from "./version.js";
|
|
29
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvE,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
/** @public */
|
|
2
1
|
export { Context } from "./context.js";
|
|
3
|
-
/** @public */
|
|
4
2
|
export { Device } from "./device.js";
|
|
5
|
-
/** @public */
|
|
6
3
|
export * from "./enums.js";
|
|
7
|
-
/** @public */
|
|
8
4
|
export { FontFace, FtFontFace, FtSynthesize, ToyFontFace } from "./font-face.js";
|
|
9
|
-
/** @public */
|
|
10
5
|
export { FontOptions } from "./font-options.js";
|
|
11
|
-
/** @public */
|
|
12
6
|
export { Matrix } from "./matrix.js";
|
|
13
|
-
/** @public */
|
|
14
7
|
export { Path } from "./path.js";
|
|
15
|
-
/** @public */
|
|
16
8
|
export { LinearPattern, MeshPattern, Pattern, RadialPattern } from "./pattern.js";
|
|
17
|
-
/** @public */
|
|
18
9
|
export { Region } from "./region.js";
|
|
19
|
-
/** @public */
|
|
20
10
|
export { ScaledFont } from "./scaled-font.js";
|
|
21
|
-
/** @public */
|
|
22
11
|
export * from "./structs.js";
|
|
23
|
-
/** @public */
|
|
24
12
|
export { ImageSurface, RecordingSurface, Surface } from "./surface.js";
|
|
25
|
-
/** @public */
|
|
26
13
|
export { statusToString, version, versionString } from "./version.js";
|
|
27
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { Context } from \"./context.js\";\nexport { Device } from \"./device.js\";\nexport * from \"./enums.js\";\nexport { FontFace, FtFontFace, FtSynthesize, ToyFontFace } from \"./font-face.js\";\nexport { FontOptions } from \"./font-options.js\";\nexport { Matrix } from \"./matrix.js\";\nexport { Path } from \"./path.js\";\nexport { LinearPattern, MeshPattern, Pattern, RadialPattern } from \"./pattern.js\";\nexport { Region } from \"./region.js\";\nexport { ScaledFont } from \"./scaled-font.js\";\nexport * from \"./structs.js\";\nexport { ImageSurface, RecordingSurface, Surface } from \"./surface.js\";\nexport type * from \"./types.js\";\nexport { statusToString, version, versionString } from \"./version.js\";\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -209,37 +209,5 @@ type InkExtents = {
|
|
|
209
209
|
/** Height of the drawn area. */
|
|
210
210
|
height: number;
|
|
211
211
|
};
|
|
212
|
-
|
|
213
|
-
type ContextConstructorProps = Record<string, never>;
|
|
214
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
215
|
-
type DeviceConstructorProps = Record<string, never>;
|
|
216
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
217
|
-
type SurfaceConstructorProps = Record<string, never>;
|
|
218
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
219
|
-
type PatternConstructorProps = Record<string, never>;
|
|
220
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
221
|
-
type RegionConstructorProps = Record<string, never>;
|
|
222
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
223
|
-
type FontOptionsConstructorProps = Record<string, never>;
|
|
224
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
225
|
-
type FontFaceConstructorProps = Record<string, never>;
|
|
226
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
227
|
-
type ScaledFontConstructorProps = Record<string, never>;
|
|
228
|
-
export type { CairoGlyph, CairoTextCluster, ClosePathSegment, ColorStop,
|
|
229
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
230
|
-
ContextConstructorProps, CurveToSegment, DashPattern,
|
|
231
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
232
|
-
DeviceConstructorProps, DeviceOffset, DeviceScale, Distance, Extents, FallbackResolution, FontExtents,
|
|
233
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
234
|
-
FontFaceConstructorProps,
|
|
235
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
236
|
-
FontOptionsConstructorProps, InkExtents, LinearPoints, LineToSegment, MoveToSegment, PathData,
|
|
237
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
238
|
-
PatternConstructorProps, Point, RadialCircles, RectangleData,
|
|
239
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
240
|
-
RegionConstructorProps, RgbaColor,
|
|
241
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
242
|
-
ScaledFontConstructorProps,
|
|
243
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
244
|
-
SurfaceConstructorProps, TextExtents, };
|
|
212
|
+
export type { CairoGlyph, CairoTextCluster, ClosePathSegment, ColorStop, CurveToSegment, DashPattern, DeviceOffset, DeviceScale, Distance, Extents, FallbackResolution, FontExtents, InkExtents, LinearPoints, LineToSegment, MoveToSegment, PathData, Point, RadialCircles, RectangleData, RgbaColor, TextExtents, };
|
|
245
213
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,KAAK,UAAU,GAAG;IACd,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,CAAC,EAAE,MAAM,CAAC;IACV,6CAA6C;IAC7C,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,uEAAuE;AACvE,KAAK,gBAAgB,GAAG;IACpB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wDAAwD;AACxD,KAAK,WAAW,GAAG;IACf,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,uCAAuC;AACvC,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,W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AAEF,uDAAuD;AACvD,KAAK,YAAY,GAAG;IAChB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,iEAAiE;AACjE,KAAK,WAAW,GAAG;IACf,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,gFAAgF;AAChF,KAAK,kBAAkB,GAAG;IACtB,kCAAkC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,+EAA+E;AAC/E,KAAK,UAAU,GAAG;IACd,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,YAAY,EACR,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,aAAa,EACb,aAAa,EACb,QAAQ,EACR,KAAK,EACL,aAAa,EACb,aAAa,EACb,SAAS,EACT,WAAW,GACd,CAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/** One glyph to draw: its index in the font and its position in user space. */\ntype CairoGlyph = {\n /** Index of the glyph in the font. */\n index: number;\n /** Horizontal position of the glyph origin. */\n x: number;\n /** Vertical position of the glyph origin. */\n y: number;\n};\n\n/** One text cluster: how many bytes of text map to how many glyphs. */\ntype CairoTextCluster = {\n /** Number of UTF-8 bytes the cluster covers. */\n numBytes: number;\n /** Number of glyphs the cluster covers. */\n numGlyphs: number;\n};\n\n/** Extents of a run of text or glyphs in user space. */\ntype TextExtents = {\n /** Horizontal distance from the origin to the leftmost part of the glyphs. */\n xBearing: number;\n /** Vertical distance from the origin to the topmost part of the glyphs. */\n yBearing: number;\n /** Width of the glyphs as drawn. */\n width: number;\n /** Height of the glyphs as drawn. */\n height: number;\n /** Horizontal distance to advance after drawing the glyphs. */\n xAdvance: number;\n /** Vertical distance to advance after drawing the glyphs. */\n yAdvance: number;\n};\n\n/** Metrics of a font in user space. */\ntype FontExtents = {\n /** Distance the font extends above the baseline. */\n ascent: number;\n /** Distance the font extends below the baseline. */\n descent: number;\n /** Recommended vertical distance between baselines. */\n height: number;\n /** Maximum horizontal advance of any glyph in the font. */\n maxXAdvance: number;\n /** Maximum vertical advance of any glyph in the font. */\n maxYAdvance: number;\n};\n\n/** A path segment starting a new sub-path at a point. */\ntype MoveToSegment = {\n /** Tag of the segment. */\n type: \"moveTo\";\n /** Horizontal position of the point. */\n x: number;\n /** Vertical position of the point. */\n y: number;\n};\n\n/** A path segment drawing a straight line to a point. */\ntype LineToSegment = {\n /** Tag of the segment. */\n type: \"lineTo\";\n /** Horizontal position of the end point. */\n x: number;\n /** Vertical position of the end point. */\n y: number;\n};\n\n/** A path segment drawing a cubic Bézier curve through two control points to an end point. */\ntype CurveToSegment = {\n /** Tag of the segment. */\n type: \"curveTo\";\n /** Horizontal position of the first control point. */\n x1: number;\n /** Vertical position of the first control point. */\n y1: number;\n /** Horizontal position of the second control point. */\n x2: number;\n /** Vertical position of the second control point. */\n y2: number;\n /** Horizontal position of the end point. */\n x3: number;\n /** Vertical position of the end point. */\n y3: number;\n};\n\n/** A path segment closing the current sub-path. */\ntype ClosePathSegment = {\n /** Tag of the segment. */\n type: \"closePath\";\n};\n\n/** One segment of a path copied out of a context or a mesh pattern. */\ntype PathData = MoveToSegment | LineToSegment | CurveToSegment | ClosePathSegment;\n\n/** A position in user or device space. */\ntype Point = {\n /** Horizontal coordinate. */\n x: number;\n /** Vertical coordinate. */\n y: number;\n};\n\n/** A displacement in user or device space, unaffected by translation. */\ntype Distance = {\n /** Horizontal component. */\n dx: number;\n /** Vertical component. */\n dy: number;\n};\n\n/** A bounding box given by its two opposite corners in user space. */\ntype Extents = {\n /** Left edge. */\n x1: number;\n /** Top edge. */\n y1: number;\n /** Right edge. */\n x2: number;\n /** Bottom edge. */\n y2: number;\n};\n\n/** A dash pattern as a context reports it: alternating on and off lengths and the offset into them. */\ntype DashPattern = {\n /** Alternating on and off lengths in user space; empty for a solid line. */\n dashes: number[];\n /** Offset into the pattern at which the stroke starts. */\n offset: number;\n};\n\n/** A rectangle as plain data, for the calls that take or return many at once. */\ntype RectangleData = {\n /** Horizontal position of the left edge. */\n x: number;\n /** Vertical position of the top edge. */\n y: number;\n /** Width of the rectangle. */\n width: number;\n /** Height of the rectangle. */\n height: number;\n};\n\n/** A color with straight (non-premultiplied) components in the 0 to 1 range. */\ntype RgbaColor = {\n /** Red component. */\n red: number;\n /** Green component. */\n green: number;\n /** Blue component. */\n blue: number;\n /** Alpha component. */\n alpha: number;\n};\n\n/** A color stop of a gradient pattern: its offset along the gradient and its color. */\ntype ColorStop = {\n /** Position of the stop along the gradient, from 0 at the start to 1 at the end. */\n offset: number;\n /** Red component. */\n red: number;\n /** Green component. */\n green: number;\n /** Blue component. */\n blue: number;\n /** Alpha component. */\n alpha: number;\n};\n\n/** The two end points of a linear gradient in pattern space. */\ntype LinearPoints = {\n /** Horizontal coordinate of the start point. */\n x0: number;\n /** Vertical coordinate of the start point. */\n y0: number;\n /** Horizontal coordinate of the end point. */\n x1: number;\n /** Vertical coordinate of the end point. */\n y1: number;\n};\n\n/** The two circles of a radial gradient in pattern space. */\ntype RadialCircles = {\n /** Horizontal center of the start circle. */\n x0: number;\n /** Vertical center of the start circle. */\n y0: number;\n /** Radius of the start circle. */\n r0: number;\n /** Horizontal center of the end circle. */\n x1: number;\n /** Vertical center of the end circle. */\n y1: number;\n /** Radius of the end circle. */\n r1: number;\n};\n\n/** The offset a surface adds to device coordinates. */\ntype DeviceOffset = {\n /** Horizontal offset in device units. */\n xOffset: number;\n /** Vertical offset in device units. */\n yOffset: number;\n};\n\n/** The scale a surface applies between user and device units. */\ntype DeviceScale = {\n /** Horizontal scale factor. */\n xScale: number;\n /** Vertical scale factor. */\n yScale: number;\n};\n\n/** The resolution a surface falls back to when it rasterizes vector content. */\ntype FallbackResolution = {\n /** Horizontal pixels per inch. */\n xPixelsPerInch: number;\n /** Vertical pixels per inch. */\n yPixelsPerInch: number;\n};\n\n/** The area a recording surface has been drawn on, in its coordinate space. */\ntype InkExtents = {\n /** Horizontal position of the left edge. */\n x0: number;\n /** Vertical position of the top edge. */\n y0: number;\n /** Width of the drawn area. */\n width: number;\n /** Height of the drawn area. */\n height: number;\n};\n\
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/** One glyph to draw: its index in the font and its position in user space. */\ntype CairoGlyph = {\n /** Index of the glyph in the font. */\n index: number;\n /** Horizontal position of the glyph origin. */\n x: number;\n /** Vertical position of the glyph origin. */\n y: number;\n};\n\n/** One text cluster: how many bytes of text map to how many glyphs. */\ntype CairoTextCluster = {\n /** Number of UTF-8 bytes the cluster covers. */\n numBytes: number;\n /** Number of glyphs the cluster covers. */\n numGlyphs: number;\n};\n\n/** Extents of a run of text or glyphs in user space. */\ntype TextExtents = {\n /** Horizontal distance from the origin to the leftmost part of the glyphs. */\n xBearing: number;\n /** Vertical distance from the origin to the topmost part of the glyphs. */\n yBearing: number;\n /** Width of the glyphs as drawn. */\n width: number;\n /** Height of the glyphs as drawn. */\n height: number;\n /** Horizontal distance to advance after drawing the glyphs. */\n xAdvance: number;\n /** Vertical distance to advance after drawing the glyphs. */\n yAdvance: number;\n};\n\n/** Metrics of a font in user space. */\ntype FontExtents = {\n /** Distance the font extends above the baseline. */\n ascent: number;\n /** Distance the font extends below the baseline. */\n descent: number;\n /** Recommended vertical distance between baselines. */\n height: number;\n /** Maximum horizontal advance of any glyph in the font. */\n maxXAdvance: number;\n /** Maximum vertical advance of any glyph in the font. */\n maxYAdvance: number;\n};\n\n/** A path segment starting a new sub-path at a point. */\ntype MoveToSegment = {\n /** Tag of the segment. */\n type: \"moveTo\";\n /** Horizontal position of the point. */\n x: number;\n /** Vertical position of the point. */\n y: number;\n};\n\n/** A path segment drawing a straight line to a point. */\ntype LineToSegment = {\n /** Tag of the segment. */\n type: \"lineTo\";\n /** Horizontal position of the end point. */\n x: number;\n /** Vertical position of the end point. */\n y: number;\n};\n\n/** A path segment drawing a cubic Bézier curve through two control points to an end point. */\ntype CurveToSegment = {\n /** Tag of the segment. */\n type: \"curveTo\";\n /** Horizontal position of the first control point. */\n x1: number;\n /** Vertical position of the first control point. */\n y1: number;\n /** Horizontal position of the second control point. */\n x2: number;\n /** Vertical position of the second control point. */\n y2: number;\n /** Horizontal position of the end point. */\n x3: number;\n /** Vertical position of the end point. */\n y3: number;\n};\n\n/** A path segment closing the current sub-path. */\ntype ClosePathSegment = {\n /** Tag of the segment. */\n type: \"closePath\";\n};\n\n/** One segment of a path copied out of a context or a mesh pattern. */\ntype PathData = MoveToSegment | LineToSegment | CurveToSegment | ClosePathSegment;\n\n/** A position in user or device space. */\ntype Point = {\n /** Horizontal coordinate. */\n x: number;\n /** Vertical coordinate. */\n y: number;\n};\n\n/** A displacement in user or device space, unaffected by translation. */\ntype Distance = {\n /** Horizontal component. */\n dx: number;\n /** Vertical component. */\n dy: number;\n};\n\n/** A bounding box given by its two opposite corners in user space. */\ntype Extents = {\n /** Left edge. */\n x1: number;\n /** Top edge. */\n y1: number;\n /** Right edge. */\n x2: number;\n /** Bottom edge. */\n y2: number;\n};\n\n/** A dash pattern as a context reports it: alternating on and off lengths and the offset into them. */\ntype DashPattern = {\n /** Alternating on and off lengths in user space; empty for a solid line. */\n dashes: number[];\n /** Offset into the pattern at which the stroke starts. */\n offset: number;\n};\n\n/** A rectangle as plain data, for the calls that take or return many at once. */\ntype RectangleData = {\n /** Horizontal position of the left edge. */\n x: number;\n /** Vertical position of the top edge. */\n y: number;\n /** Width of the rectangle. */\n width: number;\n /** Height of the rectangle. */\n height: number;\n};\n\n/** A color with straight (non-premultiplied) components in the 0 to 1 range. */\ntype RgbaColor = {\n /** Red component. */\n red: number;\n /** Green component. */\n green: number;\n /** Blue component. */\n blue: number;\n /** Alpha component. */\n alpha: number;\n};\n\n/** A color stop of a gradient pattern: its offset along the gradient and its color. */\ntype ColorStop = {\n /** Position of the stop along the gradient, from 0 at the start to 1 at the end. */\n offset: number;\n /** Red component. */\n red: number;\n /** Green component. */\n green: number;\n /** Blue component. */\n blue: number;\n /** Alpha component. */\n alpha: number;\n};\n\n/** The two end points of a linear gradient in pattern space. */\ntype LinearPoints = {\n /** Horizontal coordinate of the start point. */\n x0: number;\n /** Vertical coordinate of the start point. */\n y0: number;\n /** Horizontal coordinate of the end point. */\n x1: number;\n /** Vertical coordinate of the end point. */\n y1: number;\n};\n\n/** The two circles of a radial gradient in pattern space. */\ntype RadialCircles = {\n /** Horizontal center of the start circle. */\n x0: number;\n /** Vertical center of the start circle. */\n y0: number;\n /** Radius of the start circle. */\n r0: number;\n /** Horizontal center of the end circle. */\n x1: number;\n /** Vertical center of the end circle. */\n y1: number;\n /** Radius of the end circle. */\n r1: number;\n};\n\n/** The offset a surface adds to device coordinates. */\ntype DeviceOffset = {\n /** Horizontal offset in device units. */\n xOffset: number;\n /** Vertical offset in device units. */\n yOffset: number;\n};\n\n/** The scale a surface applies between user and device units. */\ntype DeviceScale = {\n /** Horizontal scale factor. */\n xScale: number;\n /** Vertical scale factor. */\n yScale: number;\n};\n\n/** The resolution a surface falls back to when it rasterizes vector content. */\ntype FallbackResolution = {\n /** Horizontal pixels per inch. */\n xPixelsPerInch: number;\n /** Vertical pixels per inch. */\n yPixelsPerInch: number;\n};\n\n/** The area a recording surface has been drawn on, in its coordinate space. */\ntype InkExtents = {\n /** Horizontal position of the left edge. */\n x0: number;\n /** Vertical position of the top edge. */\n y0: number;\n /** Width of the drawn area. */\n width: number;\n /** Height of the drawn area. */\n height: number;\n};\n\nexport type {\n CairoGlyph,\n CairoTextCluster,\n ClosePathSegment,\n ColorStop,\n CurveToSegment,\n DashPattern,\n DeviceOffset,\n DeviceScale,\n Distance,\n Extents,\n FallbackResolution,\n FontExtents,\n InkExtents,\n LinearPoints,\n LineToSegment,\n MoveToSegment,\n PathData,\n Point,\n RadialCircles,\n RectangleData,\n RgbaColor,\n TextExtents,\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/cairo",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Cairo drawing
|
|
3
|
+
"version": "2.0.0-beta.10",
|
|
4
|
+
"description": "Cairo drawing for GTKX GNOME apps: contexts, surfaces, patterns, fonts.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtkx",
|
|
7
7
|
"gtk",
|
|
8
8
|
"gtk4",
|
|
9
|
+
"adwaita",
|
|
10
|
+
"gnome",
|
|
9
11
|
"cairo",
|
|
10
12
|
"drawing",
|
|
11
13
|
"graphics",
|
|
@@ -29,6 +31,8 @@
|
|
|
29
31
|
"./package.json": "./package.json",
|
|
30
32
|
".": {
|
|
31
33
|
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js",
|
|
35
|
+
"require": null,
|
|
32
36
|
"default": "./dist/index.js"
|
|
33
37
|
}
|
|
34
38
|
},
|
|
@@ -47,15 +51,15 @@
|
|
|
47
51
|
}
|
|
48
52
|
},
|
|
49
53
|
"engines": {
|
|
50
|
-
"node": ">=
|
|
54
|
+
"node": ">=26.7.0"
|
|
51
55
|
},
|
|
52
56
|
"dependencies": {
|
|
53
|
-
"@gtkx/runtime": "
|
|
57
|
+
"@gtkx/runtime": "2.0.0-beta.10"
|
|
54
58
|
},
|
|
55
59
|
"devDependencies": {
|
|
56
|
-
"@
|
|
57
|
-
"
|
|
58
|
-
"
|
|
60
|
+
"@gtkx/vitest": "2.0.0-beta.10",
|
|
61
|
+
"@types/node": "^26.5.0",
|
|
62
|
+
"fast-xml-parser": "^5.11.1"
|
|
59
63
|
},
|
|
60
64
|
"scripts": {
|
|
61
65
|
"release": "tsx ../../scripts/release-package.ts"
|
package/src/index.ts
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
/** @public */
|
|
2
1
|
export { Context } from "./context.js";
|
|
3
|
-
/** @public */
|
|
4
2
|
export { Device } from "./device.js";
|
|
5
|
-
/** @public */
|
|
6
3
|
export * from "./enums.js";
|
|
7
|
-
/** @public */
|
|
8
4
|
export { FontFace, FtFontFace, FtSynthesize, ToyFontFace } from "./font-face.js";
|
|
9
|
-
/** @public */
|
|
10
5
|
export { FontOptions } from "./font-options.js";
|
|
11
|
-
/** @public */
|
|
12
6
|
export { Matrix } from "./matrix.js";
|
|
13
|
-
/** @public */
|
|
14
7
|
export { Path } from "./path.js";
|
|
15
|
-
/** @public */
|
|
16
8
|
export { LinearPattern, MeshPattern, Pattern, RadialPattern } from "./pattern.js";
|
|
17
|
-
/** @public */
|
|
18
9
|
export { Region } from "./region.js";
|
|
19
|
-
/** @public */
|
|
20
10
|
export { ScaledFont } from "./scaled-font.js";
|
|
21
|
-
/** @public */
|
|
22
11
|
export * from "./structs.js";
|
|
23
|
-
/** @public */
|
|
24
12
|
export { ImageSurface, RecordingSurface, Surface } from "./surface.js";
|
|
25
|
-
/** @public */
|
|
26
13
|
export type * from "./types.js";
|
|
27
|
-
/** @public */
|
|
28
14
|
export { statusToString, version, versionString } from "./version.js";
|
package/src/types.ts
CHANGED
|
@@ -231,60 +231,27 @@ type InkExtents = {
|
|
|
231
231
|
height: number;
|
|
232
232
|
};
|
|
233
233
|
|
|
234
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
235
|
-
type ContextConstructorProps = Record<string, never>;
|
|
236
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
237
|
-
type DeviceConstructorProps = Record<string, never>;
|
|
238
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
239
|
-
type SurfaceConstructorProps = Record<string, never>;
|
|
240
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
241
|
-
type PatternConstructorProps = Record<string, never>;
|
|
242
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
243
|
-
type RegionConstructorProps = Record<string, never>;
|
|
244
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
245
|
-
type FontOptionsConstructorProps = Record<string, never>;
|
|
246
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
247
|
-
type FontFaceConstructorProps = Record<string, never>;
|
|
248
|
-
/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
|
|
249
|
-
type ScaledFontConstructorProps = Record<string, never>;
|
|
250
|
-
|
|
251
234
|
export type {
|
|
252
235
|
CairoGlyph,
|
|
253
236
|
CairoTextCluster,
|
|
254
237
|
ClosePathSegment,
|
|
255
238
|
ColorStop,
|
|
256
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
257
|
-
ContextConstructorProps,
|
|
258
239
|
CurveToSegment,
|
|
259
240
|
DashPattern,
|
|
260
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
261
|
-
DeviceConstructorProps,
|
|
262
241
|
DeviceOffset,
|
|
263
242
|
DeviceScale,
|
|
264
243
|
Distance,
|
|
265
244
|
Extents,
|
|
266
245
|
FallbackResolution,
|
|
267
246
|
FontExtents,
|
|
268
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
269
|
-
FontFaceConstructorProps,
|
|
270
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
271
|
-
FontOptionsConstructorProps,
|
|
272
247
|
InkExtents,
|
|
273
248
|
LinearPoints,
|
|
274
249
|
LineToSegment,
|
|
275
250
|
MoveToSegment,
|
|
276
251
|
PathData,
|
|
277
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
278
|
-
PatternConstructorProps,
|
|
279
252
|
Point,
|
|
280
253
|
RadialCircles,
|
|
281
254
|
RectangleData,
|
|
282
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
283
|
-
RegionConstructorProps,
|
|
284
255
|
RgbaColor,
|
|
285
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
286
|
-
ScaledFontConstructorProps,
|
|
287
|
-
/** @deprecated Since 1.3. Removed in v2. */
|
|
288
|
-
SurfaceConstructorProps,
|
|
289
256
|
TextExtents,
|
|
290
257
|
};
|