@gjsify/adwaita-core 0.59.1 → 0.61.0
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/lib/esm/conformance/file-chooser.js +1 -0
- package/lib/esm/conformance/gtk-platform.js +1 -0
- package/lib/esm/conformance/index.js +1 -1
- package/lib/esm/conformance/style-manager.js +1 -1
- package/lib/esm/engine.js +1 -0
- package/lib/esm/file-chooser.js +1 -0
- package/lib/esm/glib-bytes.js +1 -0
- package/lib/esm/glib-error.js +1 -0
- package/lib/esm/gobject.js +1 -1
- package/lib/esm/gtk-platform.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/style-manager.js +1 -1
- package/lib/esm/widget-members.js +1 -0
- package/lib/types/conformance/file-chooser.d.ts +129 -0
- package/lib/types/conformance/gtk-platform.d.ts +49 -0
- package/lib/types/conformance/index.d.ts +4 -0
- package/lib/types/conformance/style-manager.d.ts +11 -1
- package/lib/types/engine-slot.spec.d.ts +2 -0
- package/lib/types/engine.d.ts +71 -0
- package/lib/types/file-chooser.d.ts +171 -0
- package/lib/types/file-chooser.gjs.spec.d.ts +2 -0
- package/lib/types/file-chooser.spec.d.ts +5 -0
- package/lib/types/glib-bytes.d.ts +11 -0
- package/lib/types/glib-error.d.ts +28 -0
- package/lib/types/gobject.d.ts +30 -4
- package/lib/types/gobject.node-gi.spec.d.ts +7 -0
- package/lib/types/gtk-platform.d.ts +104 -0
- package/lib/types/gtk-platform.spec.d.ts +2 -0
- package/lib/types/index.d.ts +11 -2
- package/lib/types/style-manager.d.ts +14 -0
- package/lib/types/widget-members.d.ts +25 -0
- package/package.json +7 -4
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ConstructHarness } from './constructs.js';
|
|
2
|
+
/** The part of `Gtk` the vectors read. */
|
|
3
|
+
export interface GtkPlatformLike {
|
|
4
|
+
readonly CssProvider: new () => {
|
|
5
|
+
load_from_string(css: string): void;
|
|
6
|
+
to_string(): string;
|
|
7
|
+
};
|
|
8
|
+
readonly Settings: {
|
|
9
|
+
get_default(): {
|
|
10
|
+
gtk_font_name: string | null;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
readonly IconTheme: {
|
|
14
|
+
get_for_display(display: unknown): {
|
|
15
|
+
add_resource_path(path: string): void;
|
|
16
|
+
get_resource_path(): string[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly EventControllerKey: new () => {
|
|
20
|
+
connect(signal: string, handler: (...args: unknown[]) => boolean | void): number;
|
|
21
|
+
disconnect(id: number): void;
|
|
22
|
+
};
|
|
23
|
+
readonly StyleContext: {
|
|
24
|
+
add_provider_for_display(display: unknown, provider: object, priority: number): void;
|
|
25
|
+
remove_provider_for_display(display: unknown, provider: object): void;
|
|
26
|
+
};
|
|
27
|
+
readonly STYLE_PROVIDER_PRIORITY_FALLBACK: number;
|
|
28
|
+
readonly STYLE_PROVIDER_PRIORITY_THEME: number;
|
|
29
|
+
readonly STYLE_PROVIDER_PRIORITY_SETTINGS: number;
|
|
30
|
+
readonly STYLE_PROVIDER_PRIORITY_APPLICATION: number;
|
|
31
|
+
readonly STYLE_PROVIDER_PRIORITY_USER: number;
|
|
32
|
+
show_uri: unknown;
|
|
33
|
+
}
|
|
34
|
+
/** What a driver hands the vectors. */
|
|
35
|
+
export interface GtkPlatformSubject {
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly isOracle: boolean;
|
|
38
|
+
readonly Gtk: GtkPlatformLike;
|
|
39
|
+
}
|
|
40
|
+
export declare const GTK_PLATFORM_ROWS: readonly ["priorities", "provider", "settings", "icon-theme", "controller", "members"];
|
|
41
|
+
export type GtkPlatformRow = (typeof GTK_PLATFORM_ROWS)[number];
|
|
42
|
+
export interface GtkPlatformVector {
|
|
43
|
+
readonly row: GtkPlatformRow;
|
|
44
|
+
readonly rule: string;
|
|
45
|
+
readonly observe: (subject: GtkPlatformSubject) => unknown;
|
|
46
|
+
readonly shows: unknown;
|
|
47
|
+
}
|
|
48
|
+
export declare const GTK_PLATFORM_VECTORS: readonly GtkPlatformVector[];
|
|
49
|
+
export declare function driveGtkPlatformVectors(subject: GtkPlatformSubject, harness: ConstructHarness, vectors?: readonly GtkPlatformVector[]): Promise<void>;
|
|
@@ -89,6 +89,8 @@ export { APPLICATION_ROWS, APPLICATION_VECTORS, driveApplicationVectors, unprove
|
|
|
89
89
|
export type { ApplicationLike, ApplicationRow, ApplicationScene, ApplicationSubject, ApplicationVector, SimpleActionLike, } from './application.js';
|
|
90
90
|
export { GLIB_TIMER_ROWS, GLIB_TIMER_VECTORS, driveGLibTimerVectors } from './glib-timers.js';
|
|
91
91
|
export type { GLibTimerRow, GLibTimersLike, GLibTimersSubject, GLibTimerVector } from './glib-timers.js';
|
|
92
|
+
export { GTK_PLATFORM_ROWS, GTK_PLATFORM_VECTORS, driveGtkPlatformVectors } from './gtk-platform.js';
|
|
93
|
+
export type { GtkPlatformLike, GtkPlatformRow, GtkPlatformSubject, GtkPlatformVector } from './gtk-platform.js';
|
|
92
94
|
export type { GObjectRow, GObjectSubject, GObjectTemplateSource, GObjectVector } from './gobject.js';
|
|
93
95
|
export { POPUP_MENU_PLAN_VECTORS, popupMenuOutline } from './popup-menu-plan.js';
|
|
94
96
|
export type { PopupMenuPlanVector } from './popup-menu-plan.js';
|
|
@@ -104,3 +106,5 @@ export { SIMPLE_ACTION_GROUP_ROWS, SIMPLE_ACTION_GROUP_VECTORS, driveSimpleActio
|
|
|
104
106
|
export type { GioActionsLike, SimpleActionGroupLike, SimpleActionGroupRow, SimpleActionGroupSubject, SimpleActionGroupVector, GioSimpleActionLike, } from './simple-action-group.js';
|
|
105
107
|
export { GDK_CLIPBOARD_ROWS, GDK_CLIPBOARD_VECTORS, driveGdkClipboardVectors } from './gdk-clipboard.js';
|
|
106
108
|
export type { GdkClipboardNamespaces, GdkClipboardRow, GdkClipboardSubject, GdkClipboardVector, } from './gdk-clipboard.js';
|
|
109
|
+
export { FILE_CHOOSER_ROWS, FILE_CHOOSER_VECTORS, driveFileChooserVectors, promisifyFileChooser, } from './file-chooser.js';
|
|
110
|
+
export type { FileChooserNamespaces, FileChooserRow, FileChooserSubject, FileChooserVector, ScriptedPick, } from './file-chooser.js';
|
|
@@ -6,12 +6,22 @@ export interface StyleManagerLike {
|
|
|
6
6
|
name: string;
|
|
7
7
|
}) => void): number;
|
|
8
8
|
disconnect(id: number): void;
|
|
9
|
+
color_scheme: number;
|
|
10
|
+
get_color_scheme(): number;
|
|
11
|
+
set_color_scheme(scheme: number): void;
|
|
9
12
|
}
|
|
10
13
|
/** The part of `Adw` the vectors read. */
|
|
11
14
|
export interface AdwStyleLike {
|
|
12
15
|
StyleManager: {
|
|
13
16
|
get_default(): StyleManagerLike;
|
|
14
17
|
};
|
|
18
|
+
ColorScheme: {
|
|
19
|
+
DEFAULT: number;
|
|
20
|
+
FORCE_LIGHT: number;
|
|
21
|
+
PREFER_LIGHT: number;
|
|
22
|
+
PREFER_DARK: number;
|
|
23
|
+
FORCE_DARK: number;
|
|
24
|
+
};
|
|
15
25
|
}
|
|
16
26
|
export interface StyleManagerSubject {
|
|
17
27
|
readonly name: string;
|
|
@@ -21,7 +31,7 @@ export interface StyleManagerSubject {
|
|
|
21
31
|
setDark(dark: boolean): void;
|
|
22
32
|
settle(): Promise<void>;
|
|
23
33
|
}
|
|
24
|
-
export declare const STYLE_MANAGER_ROWS: readonly ["default", "dark", "notify", "unchanged", "disconnect", "readonly"];
|
|
34
|
+
export declare const STYLE_MANAGER_ROWS: readonly ["default", "dark", "notify", "unchanged", "disconnect", "readonly", "scheme-values", "scheme-force", "scheme-notify", "scheme-default"];
|
|
25
35
|
export type StyleManagerRow = (typeof STYLE_MANAGER_ROWS)[number];
|
|
26
36
|
export interface StyleManagerVector {
|
|
27
37
|
readonly row: StyleManagerRow;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Binding, BindingFlag, GObjectInstance, ParamSpec, RegisteredClass, SignalHandler } from './gobject.js';
|
|
2
|
+
export interface GObjectEngine {
|
|
3
|
+
/** Names the engine in a diagnostic; `'pure-js'` for the default one. */
|
|
4
|
+
readonly name: string;
|
|
5
|
+
/**
|
|
6
|
+
* A class finished registering. The engine may build whatever per-class thing it needs from
|
|
7
|
+
* `info.properties` and `info.signals` (a real engine registers a GType here). The core has
|
|
8
|
+
* already applied every refusal, so `info` is inside the subset.
|
|
9
|
+
*/
|
|
10
|
+
register(info: RegisteredClass): void;
|
|
11
|
+
/**
|
|
12
|
+
* The value of `spec` on `instance`. Until something sets it this is `spec.get_default_value()`
|
|
13
|
+
* — a property reads as its default, which is a vector of its own.
|
|
14
|
+
*/
|
|
15
|
+
getValue(instance: object, spec: ParamSpec): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Stores `value` — ALWAYS, which is what makes this the construct-only writer too — and
|
|
18
|
+
* returns whether the CORE must notify. For a store that only holds values that is "did this
|
|
19
|
+
* change anything", and the pure-JS engine answers exactly that: an unset slot counts as
|
|
20
|
+
* changed even for a value equal to the default, as `_generateAccessors` does.
|
|
21
|
+
*
|
|
22
|
+
* It is deliberately the core's DUTY and not the engine's CHANGE, because an engine whose
|
|
23
|
+
* write already emits `notify` — a real-GObject one, where `g_object_set_property` notifies
|
|
24
|
+
* itself — would otherwise have to suppress the second one. Such an engine returns false
|
|
25
|
+
* always and the notification still happens, once, from inside the store. The core never
|
|
26
|
+
* notifies for the construct write either way.
|
|
27
|
+
*/
|
|
28
|
+
setValue(instance: object, spec: ParamSpec, value: unknown): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Connects `handler` under the core's `id`. `key` is a plain signal name or
|
|
31
|
+
* `notify::<property>`, already resolved against the class chain and canonical (the dashed
|
|
32
|
+
* spelling of the property).
|
|
33
|
+
*/
|
|
34
|
+
addHandler(instance: GObjectInstance, id: number, key: string, handler: SignalHandler): void;
|
|
35
|
+
/** Disconnects the handler the core gave `id` to; false when this engine has no such id. */
|
|
36
|
+
removeHandler(instance: GObjectInstance, id: number): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Runs the handlers of `key`. The core has already checked that `key` is a signal of the class
|
|
39
|
+
* and that the argument count matches its `param_types`. A handler is called as
|
|
40
|
+
* `handler(instance, ...args)` — the JS instance, never an engine-internal twin.
|
|
41
|
+
*/
|
|
42
|
+
emit(instance: GObjectInstance, key: string, args: readonly unknown[]): void;
|
|
43
|
+
/** Emits `notify::<spec.name>`. Separate from {@link emit} because real GObject's notify is. */
|
|
44
|
+
notify(instance: GObjectInstance, spec: ParamSpec): void;
|
|
45
|
+
/**
|
|
46
|
+
* Marks the innermost emission of `key` in progress so the handlers after the current one do
|
|
47
|
+
* not run. False when there is none, which the core turns into GLib's warning.
|
|
48
|
+
*/
|
|
49
|
+
stopEmission(instance: GObjectInstance, key: string): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* `g_object_bind_property` for the three flags the template builders use. An engine with real
|
|
52
|
+
* bindings returns a real `GBinding`'s `unbind`; the pure-JS one follows `notify`.
|
|
53
|
+
*/
|
|
54
|
+
bind(source: GObjectInstance, sourceProperty: string, target: GObjectInstance, targetProperty: string, flags: readonly BindingFlag[]): Binding;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Makes `engine` the engine behind every GObject namespace a port builds AFTER this call. Throws
|
|
58
|
+
* when the slot has already been read, or when a DIFFERENT engine holds it — re-registering the
|
|
59
|
+
* same one is idempotent, so a module two bundles both evaluate is not an error.
|
|
60
|
+
*
|
|
61
|
+
* Nothing calls this in the core. `@gjsify/adwaita-gobject-native`'s `useRealGObjectEngine` is the
|
|
62
|
+
* one caller the workspace has, and it is the app that calls that.
|
|
63
|
+
*/
|
|
64
|
+
export declare function registerGObjectEngine(engine: GObjectEngine): void;
|
|
65
|
+
/**
|
|
66
|
+
* The engine a port must build its namespace on, or `undefined` when none was registered — which
|
|
67
|
+
* the caller is to read as "use the default", not as an error. Freezes the slot.
|
|
68
|
+
*/
|
|
69
|
+
export declare function registeredEngine(): GObjectEngine | undefined;
|
|
70
|
+
/** Forgets the slot. For tests, which need a second app's worth of module state in one process. */
|
|
71
|
+
export declare function resetRegisteredEngine(): void;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Bytes } from './glib-bytes.js';
|
|
2
|
+
import { GLibError } from './glib-error.js';
|
|
3
|
+
import { type GType } from './gobject.js';
|
|
4
|
+
/** What a `Gtk.FileFilter` holds, as a driver reads it. */
|
|
5
|
+
export interface FileFilterSpec {
|
|
6
|
+
readonly name: string | null;
|
|
7
|
+
/** `add_pattern("*.ext")`: the extension, without the dot. Case-sensitive, as GTK's. */
|
|
8
|
+
readonly patterns: readonly string[];
|
|
9
|
+
/** `add_suffix("ext")`: case-insensitive, as GTK's. */
|
|
10
|
+
readonly suffixes: readonly string[];
|
|
11
|
+
readonly mimeTypes: readonly string[];
|
|
12
|
+
/** `add_pattern("*")` or `add_mime_type("*\/*")`: the filter accepts every file. */
|
|
13
|
+
readonly acceptAll: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** One open or save, as the dialog hands it to the driver. */
|
|
16
|
+
export interface FileChooserRequest {
|
|
17
|
+
readonly title: string | null;
|
|
18
|
+
readonly filters: readonly FileFilterSpec[];
|
|
19
|
+
readonly defaultFilter: FileFilterSpec | null;
|
|
20
|
+
readonly initialName: string | null;
|
|
21
|
+
/** The `parent` passed to `open`/`save`; the web ignores it, Android may use it as the owner. */
|
|
22
|
+
readonly parent: unknown;
|
|
23
|
+
}
|
|
24
|
+
/** The platform's handle behind a `Gio.File`: bytes, not a path. */
|
|
25
|
+
export interface FileChooserHandle {
|
|
26
|
+
readonly basename: string;
|
|
27
|
+
/** The URI GIO would give (`content://…` on Android); absent where there is none to give. */
|
|
28
|
+
readonly uri?: string;
|
|
29
|
+
read(): Promise<Uint8Array>;
|
|
30
|
+
/** Opens for writing and truncates. `close()` commits. */
|
|
31
|
+
openWriter(): Promise<FileChooserWriter>;
|
|
32
|
+
}
|
|
33
|
+
export interface FileChooserWriter {
|
|
34
|
+
write(chunk: Uint8Array): Promise<void>;
|
|
35
|
+
close(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Opens the platform's picker. A user who closes it rejects with a `GLib.Error` of
|
|
39
|
+
* `Gtk.DialogError.DISMISSED` ({@link dismissedError}); anything else that rejects becomes
|
|
40
|
+
* `Gtk.DialogError.FAILED` with the cause in the message.
|
|
41
|
+
*/
|
|
42
|
+
export interface FileChooserDriver {
|
|
43
|
+
open(request: FileChooserRequest): Promise<FileChooserHandle>;
|
|
44
|
+
save(request: FileChooserRequest): Promise<FileChooserHandle>;
|
|
45
|
+
}
|
|
46
|
+
/** Puts `next` below every `Gtk.FileDialog`; returns the driver it replaced. A gjsify extra, not GTK. */
|
|
47
|
+
export declare function registerFileChooserDriver(next: FileChooserDriver | null): FileChooserDriver | null;
|
|
48
|
+
export declare function dismissedError(message?: string): GLibError;
|
|
49
|
+
export declare function dialogFailedError(message: string): GLibError;
|
|
50
|
+
type AsyncReadyCallback = ((source: object, result: AsyncResult) => void) | null;
|
|
51
|
+
type Outcome = {
|
|
52
|
+
ok: true;
|
|
53
|
+
value: unknown;
|
|
54
|
+
} | {
|
|
55
|
+
ok: false;
|
|
56
|
+
error: unknown;
|
|
57
|
+
};
|
|
58
|
+
/** `Gio.AsyncResult`: opaque to the caller, read once by the matching `_finish`. */
|
|
59
|
+
declare class AsyncResult {
|
|
60
|
+
#private;
|
|
61
|
+
constructor(source: object, tag: string, outcome: Outcome);
|
|
62
|
+
get_source_object(): object;
|
|
63
|
+
static take(result: unknown, source: object, tag: string): unknown;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* `Gio._promisify(proto, asyncName, finishName)`: called without its callback, `asyncName` returns a
|
|
67
|
+
* Promise of what `finishName` returns, a leading `true` dropped. A missing method throws here, as GJS's.
|
|
68
|
+
*/
|
|
69
|
+
export declare function promisify(proto: object, asyncName: string, finishName?: string): void;
|
|
70
|
+
export declare class FileFilter {
|
|
71
|
+
static readonly $gtype: GType;
|
|
72
|
+
constructor(params?: Record<string, unknown>);
|
|
73
|
+
static new(): FileFilter;
|
|
74
|
+
get name(): string | null;
|
|
75
|
+
set name(value: string | null);
|
|
76
|
+
get_name(): string | null;
|
|
77
|
+
set_name(name: string | null): void;
|
|
78
|
+
/** `*` or `*.ext`; any other glob is refused, since no picker below takes one. */
|
|
79
|
+
add_pattern(pattern: string): void;
|
|
80
|
+
add_suffix(suffix: string): void;
|
|
81
|
+
/** `type/subtype`, `type/*` or `*\/*`. A driver that cannot honour `type/*` refuses it when it opens. */
|
|
82
|
+
add_mime_type(mimeType: string): void;
|
|
83
|
+
}
|
|
84
|
+
export declare function fileFilterSpec(filter: FileFilter): FileFilterSpec;
|
|
85
|
+
/** Whether `basename` passes `spec` by name. MIME types do not judge a name; a MIME-only filter passes. */
|
|
86
|
+
export declare function fileFilterAccepts(spec: FileFilterSpec, basename: string): boolean;
|
|
87
|
+
/** The store `Gtk.FileDialog.filters` takes: `item_type` `Gtk.FileFilter.$gtype`, `append` to fill it. */
|
|
88
|
+
export declare class GioListStore {
|
|
89
|
+
#private;
|
|
90
|
+
constructor(params?: {
|
|
91
|
+
item_type?: GType;
|
|
92
|
+
itemType?: GType;
|
|
93
|
+
});
|
|
94
|
+
get item_type(): GType;
|
|
95
|
+
get n_items(): number;
|
|
96
|
+
append(item: object): void;
|
|
97
|
+
get_n_items(): number;
|
|
98
|
+
get_item(position: number): object | null;
|
|
99
|
+
get_item_type(): GType;
|
|
100
|
+
}
|
|
101
|
+
export declare const FileCreateFlags: Readonly<{
|
|
102
|
+
NONE: 0;
|
|
103
|
+
PRIVATE: 1;
|
|
104
|
+
REPLACE_DESTINATION: 2;
|
|
105
|
+
}>;
|
|
106
|
+
export declare class OutputStream {
|
|
107
|
+
/** @internal */
|
|
108
|
+
constructor(writer: FileChooserWriter);
|
|
109
|
+
write_bytes_async(bytes: Bytes, _io_priority: number, cancellable: unknown, callback: AsyncReadyCallback): void;
|
|
110
|
+
write_bytes_finish(result: unknown): number;
|
|
111
|
+
close_async(_io_priority: number, cancellable: unknown, callback: AsyncReadyCallback): void;
|
|
112
|
+
close_finish(result: unknown): boolean;
|
|
113
|
+
is_closed(): boolean;
|
|
114
|
+
}
|
|
115
|
+
export declare class FileOutputStream extends OutputStream {
|
|
116
|
+
}
|
|
117
|
+
export declare class GioFile {
|
|
118
|
+
/** @internal */
|
|
119
|
+
constructor(handle: FileChooserHandle);
|
|
120
|
+
static new_for_path(): never;
|
|
121
|
+
static new_for_uri(): never;
|
|
122
|
+
static new_for_commandline_arg(): never;
|
|
123
|
+
get_basename(): string;
|
|
124
|
+
/** `null`, as GJS gives for a file with no local path (a portal `content://` file). */
|
|
125
|
+
get_path(): string | null;
|
|
126
|
+
get_uri(): string;
|
|
127
|
+
load_contents_async(cancellable: unknown, callback: AsyncReadyCallback): void;
|
|
128
|
+
/** `[true, contents, etag]`; the etag is `null` here (ADR 0100 § 3). */
|
|
129
|
+
load_contents_finish(result: unknown): [boolean, Uint8Array, string | null];
|
|
130
|
+
replace_contents_async(contents: Uint8Array | Bytes, etag: string | null, make_backup: boolean, flags: number, cancellable: unknown, callback: AsyncReadyCallback): void;
|
|
131
|
+
/** `[true, new_etag]`; the etag is `null` here. */
|
|
132
|
+
replace_contents_finish(result: unknown): [boolean, string | null];
|
|
133
|
+
replace_async(etag: string | null, make_backup: boolean, flags: number, _io_priority: number, cancellable: unknown, callback: AsyncReadyCallback): void;
|
|
134
|
+
replace_finish(result: unknown): FileOutputStream;
|
|
135
|
+
}
|
|
136
|
+
/** A `Gio.File` over `handle`, for a driver to resolve `open`/`save` with. */
|
|
137
|
+
export declare function fileForHandle(handle: FileChooserHandle): GioFile;
|
|
138
|
+
export declare class FileDialog {
|
|
139
|
+
#private;
|
|
140
|
+
constructor(params?: Record<string, unknown>);
|
|
141
|
+
static new(): FileDialog;
|
|
142
|
+
get title(): string | null;
|
|
143
|
+
set title(value: string | null);
|
|
144
|
+
get_title(): string | null;
|
|
145
|
+
set_title(title: string | null): void;
|
|
146
|
+
get modal(): boolean;
|
|
147
|
+
set modal(value: boolean);
|
|
148
|
+
get_modal(): boolean;
|
|
149
|
+
set_modal(modal: boolean): void;
|
|
150
|
+
get filters(): GioListStore | null;
|
|
151
|
+
set filters(value: GioListStore | null);
|
|
152
|
+
get_filters(): GioListStore | null;
|
|
153
|
+
set_filters(filters: GioListStore | null): void;
|
|
154
|
+
get initial_name(): string | null;
|
|
155
|
+
set initial_name(value: string | null);
|
|
156
|
+
get initialName(): string | null;
|
|
157
|
+
set initialName(value: string | null);
|
|
158
|
+
get_initial_name(): string | null;
|
|
159
|
+
set_initial_name(name: string | null): void;
|
|
160
|
+
get default_filter(): FileFilter | null;
|
|
161
|
+
set default_filter(value: FileFilter | null);
|
|
162
|
+
get defaultFilter(): FileFilter | null;
|
|
163
|
+
set defaultFilter(value: FileFilter | null);
|
|
164
|
+
get_default_filter(): FileFilter | null;
|
|
165
|
+
set_default_filter(filter: FileFilter | null): void;
|
|
166
|
+
open(parent: unknown, cancellable: unknown, callback: AsyncReadyCallback): void;
|
|
167
|
+
open_finish(result: unknown): GioFile;
|
|
168
|
+
save(parent: unknown, cancellable: unknown, callback: AsyncReadyCallback): void;
|
|
169
|
+
save_finish(result: unknown): GioFile;
|
|
170
|
+
}
|
|
171
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type FileFilterSpec } from './file-chooser.js';
|
|
2
|
+
/** How the vectors write a filter: `*.ext` per pattern or suffix, `*` for accept-all, MIME types as given. */
|
|
3
|
+
export declare function filterGlobs(spec: FileFilterSpec): string[];
|
|
4
|
+
declare const _default: () => Promise<void>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class Bytes {
|
|
2
|
+
#private;
|
|
3
|
+
constructor(data: Uint8Array);
|
|
4
|
+
static new(data: Uint8Array): Bytes;
|
|
5
|
+
static new_take(): never;
|
|
6
|
+
static new_static(): never;
|
|
7
|
+
get_size(): number;
|
|
8
|
+
get_data(): Uint8Array;
|
|
9
|
+
/** @internal The bytes without a copy, for the stream that writes them. */
|
|
10
|
+
static view(bytes: Bytes): Uint8Array;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** `Gtk.DialogError`: what `Gtk.FileDialog` rejects with. A user closing the dialog is `DISMISSED`. */
|
|
2
|
+
export declare const DialogError: Readonly<{
|
|
3
|
+
FAILED: number;
|
|
4
|
+
CANCELLED: number;
|
|
5
|
+
DISMISSED: number;
|
|
6
|
+
}>;
|
|
7
|
+
/** `Gio.IOErrorEnum`, the codes the `Gio.File` subset raises. */
|
|
8
|
+
export declare const IOErrorEnum: Readonly<{
|
|
9
|
+
FAILED: number;
|
|
10
|
+
NOT_FOUND: number;
|
|
11
|
+
NOT_SUPPORTED: number;
|
|
12
|
+
CLOSED: number;
|
|
13
|
+
CANCELLED: number;
|
|
14
|
+
PENDING: number;
|
|
15
|
+
}>;
|
|
16
|
+
export declare class GLibError {
|
|
17
|
+
readonly domain: number;
|
|
18
|
+
readonly code: number;
|
|
19
|
+
readonly message: string;
|
|
20
|
+
readonly stack: string;
|
|
21
|
+
constructor(domain: unknown, code: number, message: string);
|
|
22
|
+
matches(domain: unknown, code: number): boolean;
|
|
23
|
+
toString(): string;
|
|
24
|
+
static new_literal(): never;
|
|
25
|
+
copy(): never;
|
|
26
|
+
}
|
|
27
|
+
/** `error` as it reaches a caller: a `GLib.Error` passes through, anything else becomes `code` in `domain`. */
|
|
28
|
+
export declare function asGLibError(error: unknown, domain: object, code: number): GLibError;
|
package/lib/types/gobject.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SharedTreeNode } from './conformance/shared-trees.js';
|
|
2
|
+
import type { GObjectEngine } from './engine.js';
|
|
2
3
|
/** What `registerClass` accepts as `Template`: the projected tree of a `?template` import (ADR 0096 § 4). */
|
|
3
4
|
export type BlueprintTemplate = SharedTreeNode;
|
|
4
5
|
/** The subset asked for something it does not list. `feature` is the name that was refused. */
|
|
@@ -116,6 +117,8 @@ export interface RegisteredClass {
|
|
|
116
117
|
readonly internalChildren: readonly string[];
|
|
117
118
|
readonly cssName?: string;
|
|
118
119
|
readonly door: GObjectDoor;
|
|
120
|
+
/** Where instances of this class keep their values and handlers (ADR 0105 § 2). */
|
|
121
|
+
readonly engine: GObjectEngine;
|
|
119
122
|
}
|
|
120
123
|
export declare function registeredClassOf(klass: object): RegisteredClass | undefined;
|
|
121
124
|
export type SignalHandler = (emitter: GObjectInstance, ...args: unknown[]) => unknown;
|
|
@@ -127,6 +130,11 @@ export interface GObjectInstance {
|
|
|
127
130
|
disconnect(id: number): void;
|
|
128
131
|
emit(signal: string, ...args: unknown[]): void;
|
|
129
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* The default {@link GObjectEngine}: per-instance `Map`s behind a `WeakMap`, the only one the
|
|
135
|
+
* browser can have. Registration needs nothing of it — a `$gtype` here is a token, not a GType.
|
|
136
|
+
*/
|
|
137
|
+
export declare const PURE_JS_ENGINE: GObjectEngine;
|
|
130
138
|
/**
|
|
131
139
|
* How an object that is no registered class (the GtkSource buffer and view) takes part in
|
|
132
140
|
* `signal_stop_emission_by_name`: it keeps its own emissions and stops the innermost one of the
|
|
@@ -192,7 +200,7 @@ export declare const UNLOCKED_VFUNCS: Readonly<Record<string, readonly string[]>
|
|
|
192
200
|
* resolve through the registry like a registered class's own. The door is one that names the
|
|
193
201
|
* missing widget model: such a class has no event system to fall through to.
|
|
194
202
|
*/
|
|
195
|
-
export declare function registerBaseClass(klass: ClassLike, typeName: string, signals: Readonly<Record<string, readonly GType[]>>, properties?: readonly ParamSpec[]): void;
|
|
203
|
+
export declare function registerBaseClass(klass: ClassLike, typeName: string, signals: Readonly<Record<string, readonly GType[]>>, properties?: readonly ParamSpec[], engine?: GObjectEngine): void;
|
|
196
204
|
export type GObjectConstructor = new (params?: Record<string, unknown>) => GObjectInstance;
|
|
197
205
|
/** `GObject.Object` for a registered class with no widget model beneath it. */
|
|
198
206
|
export declare class GObjectObject {
|
|
@@ -204,6 +212,12 @@ export declare class GObjectObject {
|
|
|
204
212
|
emit(signal: string, ...args: unknown[]): void;
|
|
205
213
|
}
|
|
206
214
|
export interface GObjectNamespace {
|
|
215
|
+
/**
|
|
216
|
+
* Names the {@link GObjectEngine} THIS namespace was built on — `'pure-js'` for the default.
|
|
217
|
+
* The answer to "what actually backs the subset in this app", asked of the only thing that
|
|
218
|
+
* cannot be wrong about it; {@link gobjectEngineName} is the same answer without a handle.
|
|
219
|
+
*/
|
|
220
|
+
readonly engineName: string;
|
|
207
221
|
readonly Object: GObjectConstructor;
|
|
208
222
|
readonly registerClass: RegisterClass;
|
|
209
223
|
readonly ParamSpec: typeof ParamSpec;
|
|
@@ -228,7 +242,19 @@ export interface GObjectNamespace {
|
|
|
228
242
|
signal_stop_emission_by_name(instance: GObjectInstance, detailedSignal: string): void;
|
|
229
243
|
}
|
|
230
244
|
/**
|
|
231
|
-
* The `GObject` namespace of a port: `registerClass` registers against `door
|
|
232
|
-
*
|
|
245
|
+
* The `GObject` namespace of a port: `registerClass` registers against `door`, and instances of
|
|
246
|
+
* what it registers keep their values and handlers in `engine` (ADR 0105 § 2) — the pure-JS one
|
|
247
|
+
* unless a port passes another. There is no `bind_property` here until a consumer calls it
|
|
248
|
+
* (ADR 0096 § 2); the binding engine is the engine's `bind`, {@link bindProperties} by default.
|
|
249
|
+
*/
|
|
250
|
+
export declare function createGObject(door: GObjectDoor, engine?: GObjectEngine): GObjectNamespace;
|
|
251
|
+
/**
|
|
252
|
+
* Which engine a namespace built from here would be on — `'pure-js'` unless something called
|
|
253
|
+
* `registerGObjectEngine`. The runtime answer to "is the subset backed by real GObject in this
|
|
254
|
+
* build", for an app that wants to log it or a test that wants to assert it, and the reason no
|
|
255
|
+
* caller ever needs a try/catch to find out.
|
|
256
|
+
*
|
|
257
|
+
* Asking FREEZES the slot, exactly as a port's read does: an answer a later registration would
|
|
258
|
+
* turn into a lie is worse than no answer. See `engine.ts` § "The slot".
|
|
233
259
|
*/
|
|
234
|
-
export declare function
|
|
260
|
+
export declare function gobjectEngineName(): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@gjsify/node-gi/gi`'s default export, as much of it as this suite uses: the namespace loader.
|
|
3
|
+
* Declared here rather than imported for the reason in the header — the bridge's own types are not
|
|
4
|
+
* resolvable in a job that has not linked it.
|
|
5
|
+
*/
|
|
6
|
+
export type RequireGi = (namespace: string, version?: string) => unknown;
|
|
7
|
+
export declare const gobjectNodeGiSuite: (requireGi: RequireGi) => () => Promise<void>;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/** What a key event carries into {@link EventControllerKey}. `key` is a DOM `KeyboardEvent.key`. */
|
|
2
|
+
export interface HostKeyEvent {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly keycode: number;
|
|
5
|
+
/** `Gdk.ModifierType` bits. */
|
|
6
|
+
readonly state: number;
|
|
7
|
+
readonly pressed: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** How a port reaches the platform. Every member may be absent on a platform that has no such thing. */
|
|
10
|
+
export interface PlatformHost {
|
|
11
|
+
/** Replaces the style sheet of `owner`; an empty list removes it. The host orders by priority. */
|
|
12
|
+
setStyles(sheets: readonly {
|
|
13
|
+
owner: object;
|
|
14
|
+
css: string;
|
|
15
|
+
priority: number;
|
|
16
|
+
}[]): void;
|
|
17
|
+
openUri(uri: string): void;
|
|
18
|
+
/** The system UI font as `"Name Size"`, or `null` when the platform does not say. */
|
|
19
|
+
fontName(): string | null;
|
|
20
|
+
/** Listens for keys on `widget`; `handler` returns whether it handled the key. */
|
|
21
|
+
listenKeys(widget: object, handler: (event: HostKeyEvent) => boolean): () => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const STYLE_PROVIDER_PRIORITY_FALLBACK = 1;
|
|
24
|
+
export declare const STYLE_PROVIDER_PRIORITY_THEME = 200;
|
|
25
|
+
export declare const STYLE_PROVIDER_PRIORITY_SETTINGS = 400;
|
|
26
|
+
export declare const STYLE_PROVIDER_PRIORITY_APPLICATION = 600;
|
|
27
|
+
export declare const STYLE_PROVIDER_PRIORITY_USER = 800;
|
|
28
|
+
/** `Gdk.CURRENT_TIME`. */
|
|
29
|
+
export declare const CURRENT_TIME = 0;
|
|
30
|
+
/** The X11 keysyms (`Gdk.KEY_*`) an application writes a key map in; the numbers are GDK's. */
|
|
31
|
+
export declare const GDK_KEYS: Readonly<{
|
|
32
|
+
readonly KEY_space: 32;
|
|
33
|
+
readonly KEY_a: 97;
|
|
34
|
+
readonly KEY_d: 100;
|
|
35
|
+
readonly KEY_e: 101;
|
|
36
|
+
readonly KEY_q: 113;
|
|
37
|
+
readonly KEY_s: 115;
|
|
38
|
+
readonly KEY_w: 119;
|
|
39
|
+
readonly KEY_Return: 65293;
|
|
40
|
+
readonly KEY_Escape: 65307;
|
|
41
|
+
readonly KEY_Left: 65361;
|
|
42
|
+
readonly KEY_Up: 65362;
|
|
43
|
+
readonly KEY_Right: 65363;
|
|
44
|
+
readonly KEY_Down: 65364;
|
|
45
|
+
}>;
|
|
46
|
+
/** A DOM `key` as the keysym GTK would deliver: a Latin-1 character is its own code point, lowercased. */
|
|
47
|
+
export declare function keyvalOfKey(key: string): number;
|
|
48
|
+
/** `Gtk.CssProvider`: `load_from_string` is the one loader the subset carries. */
|
|
49
|
+
export declare class CssProvider {
|
|
50
|
+
#private;
|
|
51
|
+
load_from_string(css: string): void;
|
|
52
|
+
to_string(): string;
|
|
53
|
+
/** @internal */
|
|
54
|
+
static bind(provider: CssProvider, onChange: (() => void) | null): void;
|
|
55
|
+
}
|
|
56
|
+
/** `Gtk.Settings`: `gtk_font_name`, held once written. */
|
|
57
|
+
export declare class GtkSettings {
|
|
58
|
+
#private;
|
|
59
|
+
/** @internal */
|
|
60
|
+
constructor(host: PlatformHost);
|
|
61
|
+
get gtk_font_name(): string | null;
|
|
62
|
+
set gtk_font_name(name: string | null);
|
|
63
|
+
}
|
|
64
|
+
/** `Gtk.IconTheme`: the resource paths an application adds; the port's icon registry is the lookup. */
|
|
65
|
+
export declare class IconTheme {
|
|
66
|
+
#private;
|
|
67
|
+
add_resource_path(path: string): void;
|
|
68
|
+
get_resource_path(): string[];
|
|
69
|
+
}
|
|
70
|
+
type KeyHandler = (controller: EventControllerKey, keyval: number, keycode: number, state: number) => boolean | void;
|
|
71
|
+
/** `Gtk.EventControllerKey`: `key-pressed` and `key-released`, the first one's return value counts. */
|
|
72
|
+
export declare class EventControllerKey {
|
|
73
|
+
#private;
|
|
74
|
+
connect(signal: string, handler: KeyHandler): number;
|
|
75
|
+
disconnect(id: number): void;
|
|
76
|
+
/** @internal */
|
|
77
|
+
static attach(controller: EventControllerKey, detach: (() => void) | null): void;
|
|
78
|
+
/** @internal Runs the handlers of one key event; true when one of them took the key. */
|
|
79
|
+
static dispatch(controller: EventControllerKey, event: HostKeyEvent): boolean;
|
|
80
|
+
}
|
|
81
|
+
/** `Gtk` and `Gdk` as far as this slice goes. */
|
|
82
|
+
export interface GtkPlatform {
|
|
83
|
+
readonly CssProvider: typeof CssProvider;
|
|
84
|
+
readonly StyleContext: {
|
|
85
|
+
add_provider_for_display(display: unknown, provider: CssProvider, priority: number): void;
|
|
86
|
+
remove_provider_for_display(display: unknown, provider: CssProvider): void;
|
|
87
|
+
};
|
|
88
|
+
readonly Settings: {
|
|
89
|
+
get_default(): GtkSettings;
|
|
90
|
+
};
|
|
91
|
+
readonly IconTheme: {
|
|
92
|
+
get_for_display(display: unknown): IconTheme;
|
|
93
|
+
};
|
|
94
|
+
readonly EventControllerKey: typeof EventControllerKey;
|
|
95
|
+
show_uri(parent: unknown, uri: string, timestamp: number): void;
|
|
96
|
+
}
|
|
97
|
+
/** A port is always on a display, so `Settings.get_default()` is never null (real GTK: null before `Gtk.init`). */
|
|
98
|
+
export declare function createGtkPlatform(host: PlatformHost): GtkPlatform;
|
|
99
|
+
/** `Gtk.Widget.add_controller` / `remove_controller` for the widgets of a port. */
|
|
100
|
+
export declare function widgetControllerMembers(host: PlatformHost): {
|
|
101
|
+
add_controller(this: object, controller: EventControllerKey): void;
|
|
102
|
+
remove_controller(this: object, controller: EventControllerKey): void;
|
|
103
|
+
};
|
|
104
|
+
export {};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -51,9 +51,16 @@ export { DEFAULT_LABEL_ELLIPSIZE, DEFAULT_LABEL_LINES, DEFAULT_LABEL_MAX_WIDTH_C
|
|
|
51
51
|
export type { LabelAlignItems, LabelEllipsizeMode, LabelJustification, LabelWidthCharsExtent, LabelWrapMode, } from './label.js';
|
|
52
52
|
export { glibClamp, gStrStrip, stringIsNotEmpty } from './glib.js';
|
|
53
53
|
export { ContentFormats, ContentProvider, Clipboard, Display, createGdk, widgetDisplayMembers } from './gdk.js';
|
|
54
|
+
export { CURRENT_TIME, CssProvider, EventControllerKey, GDK_KEYS, GtkSettings, IconTheme, STYLE_PROVIDER_PRIORITY_APPLICATION, STYLE_PROVIDER_PRIORITY_FALLBACK, STYLE_PROVIDER_PRIORITY_SETTINGS, STYLE_PROVIDER_PRIORITY_THEME, STYLE_PROVIDER_PRIORITY_USER, createGtkPlatform, keyvalOfKey, widgetControllerMembers, } from './gtk-platform.js';
|
|
55
|
+
export type { GtkPlatform, HostKeyEvent, PlatformHost } from './gtk-platform.js';
|
|
56
|
+
export { syncDirection, widgetTreeMembers } from './widget-members.js';
|
|
54
57
|
export type { ClipboardHost, GdkClipboard } from './gdk.js';
|
|
55
58
|
export { createGLibTimers } from './glib-timers.js';
|
|
56
59
|
export type { GLibTimers, SourceFunc, TimerHost } from './glib-timers.js';
|
|
60
|
+
export { GLibError, DialogError, IOErrorEnum, asGLibError } from './glib-error.js';
|
|
61
|
+
export { Bytes as GLibBytes } from './glib-bytes.js';
|
|
62
|
+
export { FileDialog as GtkFileDialog, FileFilter as GtkFileFilter, GioFile, GioListStore, OutputStream as GioOutputStream, FileOutputStream as GioFileOutputStream, FileCreateFlags, promisify, registerFileChooserDriver, fileForHandle, fileFilterSpec, fileFilterAccepts, dismissedError, dialogFailedError, } from './file-chooser.js';
|
|
63
|
+
export type { FileChooserDriver, FileChooserHandle, FileChooserRequest, FileChooserWriter, FileFilterSpec, } from './file-chooser.js';
|
|
57
64
|
export { ViewStackState, normalizeIconName, resolvePageTitle } from './view-stack.js';
|
|
58
65
|
export type { AdwViewStackPageInfo, AdwViewStackPageSpec, ViewStackStateChange, ViewStackStateListener, } from './view-stack.js';
|
|
59
66
|
export { BACK_BUTTON_FALLBACK_TOOLTIP, NavigationViewState, describeNavigationDiagnostic } from './navigation-view.js';
|
|
@@ -110,12 +117,14 @@ export { ADW_WRAP_BOX_DEFAULT_ALIGN, ADW_WRAP_BOX_DEFAULT_JUSTIFY, ADW_WRAP_BOX_
|
|
|
110
117
|
export type { AdwWrapBoxJustify, AdwWrapBoxOrientation, AdwWrapBoxPackDirection, AdwWrapPolicy, WrapBoxChildFlex, WrapBoxChildOrderOp, WrapBoxFlexInput, WrapBoxFlexStyle, WrapBoxLineLayout, } from './wrap-box.js';
|
|
111
118
|
export { ADW_SOURCE_6502_DIRECTIVES, ADW_SOURCE_6502_LINE_COMMENT, ADW_SOURCE_6502_OPCODES, ADW_SOURCE_6502_REGISTERS, ADW_SOURCE_6502_TOKEN_ROLES, ADW_SOURCE_HEX_STRIDE, ADW_SOURCE_PALETTE_DARK, ADW_SOURCE_PALETTE_LIGHT, ADW_SOURCE_SYNTAX_ROLES, classifyAsm6502Word, formatHexAddress, formatLineNumber, stripSourceWhitespace, tokenizeAsm6502, } from './source.js';
|
|
112
119
|
export type { AdwSourcePalette, AdwSourceSyntaxRole, AdwSourceTokenClass, AdwSourceTokenStream } from './source.js';
|
|
113
|
-
export { GObjectObject, META_SYMBOLS, ParamFlags, ParamSpec, Value, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_INT, TYPE_STRING, TYPE_UINT, UnsupportedGObjectError, bindProperties, connectInstance, constructRegistered, createClosure, createGObject, disconnectInstance, emitInstance, notifyInstance, registeredClassOf, registerBaseClass, STOP_EMISSION, type StoppableEmitter, UNLOCKED_VFUNCS, GIR_TYPE, } from './gobject.js';
|
|
120
|
+
export { GObjectObject, META_SYMBOLS, ParamFlags, ParamSpec, Value, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_INT, TYPE_STRING, TYPE_UINT, UnsupportedGObjectError, bindProperties, connectInstance, constructRegistered, createClosure, createGObject, disconnectInstance, emitInstance, gobjectEngineName, notifyInstance, PURE_JS_ENGINE, registeredClassOf, registerBaseClass, STOP_EMISSION, type StoppableEmitter, UNLOCKED_VFUNCS, GIR_TYPE, } from './gobject.js';
|
|
114
121
|
export { ApplicationFlags, GioApplicationBase, GtkApplicationBase, withGtkApplication, isValidApplicationId, } from './application.js';
|
|
115
122
|
export type { ApplicationHost, GtkApplicationMembers, GtkApplicationConstructor } from './application.js';
|
|
116
123
|
export { ActionRegistry, SimpleAction, actionRegistryOf, activateWidgetAction, applicationOfWindow, findActionGroup, insertActionGroup, installActionMap, linkWindow, SimpleActionGroup, } from './gio-actions.js';
|
|
117
124
|
export type { ActionActivateHandler, ActionGroupLike, ActionLike, SimpleActionProps } from './gio-actions.js';
|
|
118
125
|
export type { Binding, BindingFlag, BlueprintTemplate, BuiltTemplate, ClassLike, ClassMeta, GObjectConstructor, GObjectDoor, GObjectInstance, GObjectNamespace, GType, ParamKind, RegisterClass, RegisteredClass, SignalHandler, SignalMeta, TemplateScope, } from './gobject.js';
|
|
126
|
+
export { registerGObjectEngine, registeredEngine, resetRegisteredEngine } from './engine.js';
|
|
127
|
+
export type { GObjectEngine } from './engine.js';
|
|
119
128
|
export { MAXUINT32, buildFilenamev, getCurrentDir, getSystemDataDirs } from './glib-paths.js';
|
|
120
|
-
export { StyleManagerBase } from './style-manager.js';
|
|
129
|
+
export { ColorScheme, StyleManagerBase } from './style-manager.js';
|
|
121
130
|
export type { StyleSource } from './style-manager.js';
|
|
@@ -4,11 +4,25 @@ export interface StyleSource {
|
|
|
4
4
|
dark(): boolean;
|
|
5
5
|
/** Calls `changed` whenever `dark()` may have changed; returns the unsubscribe. */
|
|
6
6
|
subscribe(changed: () => void): () => void;
|
|
7
|
+
/** Pins the interface dark or light; `null` hands it back to the system. */
|
|
8
|
+
force?(dark: boolean | null): void;
|
|
7
9
|
}
|
|
10
|
+
/** `Adw.ColorScheme`, with the values of the GIR. */
|
|
11
|
+
export declare const ColorScheme: {
|
|
12
|
+
readonly DEFAULT: 0;
|
|
13
|
+
readonly FORCE_LIGHT: 1;
|
|
14
|
+
readonly PREFER_LIGHT: 2;
|
|
15
|
+
readonly PREFER_DARK: 3;
|
|
16
|
+
readonly FORCE_DARK: 4;
|
|
17
|
+
};
|
|
8
18
|
export declare class StyleManagerBase extends GObjectObject {
|
|
9
19
|
static [GIR_TYPE]: string;
|
|
10
20
|
static source: StyleSource | undefined;
|
|
11
21
|
static get_default(): StyleManagerBase;
|
|
12
22
|
get dark(): boolean;
|
|
13
23
|
get_dark(): boolean;
|
|
24
|
+
get color_scheme(): number;
|
|
25
|
+
set color_scheme(scheme: number);
|
|
26
|
+
get_color_scheme(): number;
|
|
27
|
+
set_color_scheme(scheme: number): void;
|
|
14
28
|
}
|