@girs/gc-1.0 1.0.0-4.0.0-beta.3
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 +86 -0
- package/gc-1.0-ambient.d.ts +12 -0
- package/gc-1.0-ambient.js +2 -0
- package/gc-1.0-import.d.ts +12 -0
- package/gc-1.0-import.js +3 -0
- package/gc-1.0.d.ts +130 -0
- package/gc-1.0.js +6 -0
- package/package.json +59 -0
- package/tsconfig.json +23 -0
- package/typedoc.json +7 -0
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
|
|
2
|
+
# Gc-1.0
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
GJS TypeScript type definitions for Gc-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
To use this type definitions, install them with NPM:
|
|
14
|
+
```bash
|
|
15
|
+
npm install @girs/gc-1.0
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
You can import this package into your project like this:
|
|
21
|
+
```ts
|
|
22
|
+
import Gc from '@girs/gc-1.0';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Ambient Modules
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
For this you need to include `@girs/gc-1.0` or `@girs/gc-1.0/ambient` in your `tsconfig` or entry point Typescript file:
|
|
29
|
+
|
|
30
|
+
`index.ts`:
|
|
31
|
+
```ts
|
|
32
|
+
import '@girs/gc-1.0'
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`tsconfig.json`:
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"compilerOptions": {
|
|
39
|
+
...
|
|
40
|
+
},
|
|
41
|
+
"include": ["@girs/gc-1.0"],
|
|
42
|
+
...
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Now you can import the ambient module with TypeScript support:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import Gc from 'gi://Gc?version=1.0';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Global import
|
|
53
|
+
|
|
54
|
+
You can also import the module with Typescript support using the global `imports.gi` object of GJS.
|
|
55
|
+
For this you need to include `@girs/gc-1.0` or `@girs/gc-1.0/import` in your `tsconfig` or entry point Typescript file:
|
|
56
|
+
|
|
57
|
+
`index.ts`:
|
|
58
|
+
```ts
|
|
59
|
+
import '@girs/gc-1.0'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`tsconfig.json`:
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"compilerOptions": {
|
|
66
|
+
...
|
|
67
|
+
},
|
|
68
|
+
"include": ["@girs/gc-1.0"],
|
|
69
|
+
...
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Now you have also type support for this, too:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
const Gc = imports.gi.Gc;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Bundle
|
|
80
|
+
|
|
81
|
+
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).
|
|
82
|
+
|
|
83
|
+
## Other packages
|
|
84
|
+
|
|
85
|
+
All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
|
|
86
|
+
|
package/gc-1.0-import.js
ADDED
package/gc-1.0.d.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
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
|
+
|
|
8
|
+
import './gc-1.0-ambient.d.ts';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Gc-1.0
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type Pango from '@girs/pango-1.0';
|
|
15
|
+
import type cairo from '@girs/cairo-1.0';
|
|
16
|
+
import type GObject from '@girs/gobject-2.0';
|
|
17
|
+
import type GLib from '@girs/glib-2.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
|
+
|
|
22
|
+
export namespace Gc {
|
|
23
|
+
enum Category {
|
|
24
|
+
NONE,
|
|
25
|
+
LETTER,
|
|
26
|
+
LETTER_PUNCTUATION,
|
|
27
|
+
LETTER_ARROW,
|
|
28
|
+
LETTER_BULLET,
|
|
29
|
+
LETTER_PICTURE,
|
|
30
|
+
LETTER_CURRENCY,
|
|
31
|
+
LETTER_MATH,
|
|
32
|
+
LETTER_LATIN,
|
|
33
|
+
EMOJI,
|
|
34
|
+
EMOJI_SMILEYS,
|
|
35
|
+
EMOJI_PEOPLE,
|
|
36
|
+
EMOJI_ANIMALS,
|
|
37
|
+
EMOJI_FOOD,
|
|
38
|
+
EMOJI_ACTIVITIES,
|
|
39
|
+
EMOJI_TRAVEL,
|
|
40
|
+
EMOJI_OBJECTS,
|
|
41
|
+
EMOJI_SYMBOLS,
|
|
42
|
+
EMOJI_FLAGS,
|
|
43
|
+
}
|
|
44
|
+
enum SearchError {
|
|
45
|
+
FAILED,
|
|
46
|
+
INVALID_STATE,
|
|
47
|
+
}
|
|
48
|
+
function character_is_composite(chars: number[]): boolean;
|
|
49
|
+
function character_is_invisible(chars: number[]): boolean;
|
|
50
|
+
function character_name(chars: number[]): string | null;
|
|
51
|
+
function get_current_language(): string;
|
|
52
|
+
function get_scripts_for_language(language: string): GLib.UnicodeScript[];
|
|
53
|
+
function search_result_get(result: SearchResult, index: number): string;
|
|
54
|
+
function search_result_get_type(): GObject.GType;
|
|
55
|
+
interface SearchFunc {
|
|
56
|
+
(uc: number): boolean;
|
|
57
|
+
}
|
|
58
|
+
enum SearchFlag {
|
|
59
|
+
NONE,
|
|
60
|
+
WORD,
|
|
61
|
+
}
|
|
62
|
+
module SearchContext {
|
|
63
|
+
// Constructor properties interface
|
|
64
|
+
|
|
65
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {
|
|
66
|
+
criteria: SearchCriteria;
|
|
67
|
+
flags: SearchFlag;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
class SearchContext extends GObject.Object {
|
|
72
|
+
static $gtype: GObject.GType<SearchContext>;
|
|
73
|
+
|
|
74
|
+
// Own properties of Gc.SearchContext
|
|
75
|
+
|
|
76
|
+
set criteria(val: SearchCriteria);
|
|
77
|
+
set flags(val: SearchFlag);
|
|
78
|
+
|
|
79
|
+
// Constructors of Gc.SearchContext
|
|
80
|
+
|
|
81
|
+
constructor(properties?: Partial<SearchContext.ConstructorProps>, ...args: any[]);
|
|
82
|
+
|
|
83
|
+
_init(...args: any[]): void;
|
|
84
|
+
|
|
85
|
+
static ['new'](criteria: SearchCriteria, flags: SearchFlag): SearchContext;
|
|
86
|
+
|
|
87
|
+
// Own methods of Gc.SearchContext
|
|
88
|
+
|
|
89
|
+
is_finished(): boolean;
|
|
90
|
+
search(
|
|
91
|
+
max_matches: number,
|
|
92
|
+
cancellable?: Gio.Cancellable | null,
|
|
93
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
94
|
+
): void;
|
|
95
|
+
search_finish(result: Gio.AsyncResult): SearchResult;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
type SearchContextClass = typeof SearchContext;
|
|
99
|
+
class SearchCriteria {
|
|
100
|
+
static $gtype: GObject.GType<SearchCriteria>;
|
|
101
|
+
|
|
102
|
+
// Constructors of Gc.SearchCriteria
|
|
103
|
+
|
|
104
|
+
constructor(category: Category);
|
|
105
|
+
_init(...args: any[]): void;
|
|
106
|
+
|
|
107
|
+
static new_category(category: Category): SearchCriteria;
|
|
108
|
+
|
|
109
|
+
static new_keywords(keywords: string[]): SearchCriteria;
|
|
110
|
+
|
|
111
|
+
static new_related(character: string): SearchCriteria;
|
|
112
|
+
|
|
113
|
+
static new_scripts(scripts: GLib.UnicodeScript[]): SearchCriteria;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
type SearchResult = GLib.PtrArray;
|
|
117
|
+
/**
|
|
118
|
+
* Name of the imported GIR library
|
|
119
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
120
|
+
*/
|
|
121
|
+
const __name__: string;
|
|
122
|
+
/**
|
|
123
|
+
* Version of the imported GIR library
|
|
124
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
125
|
+
*/
|
|
126
|
+
const __version__: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export default Gc;
|
|
130
|
+
// END
|
package/gc-1.0.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@girs/gc-1.0",
|
|
3
|
+
"version": "1.0.0-4.0.0-beta.3",
|
|
4
|
+
"description": "GJS TypeScript type definitions for Gc-1.0, generated from library version 1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "gc-1.0.js",
|
|
7
|
+
"main": "gc-1.0.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./ambient": {
|
|
10
|
+
"types": "./gc-1.0-ambient.d.ts",
|
|
11
|
+
"import": "./gc-1.0-ambient.js",
|
|
12
|
+
"default": "./gc-1.0-ambient.js"
|
|
13
|
+
},
|
|
14
|
+
"./import": {
|
|
15
|
+
"types": "./gc-1.0-import.d.ts",
|
|
16
|
+
"import": "./gc-1.0-import.js",
|
|
17
|
+
"default": "./gc-1.0-import.js"
|
|
18
|
+
},
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./gc-1.0.d.ts",
|
|
21
|
+
"import": "./gc-1.0.js",
|
|
22
|
+
"default": "./gc-1.0.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gc-1.0.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@girs/cairo-1.0": "^1.0.0-4.0.0-beta.3",
|
|
30
|
+
"@girs/freetype2-2.0": "^2.0.0-4.0.0-beta.3",
|
|
31
|
+
"@girs/gio-2.0": "^2.80.0-4.0.0-beta.3",
|
|
32
|
+
"@girs/gjs": "^4.0.0-beta.3",
|
|
33
|
+
"@girs/glib-2.0": "^2.80.0-4.0.0-beta.3",
|
|
34
|
+
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3",
|
|
35
|
+
"@girs/harfbuzz-0.0": "^8.3.1-4.0.0-beta.3",
|
|
36
|
+
"@girs/pango-1.0": "^1.51.0-4.0.0-beta.3"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"typescript": "*"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"Gir",
|
|
43
|
+
"TypeScript",
|
|
44
|
+
"types",
|
|
45
|
+
"GObject-Introspection",
|
|
46
|
+
"GJS",
|
|
47
|
+
"Gc-1.0"
|
|
48
|
+
],
|
|
49
|
+
"author": "ts-for-gir",
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "git+https://github.com/gjsify/ts-for-gir.git"
|
|
54
|
+
},
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/gjsify/ts-for-gir/issues"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/gjsify/types/tree/main/gc-1.0#readme"
|
|
59
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// General settings for code interpretation
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ESNext"],
|
|
7
|
+
"types": [],
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"moduleResolution": "node",
|
|
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
|
+
},
|
|
20
|
+
"include": ["./gc-1.0.d.ts"]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|