@girs/papersview-4.0 4.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.
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+
2
+ # PapersView-4.0
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/papersview-4.0)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/papersview-4.0)
6
+
7
+
8
+ GJS TypeScript type definitions for PapersView-4.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.2.0.
9
+
10
+ ## Install
11
+
12
+ Install the type definitions with npm:
13
+ ```bash
14
+ npm install @girs/papersview-4.0
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Import it like any other module:
20
+ ```ts
21
+ import PapersView from '@girs/papersview-4.0';
22
+ ```
23
+
24
+ ### Ambient Modules
25
+
26
+ [Ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) let you write the same import you would in plain JavaScript.
27
+ For this you need to include `@girs/papersview-4.0` or `@girs/papersview-4.0/ambient` in your `tsconfig` or entry point Typescript file:
28
+
29
+ `index.ts`:
30
+ ```ts
31
+ import '@girs/papersview-4.0'
32
+ ```
33
+
34
+ `tsconfig.json`:
35
+ ```json
36
+ {
37
+ "compilerOptions": {
38
+ ...
39
+ },
40
+ "include": ["@girs/papersview-4.0"],
41
+ ...
42
+ }
43
+ ```
44
+
45
+ The ambient module now resolves with types:
46
+
47
+ ```ts
48
+ import PapersView from 'gi://PapersView?version=4.0';
49
+ ```
50
+
51
+ ### Global import
52
+
53
+ GJS's global `imports.gi` works too, with types.
54
+ For this you need to include `@girs/papersview-4.0` or `@girs/papersview-4.0/import` in your `tsconfig` or entry point Typescript file:
55
+
56
+ `index.ts`:
57
+ ```ts
58
+ import '@girs/papersview-4.0'
59
+ ```
60
+
61
+ `tsconfig.json`:
62
+ ```json
63
+ {
64
+ "compilerOptions": {
65
+ ...
66
+ },
67
+ "include": ["@girs/papersview-4.0"],
68
+ ...
69
+ }
70
+ ```
71
+
72
+ That form carries types as well:
73
+
74
+ ```ts
75
+ const PapersView = imports.gi.PapersView;
76
+ ```
77
+
78
+ ### Bundle
79
+
80
+ Most projects want a bundler. [esbuild](https://esbuild.github.io/) is the smallest thing that works; the [examples directory](https://github.com/gjsify/ts-for-gir/tree/main/examples) has setups for several others.
81
+
82
+ ## Other packages
83
+
84
+ All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
85
+
package/index.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Type Definitions for Gjs (https://gjs.guide/)
3
+ *
4
+ * These type definitions are automatically generated, do not edit them by hand.
5
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
6
+ *
7
+ * This template is used to generate the index.d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
8
+ */
9
+
10
+ import './papersview-4.0-ambient.d.ts';
11
+
12
+ import './papersview-4.0-import.d.ts';
13
+
14
+ import PapersView from './papersview-4.0.js';
15
+ export default PapersView;
16
+
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import PapersView from './papersview-4.0.js';
4
+ export default PapersView;
5
+
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@girs/papersview-4.0",
3
+ "version": "4.2.0",
4
+ "description": "GJS TypeScript type definitions for PapersView-4.0",
5
+ "type": "module",
6
+ "module": "papersview-4.0.js",
7
+ "main": "papersview-4.0.js",
8
+ "exports": {
9
+ "./ambient": {
10
+ "types": "./papersview-4.0-ambient.d.ts",
11
+ "import": "./papersview-4.0-ambient.js",
12
+ "default": "./papersview-4.0-ambient.js"
13
+ },
14
+ "./import": {
15
+ "types": "./papersview-4.0-import.d.ts",
16
+ "import": "./papersview-4.0-import.js",
17
+ "default": "./papersview-4.0-import.js"
18
+ },
19
+ "./surface": {
20
+ "types": "./papersview-4.0-surface.d.ts",
21
+ "import": "./papersview-4.0-surface.js",
22
+ "default": "./papersview-4.0-surface.js"
23
+ },
24
+ "./papersview-4.0": {
25
+ "types": "./papersview-4.0.d.ts",
26
+ "import": "./papersview-4.0.js",
27
+ "default": "./papersview-4.0.js"
28
+ },
29
+ ".": {
30
+ "types": "./index.d.ts",
31
+ "import": "./index.js",
32
+ "default": "./index.js"
33
+ }
34
+ },
35
+ "scripts": {
36
+ "test": "tsc --project tsconfig.json"
37
+ },
38
+ "dependencies": {
39
+ "@girs/gjs": "^4.2.0",
40
+ "@girs/papersdocument-4.0": "^4.2.0",
41
+ "@girs/pango-1.0": "^4.2.0",
42
+ "@girs/cairo-1.0": "^4.2.0",
43
+ "@girs/gobject-2.0": "^4.2.0",
44
+ "@girs/glib-2.0": "^4.2.0",
45
+ "@girs/harfbuzz-0.0": "^4.2.0",
46
+ "@girs/freetype2-2.0": "^4.2.0",
47
+ "@girs/gio-2.0": "^4.2.0",
48
+ "@girs/gmodule-2.0": "^4.2.0",
49
+ "@girs/gtk-4.0": "^4.2.0",
50
+ "@girs/gsk-4.0": "^4.2.0",
51
+ "@girs/graphene-1.0": "^4.2.0",
52
+ "@girs/gdk-4.0": "^4.2.0",
53
+ "@girs/pangocairo-1.0": "^4.2.0",
54
+ "@girs/gdkpixbuf-2.0": "^4.2.0"
55
+ },
56
+ "devDependencies": {
57
+ "typescript": "*"
58
+ },
59
+ "keywords": [
60
+ "Gir",
61
+ "TypeScript",
62
+ "types",
63
+ "GObject-Introspection",
64
+ "GJS",
65
+ "PapersView-4.0"
66
+ ],
67
+ "author": "ts-for-gir",
68
+ "license": "MIT",
69
+ "repository": {
70
+ "type": "git",
71
+ "url": "git+https://github.com/gjsify/types.git"
72
+ },
73
+ "bugs": {
74
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
75
+ },
76
+ "homepage": "https://github.com/gjsify/types/tree/main/papersview-4.0#readme"
77
+ }
@@ -0,0 +1,12 @@
1
+
2
+ declare module 'gi://PapersView?version=4.0' {
3
+ import PapersView40 from '@girs/papersview-4.0';
4
+ export default PapersView40;
5
+ }
6
+
7
+ declare module 'gi://PapersView' {
8
+ import PapersView40 from 'gi://PapersView?version=4.0';
9
+ export default PapersView40;
10
+ }
11
+
12
+
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,12 @@
1
+
2
+ import type PapersView40 from '@girs/papersview-4.0';
3
+
4
+ declare global {
5
+ export interface GjsGiImports {
6
+ PapersView: typeof PapersView40;
7
+ }
8
+ }
9
+
10
+ export default GjsGiImports;
11
+
12
+
@@ -0,0 +1,3 @@
1
+ const gi = globalThis.imports?.gi || {};
2
+ export default gi;
3
+
@@ -0,0 +1,156 @@
1
+ /**
2
+ * The GIR-derived widget VOCABULARY for PapersView-4.0.
3
+ *
4
+ * GENERATED — do not edit. Provenance: PapersView-4.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object
5
+ *
6
+ * 2 concrete widgets, 2 declarations, 4 enum nick unions, 0 slot candidates.
7
+ *
8
+ * Module-scoped exports only. There is no `JSX` namespace here, no tag spelling and
9
+ * no `on<Signal>` prop name: those are DIALECT, and every framework answers them
10
+ * differently. The shape to avoid is the GLOBAL AUGMENT — a `declare global` on
11
+ * `React.JSX` collides with every other library on a shared tag — while a
12
+ * module-scoped `JSX` behind a `jsxImportSource` does not. This package is used by
13
+ * projects that want nothing to do with JSX, so it emits neither; a consumer declaring
14
+ * a module-scoped namespace over these names is doing it right.
15
+ *
16
+ * Three things this is and `ConstructorProps` is not: WRITABLE-only (measured on
17
+ * Gtk-4.0, `ConstructorProps` offers 150 read-only properties across 68 classes as
18
+ * settable, and GTK's failure mode for writing one is exit 0), OPTIONAL, and keyed
19
+ * by the name GObject actually REGISTERED — the dashed spelling `g_object_set`,
20
+ * GtkBuilder XML and Blueprint all use.
21
+ *
22
+ * Signal handler types are not re-derived: `X.SignalSignatures`, which this package
23
+ * already emits for every class with the parent chain, every implemented interface
24
+ * and the `notify::` keys folded in, is what `Widgets[G]['signals']` points at.
25
+ */
26
+
27
+ import type PapersDocument from '@girs/papersdocument-4.0';
28
+ import type PapersView from './papersview-4.0.js';
29
+ import type { GtkAccessibleConstructOnly, GtkAccessibleProps, GtkBuildableConstructOnly, GtkBuildableProps, GtkConstraintTargetConstructOnly, GtkConstraintTargetProps, GtkScrollableConstructOnly, GtkScrollableProps, GtkWidgetConstructOnly, GtkWidgetProps } from '@girs/gtk-4.0/surface';
30
+
31
+ // ---------------------------------------------------------------------------
32
+ // Enum nicks — the string vocabulary GObject registered, from GIR's `glib:nick`.
33
+ //
34
+ // Not derived from the member name. Substituting underscores for dashes is not a law:
35
+ // some nicks keep an underscore the substitution would have replaced, and only the
36
+ // attribute knows which. Gtk-4.0 and Adw-1 contradict no derivation at all, which is
37
+ // how a derived nick passes review and breaks elsewhere.
38
+ // Re-measure with `scripts/check-nick-derivation.mjs` in ts-for-gir.
39
+ // ---------------------------------------------------------------------------
40
+
41
+ export type PpsAnnotationToolNick = 'pencil' | 'highlight' | 'eraser' | 'text' | 'max';
42
+ export type PpsJobPriorityNick = 'priority-urgent' | 'priority-high' | 'priority-low' | 'priority-none' | 'n-priorities';
43
+ export type PpsPageLayoutNick = 'single' | 'dual' | 'automatic';
44
+ export type PpsSizingModeNick = 'fit-page' | 'fit-width' | 'free' | 'automatic';
45
+
46
+ // ---------------------------------------------------------------------------
47
+ // Property surfaces — one interface per GIR DECLARATION, mirroring GIR's own
48
+ // inheritance rather than flattening per widget.
49
+ //
50
+ // The interfaces are load-bearing, not tidiness: `GtkBox` declares four properties
51
+ // of its own and `orientation` is not among them — it lives on `Gtk.Orientable`,
52
+ // because GObject installs interface properties on the implementor at runtime while
53
+ // GIR keeps them once, on the interface.
54
+ // ---------------------------------------------------------------------------
55
+
56
+ export interface PpsViewProps extends GtkWidgetProps, GtkAccessibleProps, GtkBuildableProps, GtkConstraintTargetProps, GtkScrollableProps {
57
+ 'annotations-context'?: PapersView.AnnotationsContext;
58
+ model?: PapersView.DocumentModel;
59
+ 'search-context'?: PapersView.SearchContext;
60
+ }
61
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
62
+ export type PpsViewConstructOnly = GtkWidgetConstructOnly | GtkAccessibleConstructOnly | GtkBuildableConstructOnly | GtkConstraintTargetConstructOnly | GtkScrollableConstructOnly;
63
+
64
+ export interface PpsViewPresentationProps extends GtkWidgetProps, GtkAccessibleProps, GtkBuildableProps, GtkConstraintTargetProps {
65
+ 'current-page'?: number;
66
+ document?: PapersDocument.Document;
67
+ 'inverted-colors'?: boolean;
68
+ rotation?: number;
69
+ }
70
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
71
+ export type PpsViewPresentationConstructOnly = GtkWidgetConstructOnly | GtkAccessibleConstructOnly | GtkBuildableConstructOnly | GtkConstraintTargetConstructOnly;
72
+
73
+ // ---------------------------------------------------------------------------
74
+ // The GType-keyed widget map.
75
+ //
76
+ // Keyed by GType because that is also the GtkBuilder XML key and the typelib key. A
77
+ // consumer maps GTypes to tags in ITS convention — kebab for JSX intrinsics, Pascal
78
+ // for a Vue `GlobalComponents`, the class itself for a renderer whose element type
79
+ // is the class. None of those is baked in here.
80
+ //
81
+ // `slotCandidates` is a candidate list and never an answer: derived from methods
82
+ // taking exactly one widget argument. The GIR cannot tell adoption from reference —
83
+ // `set_title_widget` parents its argument and `set_activatable_widget` does not, and
84
+ // both are `void f(GtkWidget*)` at `transfer-ownership="none"`. Curation decides;
85
+ // this is what notices when a release adds a candidate.
86
+ // ---------------------------------------------------------------------------
87
+
88
+ export interface Widgets {
89
+ PpsView: {
90
+ class: PapersView.View;
91
+ props: PpsViewProps;
92
+ signals: PapersView.View.SignalSignatures;
93
+ constructOnly: PpsViewConstructOnly;
94
+ slotCandidates: {};
95
+ };
96
+ PpsViewPresentation: {
97
+ class: PapersView.ViewPresentation;
98
+ props: PpsViewPresentationProps;
99
+ signals: PapersView.ViewPresentation.SignalSignatures;
100
+ constructOnly: PpsViewPresentationConstructOnly;
101
+ slotCandidates: {};
102
+ };
103
+ }
104
+
105
+ /** Every GType this namespace can create. A consumer derives its own tag map. */
106
+ export type WidgetGType = keyof Widgets;
107
+
108
+ /** The writable, optional, GObject-keyed property surface of one GType. */
109
+ export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
110
+
111
+ /** The signal table this package already emits, reached by GType. */
112
+ export type SignalsOf<G extends WidgetGType> = Widgets[G]['signals'];
113
+
114
+ /** The instance type — what a `ref`-shaped prop should infer. */
115
+ export type InstanceOf<G extends WidgetGType> = Widgets[G]['class'];
116
+
117
+ /** Property names that can only be set at construction. */
118
+ export type ConstructOnlyOf<G extends WidgetGType> = Widgets[G]['constructOnly'];
119
+
120
+ /** Candidate child slots — see the note above; curation decides. */
121
+ export type SlotCandidatesOf<G extends WidgetGType> = keyof Widgets[G]['slotCandidates'];
122
+
123
+ /**
124
+ * The same facts as runtime data, for a consumer that CHECKS them.
125
+ *
126
+ * Types are erased, so a spec that asks the installed GTK whether every property
127
+ * here is a writable ParamSpec, every signal resolvable by `GObject.signal_lookup`
128
+ * and every nick resolvable through an enum lookup cannot read the interfaces
129
+ * above. Emitted headlessly with no GTK present, which is exactly why the checking
130
+ * belongs to the consumer and the DATA belongs here.
131
+ */
132
+ export const SURFACE_PROVENANCE: string;
133
+
134
+ /** Declaration GType -> its own settable properties, as GObject registered them. */
135
+ export const OWN_PROPS: Readonly<Record<string, readonly string[]>>;
136
+
137
+ /** Widget GType -> its own signals. */
138
+ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
139
+
140
+ /** Widget GType -> every declaration its members come from, self first. */
141
+ export const DECLS: Readonly<Record<string, readonly string[]>>;
142
+
143
+ /** Enum GType -> the nicks this surface offers. */
144
+ export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
145
+
146
+ /** Widget GType -> slot name -> the method that may adopt a child there. */
147
+ export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
148
+
149
+ /**
150
+ * `Type.property` -> the release that introduced it.
151
+ *
152
+ * What keeps a runtime cross-check honest across a version gap without an
153
+ * allowlist: a member the installed library lacks is a defect UNLESS the version
154
+ * here is newer than the one running.
155
+ */
156
+ export const SINCE: Readonly<Record<string, string>>;
@@ -0,0 +1,35 @@
1
+ // The widget vocabulary of PapersView-4.0 as runtime data.
2
+ //
3
+ // GENERATED — do not edit. Provenance: PapersView-4.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object
4
+ //
5
+ // The type half of this subpath is the sibling `.d.ts`. This file exists because
6
+ // types are erased: a consumer that wants to ask the installed library whether every
7
+ // name here is real needs values, not declarations.
8
+
9
+ export const SURFACE_PROVENANCE = 'PapersView-4.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object';
10
+
11
+ export const OWN_PROPS = {
12
+ PpsView: ['annotations-context', 'model', 'search-context'],
13
+ PpsViewPresentation: ['current-page', 'document', 'inverted-colors', 'rotation'],
14
+ };
15
+
16
+ export const OWN_SIGNALS = {
17
+ PpsView: ['activate', 'cursor-moved', 'external-link', 'handle-link', 'layers-changed', 'move-cursor', 'popup', 'scroll', 'selection-changed', 'signature-rect'],
18
+ PpsViewPresentation: ['change-page', 'external-link', 'finished'],
19
+ };
20
+
21
+ export const DECLS = {
22
+ PpsView: ['PpsView', 'GtkWidget', 'GtkAccessible', 'GtkBuildable', 'GtkConstraintTarget', 'GtkScrollable'],
23
+ PpsViewPresentation: ['PpsViewPresentation', 'GtkWidget', 'GtkAccessible', 'GtkBuildable', 'GtkConstraintTarget'],
24
+ };
25
+
26
+ export const ENUM_NICKS = {
27
+ PpsAnnotationTool: ['pencil', 'highlight', 'eraser', 'text', 'max'],
28
+ PpsJobPriority: ['priority-urgent', 'priority-high', 'priority-low', 'priority-none', 'n-priorities'],
29
+ PpsPageLayout: ['single', 'dual', 'automatic'],
30
+ PpsSizingMode: ['fit-page', 'fit-width', 'free', 'automatic'],
31
+ };
32
+
33
+ export const SLOT_CANDIDATES = {};
34
+
35
+ export const SINCE = {};