@girs/translit-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 ADDED
@@ -0,0 +1,86 @@
1
+
2
+ # Translit-1.0
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/translit-1.0)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/translit-1.0)
6
+
7
+
8
+ GJS TypeScript type definitions for Translit-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/translit-1.0
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ You can import this package into your project like this:
21
+ ```ts
22
+ import Translit from '@girs/translit-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/translit-1.0` or `@girs/translit-1.0/ambient` in your `tsconfig` or entry point Typescript file:
29
+
30
+ `index.ts`:
31
+ ```ts
32
+ import '@girs/translit-1.0'
33
+ ```
34
+
35
+ `tsconfig.json`:
36
+ ```json
37
+ {
38
+ "compilerOptions": {
39
+ ...
40
+ },
41
+ "include": ["@girs/translit-1.0"],
42
+ ...
43
+ }
44
+ ```
45
+
46
+ Now you can import the ambient module with TypeScript support:
47
+
48
+ ```ts
49
+ import Translit from 'gi://Translit?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/translit-1.0` or `@girs/translit-1.0/import` in your `tsconfig` or entry point Typescript file:
56
+
57
+ `index.ts`:
58
+ ```ts
59
+ import '@girs/translit-1.0'
60
+ ```
61
+
62
+ `tsconfig.json`:
63
+ ```json
64
+ {
65
+ "compilerOptions": {
66
+ ...
67
+ },
68
+ "include": ["@girs/translit-1.0"],
69
+ ...
70
+ }
71
+ ```
72
+
73
+ Now you have also type support for this, too:
74
+
75
+ ```ts
76
+ const Translit = imports.gi.Translit;
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/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@girs/translit-1.0",
3
+ "version": "1.0.0-4.0.0-beta.3",
4
+ "description": "GJS TypeScript type definitions for Translit-1.0, generated from library version 1.0.0",
5
+ "type": "module",
6
+ "module": "translit-1.0.js",
7
+ "main": "translit-1.0.js",
8
+ "exports": {
9
+ "./ambient": {
10
+ "types": "./translit-1.0-ambient.d.ts",
11
+ "import": "./translit-1.0-ambient.js",
12
+ "default": "./translit-1.0-ambient.js"
13
+ },
14
+ "./import": {
15
+ "types": "./translit-1.0-import.d.ts",
16
+ "import": "./translit-1.0-import.js",
17
+ "default": "./translit-1.0-import.js"
18
+ },
19
+ ".": {
20
+ "types": "./translit-1.0.d.ts",
21
+ "import": "./translit-1.0.js",
22
+ "default": "./translit-1.0.js"
23
+ }
24
+ },
25
+ "scripts": {
26
+ "test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit translit-1.0.d.ts"
27
+ },
28
+ "dependencies": {
29
+ "@girs/gio-2.0": "^2.80.0-4.0.0-beta.3",
30
+ "@girs/gjs": "^4.0.0-beta.3",
31
+ "@girs/glib-2.0": "^2.80.0-4.0.0-beta.3",
32
+ "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3"
33
+ },
34
+ "devDependencies": {
35
+ "typescript": "*"
36
+ },
37
+ "keywords": [
38
+ "Gir",
39
+ "TypeScript",
40
+ "types",
41
+ "GObject-Introspection",
42
+ "GJS",
43
+ "Translit-1.0"
44
+ ],
45
+ "author": "ts-for-gir",
46
+ "license": "MIT",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/gjsify/ts-for-gir.git"
50
+ },
51
+ "bugs": {
52
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
53
+ },
54
+ "homepage": "https://github.com/gjsify/types/tree/main/translit-1.0#readme"
55
+ }
@@ -0,0 +1,12 @@
1
+
2
+ declare module 'gi://Translit?version=1.0' {
3
+ import Translit from '@girs/translit-1.0';
4
+ export default Translit;
5
+ }
6
+
7
+ declare module 'gi://Translit' {
8
+ import Translit10 from 'gi://Translit?version=1.0';
9
+ export default Translit10;
10
+ }
11
+
12
+
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,12 @@
1
+
2
+ import Translit10 from '@girs/translit-1.0';
3
+
4
+ declare global {
5
+ export interface GjsGiImports {
6
+ Translit: typeof Translit10;
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,91 @@
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 './translit-1.0-ambient.d.ts';
9
+
10
+ /**
11
+ * Translit-1.0
12
+ */
13
+
14
+ import type Gio from '@girs/gio-2.0';
15
+ import type GObject from '@girs/gobject-2.0';
16
+ import type GLib from '@girs/glib-2.0';
17
+
18
+ export namespace Translit {
19
+ enum ErrorEnum {
20
+ NO_SUCH_BACKEND,
21
+ LOAD_FAILED,
22
+ INVALID_INPUT,
23
+ FAILED,
24
+ }
25
+ function error_quark(): GLib.Quark;
26
+ function implement_transliterator(backend: string, type: GObject.GType): void;
27
+ module Transliterator {
28
+ // Constructor properties interface
29
+
30
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
31
+ name: string;
32
+ }
33
+ }
34
+
35
+ class Transliterator extends GObject.Object {
36
+ static $gtype: GObject.GType<Transliterator>;
37
+
38
+ // Own properties of Translit.Transliterator
39
+
40
+ /**
41
+ * The transliteration which #TranslitTransliterator supports
42
+ */
43
+ get name(): string;
44
+
45
+ // Constructors of Translit.Transliterator
46
+
47
+ constructor(properties?: Partial<Transliterator.ConstructorProps>, ...args: any[]);
48
+
49
+ _init(...args: any[]): void;
50
+
51
+ // Own static methods of Translit.Transliterator
52
+
53
+ /**
54
+ * Get a transliterator instance whose name is `name`.
55
+ * @param backend backend name (e.g. "m17n")
56
+ * @param name name of the transliterator (e.g. "hi-inscript")
57
+ */
58
+ static get(backend: string, name: string): Transliterator;
59
+
60
+ // Own virtual methods of Translit.Transliterator
61
+
62
+ vfunc_transliterate(input: string): [string, number];
63
+
64
+ // Own methods of Translit.Transliterator
65
+
66
+ transliterate(input: string): [string, number];
67
+ }
68
+
69
+ type TransliteratorClass = typeof Transliterator;
70
+ abstract class TransliteratorPrivate {
71
+ static $gtype: GObject.GType<TransliteratorPrivate>;
72
+
73
+ // Constructors of Translit.TransliteratorPrivate
74
+
75
+ _init(...args: any[]): void;
76
+ }
77
+
78
+ /**
79
+ * Name of the imported GIR library
80
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
81
+ */
82
+ const __name__: string;
83
+ /**
84
+ * Version of the imported GIR library
85
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
86
+ */
87
+ const __version__: string;
88
+ }
89
+
90
+ export default Translit;
91
+ // END
@@ -0,0 +1,6 @@
1
+
2
+ // @ts-expect-error
3
+ import Translit from 'gi://Translit?version=1.0';
4
+ export { Translit };
5
+ export default Translit;
6
+
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": ["./translit-1.0.d.ts"]
21
+ }
22
+
23
+
package/typedoc.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "entryPoints": ["./translit-1.0.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "Translit-1.0",
5
+ "tsconfig": "./tsconfig.json"
6
+ }
7
+