-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into package-props-defined
- Loading branch information
Showing
103 changed files
with
30,367 additions
and
31,099 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20 | ||
22 |
556 changes: 278 additions & 278 deletions
556
.yarn/releases/yarn-4.5.1.cjs → .yarn/releases/yarn-4.6.0.cjs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,8 @@ | |
"author": "Pascal Garber <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"typescript": "^5.6.3", | ||
"vite": "^5.4.10" | ||
"typescript": "^5.7.3", | ||
"vite": "^6.1.0" | ||
}, | ||
"dependencies": { | ||
"@girs/adw-1": "workspace:^", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
"author": "Pascal Garber <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"typescript": "^5.6.3" | ||
"typescript": "^5.7.3" | ||
}, | ||
"dependencies": { | ||
"@girs/gjs": "workspace:^" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
"author": "Pascal Garber <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"typescript": "^5.6.3" | ||
"typescript": "^5.7.3" | ||
}, | ||
"dependencies": { | ||
"@girs/gjs": "workspace:^" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ | |
"author": "Pascal Garber <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"esbuild": "^0.24.0", | ||
"typescript": "^5.6.3" | ||
"esbuild": "^0.25.0", | ||
"typescript": "^5.7.3" | ||
}, | ||
"dependencies": { | ||
"@girs/gio-2.0": "workspace:^", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ | |
"author": "Pascal Garber <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"esbuild": "^0.24.0", | ||
"typescript": "^5.6.3" | ||
"esbuild": "^0.25.0", | ||
"typescript": "^5.7.3" | ||
}, | ||
"dependencies": { | ||
"@girs/gio-2.0": "workspace:^", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ | |
"author": "Pascal Garber <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"esbuild": "^0.24.0", | ||
"typescript": "^5.6.3" | ||
"esbuild": "^0.25.0", | ||
"typescript": "^5.7.3" | ||
}, | ||
"dependencies": { | ||
"@girs/gio-2.0": "workspace:^", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,8 @@ | |
"author": "Pascal Garber <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"esbuild": "^0.24.0", | ||
"typescript": "^5.6.3" | ||
"esbuild": "^0.25.0", | ||
"typescript": "^5.7.3" | ||
}, | ||
"dependencies": { | ||
"@girs/gio-2.0": "workspace:^", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import GObject from 'gi://GObject'; | ||
import System from 'system'; | ||
|
||
console.log('GJS Version:', System.version); | ||
|
||
if(System.version < 18200) { | ||
console.log('GJS version 1.82.0 or higher is required for nullable nick and blurb in GObject.ParamSpec, skipping example'); | ||
System.exit(0); | ||
} | ||
|
||
// Example class demonstrating different ParamSpec usages | ||
class ExampleObject extends GObject.Object { | ||
static { | ||
GObject.registerClass({ | ||
GTypeName: 'ExampleObject', | ||
Properties: { | ||
// Property with all fields | ||
'full-property': GObject.ParamSpec.string( | ||
'full-property', // name (required) | ||
'Full Property', // nick (optional) | ||
'A complete property', // blurb (optional) | ||
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, | ||
'default value' | ||
), | ||
|
||
// Property with null nick and blurb | ||
'minimal-property': GObject.ParamSpec.string( | ||
'minimal-property', | ||
null, // nick can be null | ||
null, // blurb can be null | ||
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, | ||
'' | ||
), | ||
|
||
// Number property with null documentation | ||
'count': GObject.ParamSpec.int( | ||
'count', | ||
null, // nick can be null | ||
null, // blurb can be null | ||
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, | ||
0, // minimum | ||
100, // maximum | ||
0 // default value | ||
), | ||
|
||
// Boolean property with partial documentation | ||
'active': GObject.ParamSpec.boolean( | ||
'active', | ||
'Active', // providing nick | ||
null, // but blurb can still be null | ||
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, | ||
false | ||
) | ||
} | ||
}, this); | ||
} | ||
|
||
// Property values | ||
private _fullProperty: string = 'default value'; | ||
private _minimalProperty: string = ''; | ||
private _count: number = 0; | ||
private _active: boolean = false; | ||
|
||
// Property getters/setters | ||
get full_property(): string { | ||
return this._fullProperty; | ||
} | ||
|
||
set full_property(value: string) { | ||
this._fullProperty = value; | ||
} | ||
|
||
get minimal_property(): string { | ||
return this._minimalProperty; | ||
} | ||
|
||
set minimal_property(value: string) { | ||
this._minimalProperty = value; | ||
} | ||
|
||
get count(): number { | ||
return this._count; | ||
} | ||
|
||
set count(value: number) { | ||
this._count = value; | ||
} | ||
|
||
get active(): boolean { | ||
return this._active; | ||
} | ||
|
||
set active(value: boolean) { | ||
this._active = value; | ||
} | ||
} | ||
|
||
// Create and test the object | ||
const obj = new ExampleObject(); | ||
|
||
// Test property access and type safety | ||
obj.full_property = 'New Value'; | ||
obj.minimal_property = 'Test'; | ||
obj.count = 42; | ||
obj.active = true; | ||
|
||
// Print current values | ||
console.log('Full Property:', obj.full_property); | ||
console.log('Minimal Property:', obj.minimal_property); | ||
console.log('Count:', obj.count); | ||
console.log('Active:', obj.active); | ||
|
||
// Get property info using GObject introspection | ||
const properties = ExampleObject.list_properties(); | ||
|
||
console.log('\nProperty Information:'); | ||
for (const pspec of properties) { | ||
console.log(`\nProperty: ${pspec.get_name()}`); | ||
console.log(`Nick: ${pspec.get_nick() || '(null)'}`); | ||
console.log(`Blurb: ${pspec.get_blurb() || '(null)'}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "@ts-for-gir-example/gobject-param-spec", | ||
"version": "4.0.0-beta.19", | ||
"description": "Example demonstrating GObject.ParamSpec with nullable fields", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"build:app": "tsc", | ||
"build": "yarn build:app", | ||
"start:app": "gjs -m dist/main.js", | ||
"start": "yarn build && yarn start:app", | ||
"validate": "yarn validate:types", | ||
"validate:types": "tsc --noEmit", | ||
"clear": "rm -rf dist" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.7.3" | ||
}, | ||
"dependencies": { | ||
"@girs/gjs": "workspace:^", | ||
"@girs/glib-2.0": "workspace:^", | ||
"@girs/gobject-2.0": "workspace:^" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": ["ESNext"], | ||
"types": ["@girs/gjs", "@girs/gjs/dom", "@girs/gobject-2.0", "@girs/glib-2.0"], | ||
"target": "ESNext", | ||
"module": "ESNext", | ||
"moduleResolution": "bundler", | ||
"strict": true, | ||
"noImplicitAny": true, | ||
"strictNullChecks": true, | ||
"noImplicitThis": true, | ||
"alwaysStrict": true, | ||
"outDir": "./dist" | ||
}, | ||
"files": [ | ||
"main.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.