@girs/amtk-5
Advanced tools
Comparing version 5.0.0-3.0.0-beta.14 to 5.0.0-3.0.0-beta.15
@@ -8,2 +8,5 @@ | ||
*/ | ||
import './amtk-5-ambient.d.ts'; | ||
import './amtk-5-import.d.ts'; | ||
/** | ||
@@ -10,0 +13,0 @@ * Amtk-5 |
@@ -9,1 +9,3 @@ | ||
{ | ||
"name": "@girs/amtk-5", | ||
"version": "5.0.0-3.0.0-beta.14", | ||
"version": "5.0.0-3.0.0-beta.15", | ||
"description": "GJS TypeScript type definitions for Amtk-5, generated from library version 5.0.0", | ||
@@ -15,2 +15,4 @@ "type": "module", | ||
"exports": { | ||
"./ambient": "./amtk-5-ambient.d.ts", | ||
"./import": "./amtk-5-import.d.ts", | ||
".": { | ||
@@ -33,15 +35,15 @@ "import": { | ||
"dependencies": { | ||
"@girs/atk-1.0": "^2.45.1-3.0.0-beta.14", | ||
"@girs/cairo-1.0": "^1.0.0-3.0.0-beta.14", | ||
"@girs/freetype2-2.0": "^2.0.0-3.0.0-beta.14", | ||
"@girs/gdk-3.0": "^3.24.36-3.0.0-beta.14", | ||
"@girs/gdkpixbuf-2.0": "^2.0.0-3.0.0-beta.14", | ||
"@girs/gio-2.0": "^2.76.1-3.0.0-beta.14", | ||
"@girs/glib-2.0": "^2.76.1-3.0.0-beta.14", | ||
"@girs/gmodule-2.0": "^2.0.0-3.0.0-beta.14", | ||
"@girs/gobject-2.0": "^2.76.1-3.0.0-beta.14", | ||
"@girs/gtk-3.0": "^3.24.36-3.0.0-beta.14", | ||
"@girs/harfbuzz-0.0": "^6.0.0-3.0.0-beta.14", | ||
"@girs/pango-1.0": "^1.50.13-3.0.0-beta.14", | ||
"@girs/xlib-2.0": "^2.0.0-3.0.0-beta.14" | ||
"@girs/gtk-3.0": "^3.24.36-3.0.0-beta.15", | ||
"@girs/xlib-2.0": "^2.0.0-3.0.0-beta.15", | ||
"@girs/gdk-3.0": "^3.24.36-3.0.0-beta.15", | ||
"@girs/cairo-1.0": "^1.0.0-3.0.0-beta.15", | ||
"@girs/pango-1.0": "^1.50.13-3.0.0-beta.15", | ||
"@girs/harfbuzz-0.0": "^6.0.0-3.0.0-beta.15", | ||
"@girs/freetype2-2.0": "^2.0.0-3.0.0-beta.15", | ||
"@girs/gobject-2.0": "^2.76.1-3.0.0-beta.15", | ||
"@girs/glib-2.0": "^2.76.1-3.0.0-beta.15", | ||
"@girs/gio-2.0": "^2.76.1-3.0.0-beta.15", | ||
"@girs/gdkpixbuf-2.0": "^2.0.0-3.0.0-beta.15", | ||
"@girs/gmodule-2.0": "^2.0.0-3.0.0-beta.15", | ||
"@girs/atk-1.0": "^2.45.1-3.0.0-beta.15" | ||
}, | ||
@@ -48,0 +50,0 @@ "devDependencies": { |
# Amtk-5 | ||
GJS TypeScript type definitions for Amtk-5, generated from library version 5.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.0.0-beta.14. | ||
GJS TypeScript type definitions for Amtk-5, generated from library version 5.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.0.0-beta.15. | ||
## Install | ||
To use this type definitions, install them with NPM like this: | ||
To use this type definitions, install them with NPM: | ||
```bash | ||
@@ -25,8 +25,59 @@ npm install @girs/amtk-5 | ||
If you use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules), you can also import this module like you would do this in JavaScript: | ||
### Ambient Modules | ||
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. | ||
For this you need to include `@girs/amtk-5` or `@girs/amtk-5/ambient` in your `tsconfig` or entry point Typescript file: | ||
`index.ts`: | ||
```ts | ||
import '@girs/amtk-5' | ||
``` | ||
`tsconfig.json`: | ||
```json | ||
{ | ||
"compilerOptions": { | ||
... | ||
}, | ||
"include": ["@girs/amtk-5"], | ||
... | ||
} | ||
``` | ||
Now you can import the ambient module with TypeScript support: | ||
```ts | ||
import Amtk from 'gi://Amtk?version=5'; | ||
``` | ||
### Global import | ||
You can also import the module with Typescript support using the global `imports.gi` object of GJS. | ||
For this you need to include `@girs/amtk-5` or `@girs/amtk-5/import` in your `tsconfig` or entry point Typescript file: | ||
`index.ts`: | ||
```ts | ||
import '@girs/amtk-5' | ||
``` | ||
`tsconfig.json`: | ||
```json | ||
{ | ||
"compilerOptions": { | ||
... | ||
}, | ||
"include": ["@girs/amtk-5"], | ||
... | ||
} | ||
``` | ||
Now you have also type support for this, too: | ||
```ts | ||
const Amtk = imports.gi.Amtk; | ||
``` | ||
### Bundle | ||
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). | ||
@@ -36,2 +87,3 @@ | ||
All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types). | ||
All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types). | ||
@@ -20,1 +20,3 @@ { | ||
} | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
88149
9
1014
88