@girs/coglpango-8 8.0.0-4.0.0-beta.38
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 +85 -0
- package/coglpango-8-ambient.d.ts +9 -0
- package/coglpango-8-ambient.js +2 -0
- package/coglpango-8-import.d.ts +1 -0
- package/coglpango-8-import.js +3 -0
- package/coglpango-8.d.ts +155 -0
- package/coglpango-8.js +5 -0
- package/index.d.ts +13 -0
- package/index.js +5 -0
- package/package.json +63 -0
- package/tsconfig.json +25 -0
- package/typedoc.json +7 -0
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
# CoglPango-8
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
GJS TypeScript type definitions for CoglPango-8, generated from library version 8.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.38.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
To use this type definitions, install them with NPM:
|
|
13
|
+
```bash
|
|
14
|
+
npm install @girs/coglpango-8
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
You can import this package into your project like this:
|
|
20
|
+
```ts
|
|
21
|
+
import CoglPango from '@girs/coglpango-8';
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Ambient Modules
|
|
25
|
+
|
|
26
|
+
You can also use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) to import this module like you would do this in JavaScript.
|
|
27
|
+
For this you need to include `@girs/coglpango-8` or `@girs/coglpango-8/ambient` in your `tsconfig` or entry point Typescript file:
|
|
28
|
+
|
|
29
|
+
`index.ts`:
|
|
30
|
+
```ts
|
|
31
|
+
import '@girs/coglpango-8'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`tsconfig.json`:
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"compilerOptions": {
|
|
38
|
+
...
|
|
39
|
+
},
|
|
40
|
+
"include": ["@girs/coglpango-8"],
|
|
41
|
+
...
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Now you can import the ambient module with TypeScript support:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import CoglPango from 'gi://CoglPango?version=8';
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Global import
|
|
52
|
+
|
|
53
|
+
You can also import the module with Typescript support using the global `imports.gi` object of GJS.
|
|
54
|
+
For this you need to include `@girs/coglpango-8` or `@girs/coglpango-8/import` in your `tsconfig` or entry point Typescript file:
|
|
55
|
+
|
|
56
|
+
`index.ts`:
|
|
57
|
+
```ts
|
|
58
|
+
import '@girs/coglpango-8'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`tsconfig.json`:
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"compilerOptions": {
|
|
65
|
+
...
|
|
66
|
+
},
|
|
67
|
+
"include": ["@girs/coglpango-8"],
|
|
68
|
+
...
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Now you have also type support for this, too:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
const CoglPango = imports.gi.CoglPango;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Bundle
|
|
79
|
+
|
|
80
|
+
Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
|
|
81
|
+
|
|
82
|
+
## Other packages
|
|
83
|
+
|
|
84
|
+
All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
|
|
85
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Module import type definition not generated, otherwise this would cause a type conflict, this is because several GIR modules were generated with the same namespace: "CoglPango"
|
package/coglpango-8.d.ts
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import '@girs/gjs';
|
|
11
|
+
|
|
12
|
+
// Module dependencies
|
|
13
|
+
import type PangoCairo from '@girs/pangocairo-1.0';
|
|
14
|
+
import type cairo from 'cairo';
|
|
15
|
+
import type GObject from '@girs/gobject-2.0';
|
|
16
|
+
import type GLib from '@girs/glib-2.0';
|
|
17
|
+
import type Pango from '@girs/pango-1.0';
|
|
18
|
+
import type HarfBuzz from '@girs/harfbuzz-0.0';
|
|
19
|
+
import type freetype2 from '@girs/freetype2-2.0';
|
|
20
|
+
import type Gio from '@girs/gio-2.0';
|
|
21
|
+
import type GModule from '@girs/gmodule-2.0';
|
|
22
|
+
import type Cogl from '@girs/cogl-8';
|
|
23
|
+
import type Graphene from '@girs/graphene-1.0';
|
|
24
|
+
import type GL from '@girs/gl-1.0';
|
|
25
|
+
|
|
26
|
+
export namespace CoglPango {
|
|
27
|
+
/**
|
|
28
|
+
* CoglPango-8
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* This updates any internal glyph cache textures as necessary to be
|
|
33
|
+
* able to render the given `layout`.
|
|
34
|
+
*
|
|
35
|
+
* This api should be used to avoid mid-scene modifications of
|
|
36
|
+
* glyph-cache textures which can lead to undefined rendering results.
|
|
37
|
+
* @param layout A #PangoLayout
|
|
38
|
+
*/
|
|
39
|
+
function ensure_glyph_cache_for_layout(layout: Pango.Layout): void;
|
|
40
|
+
/**
|
|
41
|
+
* Clears the glyph cache for `font_map`.
|
|
42
|
+
* @param font_map a #CoglPangoFontMap
|
|
43
|
+
*/
|
|
44
|
+
function font_map_clear_glyph_cache(font_map: FontMap): void;
|
|
45
|
+
/**
|
|
46
|
+
* Create a #PangoContext for the given `font_map`.
|
|
47
|
+
* @param font_map a #CoglPangoFontMap
|
|
48
|
+
* @returns the newly created context: free with g_object_unref().
|
|
49
|
+
*/
|
|
50
|
+
function font_map_create_context(font_map: FontMap): Pango.Context;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves the #CoglPangoRenderer for the passed `font_map`.
|
|
53
|
+
* @param font_map a #CoglPangoFontMap
|
|
54
|
+
* @returns a #PangoRenderer
|
|
55
|
+
*/
|
|
56
|
+
function font_map_get_renderer(font_map: FontMap): Pango.Renderer;
|
|
57
|
+
/**
|
|
58
|
+
* Retrieves whether the #CoglPangoRenderer used by `font_map` will use
|
|
59
|
+
* mipmapping when rendering the glyphs.
|
|
60
|
+
* @param font_map a #CoglPangoFontMap
|
|
61
|
+
* @returns %TRUE if mipmapping is used, %FALSE otherwise.
|
|
62
|
+
*/
|
|
63
|
+
function font_map_get_use_mipmapping(font_map: FontMap): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Creates a new font map.
|
|
66
|
+
* @returns the newly created #PangoFontMap
|
|
67
|
+
*/
|
|
68
|
+
function font_map_new(): Pango.FontMap;
|
|
69
|
+
/**
|
|
70
|
+
* Sets the resolution for the `font_map`. This is a scale factor
|
|
71
|
+
* between points specified in a #PangoFontDescription and Cogl units.
|
|
72
|
+
* The default value is %96, meaning that a 10 point font will be 13
|
|
73
|
+
* units high. (10 * 96. / 72. = 13.3).
|
|
74
|
+
* @param font_map a #CoglPangoFontMap
|
|
75
|
+
* @param dpi The resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.)
|
|
76
|
+
*/
|
|
77
|
+
function font_map_set_resolution(font_map: FontMap, dpi: number): void;
|
|
78
|
+
/**
|
|
79
|
+
* Sets whether the renderer for the passed font map should use
|
|
80
|
+
* mipmapping when rendering a #PangoLayout.
|
|
81
|
+
* @param font_map a #CoglPangoFontMap
|
|
82
|
+
* @param value %TRUE to enable the use of mipmapping
|
|
83
|
+
*/
|
|
84
|
+
function font_map_set_use_mipmapping(font_map: FontMap, value: boolean): void;
|
|
85
|
+
namespace Renderer {
|
|
86
|
+
// Signal signatures
|
|
87
|
+
interface SignalSignatures extends Pango.Renderer.SignalSignatures {
|
|
88
|
+
'notify::context': (pspec: GObject.ParamSpec) => void;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Constructor properties interface
|
|
92
|
+
|
|
93
|
+
interface ConstructorProps extends Pango.Renderer.ConstructorProps {
|
|
94
|
+
context: any;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
class Renderer extends Pango.Renderer {
|
|
99
|
+
static $gtype: GObject.GType<Renderer>;
|
|
100
|
+
|
|
101
|
+
// Properties
|
|
102
|
+
|
|
103
|
+
set context(val: any);
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Compile-time signal type information.
|
|
107
|
+
*
|
|
108
|
+
* This instance property is generated only for TypeScript type checking.
|
|
109
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
$signals: Renderer.SignalSignatures;
|
|
113
|
+
|
|
114
|
+
// Constructors
|
|
115
|
+
|
|
116
|
+
constructor(properties?: Partial<Renderer.ConstructorProps>, ...args: any[]);
|
|
117
|
+
|
|
118
|
+
_init(...args: any[]): void;
|
|
119
|
+
|
|
120
|
+
// Signals
|
|
121
|
+
|
|
122
|
+
connect<K extends keyof Renderer.SignalSignatures>(
|
|
123
|
+
signal: K,
|
|
124
|
+
callback: GObject.SignalCallback<this, Renderer.SignalSignatures[K]>,
|
|
125
|
+
): number;
|
|
126
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
127
|
+
connect_after<K extends keyof Renderer.SignalSignatures>(
|
|
128
|
+
signal: K,
|
|
129
|
+
callback: GObject.SignalCallback<this, Renderer.SignalSignatures[K]>,
|
|
130
|
+
): number;
|
|
131
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
132
|
+
emit<K extends keyof Renderer.SignalSignatures>(
|
|
133
|
+
signal: K,
|
|
134
|
+
...args: GObject.GjsParameters<Renderer.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
135
|
+
): void;
|
|
136
|
+
emit(signal: string, ...args: any[]): void;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
type RendererClass = typeof Renderer;
|
|
140
|
+
type FontMap = PangoCairo.FontMap;
|
|
141
|
+
/**
|
|
142
|
+
* Name of the imported GIR library
|
|
143
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
144
|
+
*/
|
|
145
|
+
const __name__: string;
|
|
146
|
+
/**
|
|
147
|
+
* Version of the imported GIR library
|
|
148
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
149
|
+
*/
|
|
150
|
+
const __version__: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export default CoglPango;
|
|
154
|
+
|
|
155
|
+
// END
|
package/coglpango-8.js
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
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 './coglpango-8-ambient.d.ts';
|
|
11
|
+
|
|
12
|
+
import CoglPango from './coglpango-8.js';
|
|
13
|
+
export default CoglPango;
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@girs/coglpango-8",
|
|
3
|
+
"version": "8.0.0-4.0.0-beta.38",
|
|
4
|
+
"description": "GJS TypeScript type definitions for CoglPango-8, generated from library version 8.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "coglpango-8.js",
|
|
7
|
+
"main": "coglpango-8.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./ambient": {
|
|
10
|
+
"types": "./coglpango-8-ambient.d.ts",
|
|
11
|
+
"import": "./coglpango-8-ambient.js",
|
|
12
|
+
"default": "./coglpango-8-ambient.js"
|
|
13
|
+
},
|
|
14
|
+
"./import": {
|
|
15
|
+
"types": "./coglpango-8-import.d.ts",
|
|
16
|
+
"import": "./coglpango-8-import.js",
|
|
17
|
+
"default": "./coglpango-8-import.js"
|
|
18
|
+
},
|
|
19
|
+
"./coglpango-8": {
|
|
20
|
+
"types": "./coglpango-8.d.ts",
|
|
21
|
+
"import": "./coglpango-8.js",
|
|
22
|
+
"default": "./coglpango-8.js"
|
|
23
|
+
},
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
|
+
"import": "./index.js",
|
|
27
|
+
"default": "./index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "tsc --project tsconfig.json"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@girs/gjs": "4.0.0-beta.38",
|
|
35
|
+
"@girs/pangocairo-1.0": "1.0.0-4.0.0-beta.38",
|
|
36
|
+
"@girs/cairo-1.0": "1.0.0-4.0.0-beta.38",
|
|
37
|
+
"@girs/gobject-2.0": "2.86.0-4.0.0-beta.38",
|
|
38
|
+
"@girs/glib-2.0": "2.86.0-4.0.0-beta.38",
|
|
39
|
+
"@girs/pango-1.0": "1.57.0-4.0.0-beta.38",
|
|
40
|
+
"@girs/harfbuzz-0.0": "11.5.0-4.0.0-beta.38",
|
|
41
|
+
"@girs/freetype2-2.0": "2.0.0-4.0.0-beta.38",
|
|
42
|
+
"@girs/gio-2.0": "2.86.0-4.0.0-beta.38",
|
|
43
|
+
"@girs/gmodule-2.0": "2.0.0-4.0.0-beta.38",
|
|
44
|
+
"@girs/cogl-8": "8.0.0-4.0.0-beta.38",
|
|
45
|
+
"@girs/graphene-1.0": "1.0.0-4.0.0-beta.38",
|
|
46
|
+
"@girs/gl-1.0": "1.0.0-4.0.0-beta.38" },
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"typescript": "*"
|
|
49
|
+
},
|
|
50
|
+
"keywords": ["Gir", "TypeScript", "types", "GObject-Introspection", "GJS", "CoglPango-8"],
|
|
51
|
+
"author": "ts-for-gir",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/gjsify/types.git"
|
|
56
|
+
},
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/gjsify/ts-for-gir/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://github.com/gjsify/types/tree/main/coglpango-8#readme"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// General settings for code interpretation
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "NodeNext",
|
|
6
|
+
"lib": ["ESNext"],
|
|
7
|
+
"types": [],
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"moduleResolution": "NodeNext",
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"noEmitOnError": false,
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"rootDir": ".",
|
|
14
|
+
// General settings for code generation
|
|
15
|
+
"removeComments": false,
|
|
16
|
+
"inlineSourceMap": false,
|
|
17
|
+
"inlineSources": false,
|
|
18
|
+
"newLine": "LF",
|
|
19
|
+
// Show diagnostics
|
|
20
|
+
"diagnostics": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["./coglpango-8.d.ts"]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|