---@meta
-- Generated by scripts/gen-lua-api.py from the annotations in the Gnoblin sources.
-- Do not edit. Point Lua Language Server at this file with workspace.library.

---@class gnoblin
gnoblin = {}
gnoblin.animations = {}
gnoblin.appearance = {}
gnoblin.auth = {}
gnoblin.capabilities = {}
gnoblin.commands = {}
gnoblin.console = {}
gnoblin.events = {}
gnoblin.events.mutter = {}
gnoblin.focus = {}
gnoblin.grant = {}
gnoblin.input = {}
gnoblin.launch = {}
gnoblin.launches = {}
gnoblin.layer = {}
gnoblin.layers = {}
gnoblin.location = {}
gnoblin.monitor = {}
gnoblin.monitors = {}
gnoblin.permissions = {}
gnoblin.portals = {}
gnoblin.privacy = {}
gnoblin.prompt = {}
gnoblin.runtime = {}
gnoblin.session = {}
gnoblin.shortcuts = {}
gnoblin.windows = {}
gnoblin.workspaces = {}

---@class AnimationEaseBezier
---@field type "cubic-bezier" Easing defined by four control points.
---@field x1 number First control point x, from 0 to 1.
---@field y1 number First control point y.
---@field x2 number Second control point x, from 0 to 1.
---@field y2 number Second control point y.

---@class AnimationFrame
---@field x? number Horizontal translation.
---@field y? number Vertical translation.
---@field scale? number Uniform scale.
---@field scale_x? number Horizontal scale.
---@field scale_y? number Vertical scale.
---@field rotation? number Rotation in degrees.
---@field opacity? number Opacity from 0 to 1.

---@class AnimationArgs
---@field name string Unique name, 1 to 80 ASCII letters, digits, underscores, or hyphens.
---@field event string Lifecycle event supported by the animation.
---@field enable? boolean Whether the named animation is enabled. Default true; false removes it.
---@field duration? integer Duration in milliseconds, from 0 to 10000.
---@field ease? string|AnimationEaseBezier Named easing curve or cubic-bezier curve.
---@field from? AnimationFrame Starting actor properties.
---@field to? AnimationFrame Ending actor properties.
---@field keyframes? table Optional animation keyframes.
---@field origin? string|number[] Pivot name or normalized x,y coordinates.
---@field target? string Animation target hint.

---@class AnimationInfo
---@field name string Animation name.
---@field enable? boolean Whether a custom animation is enabled.
---@field event? string Lifecycle event; empty for animations without one.
---@field duration? integer Duration in milliseconds.
---@field ease? string|AnimationEaseBezier Easing curve.
---@field builtin? boolean True for a built-in animation.
---@field previewable? boolean Whether this animation supports preview controls.
---@field from? AnimationFrame Starting actor properties.
---@field to? AnimationFrame Ending actor properties.
---@field keyframes? table Optional animation keyframes.
---@field origin? string|number[] Animation pivot.
---@field target? string Animation target hint.
---@field revision? integer Configuration revision for this record.

---@class AnimationSurface
---@field id string Stable surface ID.
---@field namespace string Layer-shell namespace.
---@field title string Surface title; may be empty.

---@class AnimationInspectArgs
---@field name string Animation name.
---@field target? string Target ID; defaults to "active".
---@field event? string Lifecycle event override.
---@field target_type? "window"|"layer"|"namespace" Target identifier kind. Default "window".
---@field targetType? "window"|"layer"|"namespace" Legacy spelling of target_type.

---@class AnimationPreviewArgs
---@field name string Animation name.
---@field target? string Target ID; defaults to "active".
---@field event? string Lifecycle event override.
---@field target_type? "window"|"layer"|"namespace" Target identifier kind. Default "window".
---@field targetType? "window"|"layer"|"namespace" Legacy spelling of target_type.
---@field autoplay? boolean Start the preview immediately. Default false.

---@class AnimationInspection
---@field name string Animation name.
---@field event string Lifecycle event.
---@field target string Stable target ID.
---@field target_type "window"|"layer"|"namespace" Target identifier kind.
---@field duration integer Duration in milliseconds.
---@field ease string|AnimationEaseBezier Easing curve.
---@field from AnimationFrame Starting actor properties.
---@field to AnimationFrame Ending actor properties.
---@field keyframes? table Optional animation keyframes.
---@field properties table Properties of the target window or layer.
---@field context table Compositor context used to resolve the animation.
---@field spec table Resolved animation specification.

---@class AnimationPreview
---@field id string Preview session ID.
---@field session string Preview session ID used by control calls.
---@field name string Animation name.
---@field event string Lifecycle event.
---@field target string Stable target ID.
---@field target_type "window"|"layer"|"namespace" Target identifier kind.
---@field progress number Preview progress from 0 to 1.
---@field playing boolean Whether the timeline is playing.
---@field paused boolean Whether the timeline is paused.
---@field revision integer Configuration revision.
---@field spec table Resolved animation specification.

---@class AnimationStopResult
---@field ok boolean True when the preview was stopped.
---@field session string Stopped preview session ID.

---@class AnimationSeekArgs
---@field session string Preview session ID.
---@field progress number Progress from 0 to 1.

---@class AnimationStepArgs
---@field session string Preview session ID.
---@field milliseconds integer Step duration, from 1 to 60000.

---@class AnimationSessionArgs
---@field session string Preview session ID.

---Declare or update a named animation in configuration.
---@param animation AnimationArgs
function gnoblin.animation(animation) end

---Return the configured native animation records.
---@return AnimationInfo[]
function gnoblin.animations.list() end

---Return an animation by name, or nil if it is not registered.
---@param name string Animation name, 1 to 80 ASCII letters, digits, underscores, or hyphens.
---@return AnimationInfo|nil
function gnoblin.animations.get(name) end

---List visible layer-shell surfaces that can be targeted by animations.
---@return {surfaces: AnimationSurface[]}
function gnoblin.animations.surfaces() end

---Resolve an animation against a visible target without starting it.
---@param spec AnimationInspectArgs
---@return AnimationInspection
function gnoblin.animations.inspect(spec) end

---Start a controllable preview of an animation on a visible target.
---@param spec AnimationPreviewArgs
---@return Operation<AnimationPreview>
function gnoblin.animations.preview(spec) end

---Set a preview session to a progress value from 0 to 1.
---@param request AnimationSeekArgs
---@return Operation<AnimationPreview>
function gnoblin.animations.seek(request) end

---Advance a preview session by a duration in milliseconds.
---@param request AnimationStepArgs
---@return Operation<AnimationPreview>
function gnoblin.animations.step(request) end

---Resume a preview session.
---@param request AnimationSessionArgs
---@return Operation<AnimationPreview>
function gnoblin.animations.play(request) end

---Pause a preview session.
---@param request AnimationSessionArgs
---@return Operation<AnimationPreview>
function gnoblin.animations.pause(request) end

---Stop a preview session and restore the target's original actor state.
---@param request AnimationSessionArgs
---@return Operation<AnimationStopResult>
function gnoblin.animations.stop(request) end

---Set preview progress from an AnimationPreview record.
---@param progress number Progress from 0 to 1.
---@return Operation<AnimationPreview>
function AnimationPreview:seek(progress) end

---Advance a preview by milliseconds from an AnimationPreview record.
---@param milliseconds integer Duration from 1 to 60000.
---@return Operation<AnimationPreview>
function AnimationPreview:step(milliseconds) end

---Resume this preview.
---@return Operation<AnimationPreview>
function AnimationPreview:play() end

---Pause this preview.
---@return Operation<AnimationPreview>
function AnimationPreview:pause() end

---Stop this preview and restore the target's original actor state.
---@return Operation<AnimationStopResult>
function AnimationPreview:stop() end

---@class AuthBeginArgs
---@field request_id integer Positive request identifier.
---@field identity? integer Positive identity identifier; omitted when no identity is supplied.

---@class AuthRespondArgs
---@field request_id integer Positive request identifier.
---@field response string UTF-8 response of at most 4096 bytes.

---@class AuthCancelArgs
---@field request_id integer Positive request identifier.

---@class PromptRespondArgs
---@field request_id integer Positive request identifier.
---@field password? string|nil UTF-8 password of at most 4096 bytes, or nil.
---@field confirmed? boolean Confirmation value.
---@field choice? boolean Choice value.

---@class PromptCancelArgs
---@field request_id integer Positive request identifier.

---Begin an authentication request for an identity.
---@param request AuthBeginArgs
---@return Operation<any>
function gnoblin.auth.begin(request) end

---Submit a UTF-8 authentication response of at most 4096 bytes.
---@param request AuthRespondArgs
---@return Operation<any>
function gnoblin.auth.respond(request) end

---Cancel an authentication request.
---@param request AuthCancelArgs
---@return Operation<any>
function gnoblin.auth.cancel(request) end

---Answer a prompt with an optional password, confirmation, or choice.
---@param request PromptRespondArgs
---@return Operation<any>
function gnoblin.prompt.respond(request) end

---Cancel a prompt request.
---@param request PromptCancelArgs
---@return Operation<any>
function gnoblin.prompt.cancel(request) end

---@class CommandCaptureArgs
---@field argv string[] Command and arguments; 1 to 64 entries with a non-empty command name; total size at most 64 KiB.
---@field stdin? string UTF-8 input, at most 4096 bytes.
---@field timeout? integer Timeout in seconds, from 1 to 600. Default 60.

---@class CommandRunResult
---@field accepted boolean True when the command was queued for execution.

---@class CommandResult
---@field exit_code integer Exit status, or the negative signal number when terminated by a signal.
---@field stdout string Standard output, valid UTF-8 and at most 64 KiB.

---Queue a command for asynchronous execution.
---@param argv string[] Command and arguments; 1 to 64 UTF-8 entries, non-empty argv[1], total size at most 64 KiB.
---@return Operation<CommandRunResult>
function gnoblin.commands.run(argv) end

---Run a command and return its standard output and exit code.
---@param request CommandCaptureArgs Command request. Standard error is discarded.
---@return Operation<CommandResult>
function gnoblin.commands.capture(request) end

---@alias Json nil|boolean|number|string|table

---Stable error codes carried by a failed Operation.
---@alias ErrorCode "invalid_argument"|"not_found"|"unsupported"|"denied"|"busy"|"cancelled"|"timed_out"|"unavailable"|"internal"

---The failure of an Operation.
---@class OperationError
---@field code ErrorCode Stable machine-readable code.
---@field message string Human-readable explanation.

---Handle for a request that completes asynchronously. Mutating calls return one; read the result
---with on_complete.
---@class Operation<T>
---@field id integer Identifier of the request.
---@field method string Native method the call maps to.
---@field status "pending"|"succeeded"|"failed"
---@field value T|nil Result once the status is "succeeded".
---@field error OperationError|nil Failure once the status is "failed".

---Call callback when the operation finishes. The callback receives the value and the error; one
---of them is nil.
---@param callback fun(value: any, error: OperationError|nil)
function Operation:on_complete(callback) end

---@class WindowRuleMatch
---@field type? "window"|"layer" Match ordinary windows or layer surfaces.
---@field focused? boolean Match windows according to their current focused state.
---@field app_id? string Lua pattern matched against the window application ID.
---@field title? string Lua pattern matched against the window title.
---@field layer? string Lua pattern matched against the window layer.
---@field workspace_id? string Exact current workspace ID.
---@field workspace_number? integer Current one-based workspace number.

---@class WindowRuleWorkspace
---@field id? string Nonempty workspace ID of at most 128 bytes; set exactly one of `id` or `number`.
---@field number? integer Workspace number from 1 to 1024; set exactly one of `id` or `number`.

---@class WindowRuleCorners
---@field radius? number Corner radius.
---@field smoothing? number Corner smoothing.
---@field border_width? number Border width; clamped by the compositor to -40 through 40.
---@field border_color? string Border color.
---@field padding? number[] Four finite numbers, each from -128 to 128, in top, right, bottom, left order.
---@field keep_maximized? boolean Preserve corner treatment for maximized windows.
---@field keep_fullscreen? boolean Preserve corner treatment for fullscreen windows.
---@field keep_tiled? boolean Preserve corner treatment for tiled windows.
---@field skip_libadwaita? boolean Skip windows identified as libadwaita.
---@field skip_libhandy? boolean Skip windows identified as libhandy.
---@field remove_csd? boolean Remove client-side decorations.
---@field keep_shadow? boolean Preserve the window shadow.
---@field shadow boolean|WindowShadowLayer|WindowShadowLayer[] Enable the default shadow, configure one layer, or configure up to four layers.
---@field shadow_animation table Shadow transition settings read by the compositor.
---@field mode? "auto"|"force"|"off" Corner handling mode; `off` disables corner, border, and shadow effects.

---@class WindowShadowLayer
---@field x? number Horizontal offset.
---@field y? number Vertical offset.
---@field blur? number Blur radius.
---@field spread? number Shadow spread.
---@field opacity? number Shadow opacity.
---@field color? string Shadow color.

---@class WindowRuleFrame
---@field mode? "off"|"auto"|"prefer-server"|"replace" Frame mode.
---@field extents? integer[] Frame extents.
---@field crop? integer[] Frame crop values.
---@field renderer? string Frame renderer.
---@field style? string Frame style.
---@field background? string Frame background color.
---@field foreground? string Frame foreground color.
---@field inactive_background? string Inactive frame background color.
---@field button_layout? string[] Native frame buttons, without duplicates; an empty list hides them.

---Animation names by event. The reserved `in` key aliases `layer_open`; `out` aliases `layer_close`.
---@class WindowRuleAnimation
---@field out? string Animation used when a layer closes; alias for `layer_close`.
---@field open? string Animation used when a layer opens.
---@field close? string Animation used when a layer closes.
---@field dialog_open? string Animation used when a dialog opens.
---@field dialog_close? string Animation used when a dialog closes.
---@field layer_open? string Animation used when a layer opens.
---@field layer_close? string Animation used when a layer closes.
---@field minimize? string Animation used when a window minimizes.
---@field restore? string Animation used when a window restores.
---@field workspace_switch? string Animation used when switching workspaces.
---@field shadow_change? string Animation used when a shadow changes.
---@field resize? string Animation used when a window resizes.
---@field duration? integer Animation duration in milliseconds, from 0 to 5000.
---@field easing? string Animation easing.
---@field ease? string Alias for `easing`.

---@class WindowRuleArgs
---@field match? WindowRuleMatch Match patterns; all supplied patterns must match.
---@field workspace? WindowRuleWorkspace Move a matching window to this workspace.
---@field opacity? number Opacity from 0 to 1; compositor clamps values to this range.
---@field blur? number Background blur from 0 to 100.
---@field blur_ignore_shadows? boolean Exclude shadows from the blurred region.
---@field shader? string Shader path.
---@field shader_uniforms? table Shader uniform values.
---@field animation? string|WindowRuleAnimation Animation name or per-event animation map.
---@field frame? WindowRuleFrame Frame options.
---@field corners? WindowRuleCorners Corner, border, and shadow options.

---@class PermissionRuleArgs
---@field name string Unique name of 1 to 80 ASCII letters, digits, `_`, `.`, or `-`.
---@field match string Valid Lua pattern of 1 to 512 UTF-8 bytes, matched against the application identity.
---@field capabilities string[] Nonempty list of `screen-cast`, `remote-desktop`, `input-capture`, `screenshot`, or `access`.
---@field level "inherit"|"default"|"ask"|"allow"|"deny" Permission level; `default` is the deprecated spelling of `inherit`.
---@field monitors? string[] Nonempty monitor names (1 to 80 ASCII letters, digits, `_`, `.`, `:`, or `-`); valid only for `screen-cast` or `remote-desktop` capabilities.
---@field devices? string[] Optional list of `keyboard`, `pointer`, or `touchscreen`; valid only with `remote-desktop`.
---@field clipboard? boolean Clipboard access setting; valid only with `remote-desktop`.

---Append a window rule to the ordered window-rules list.
---@param rule WindowRuleArgs
function gnoblin.window_rule(rule) end

---Append a permission rule to the permissions rules list.
---@param rule PermissionRuleArgs
function gnoblin.permission_rule(rule) end

---Load and merge Lua configuration files matching a path or glob.
---@param pattern string Path or glob resolved relative to the current config file and configured search directories.
---@return boolean success
function gnoblin.load(pattern) end

---Mark a table as an array so configuration conversion preserves it as a list.
---@param values table Array values; numeric keys must form a dense sequence starting at 1 when converted.
---@return table values
function gnoblin.array(values) end

---Merge settings into the active Lua configuration.
---@param settings table Settings table to merge into the active configuration.
function gnoblin.configure(settings) end

---Event payload passed to a subscription callback. Fields beyond `name` depend on the event.
---@class Event
---@field name string Name of the event that was dispatched.

---Handle returned by an event subscription.
---@class EventSubscription
---@field unsubscribe fun(self: EventSubscription) Stop receiving this event.

---Register a callback for an event. Event names are UTF-8 strings of 1 to 128 bytes.
---@param name string Event name, or `*` to receive every dispatched event.
---@param callback fun(event: Event) Called once for each matching event.
---@return EventSubscription
function gnoblin.on(name, callback) end

---Register a callback for an event. Event names are UTF-8 strings of 1 to 128 bytes.
---@param name string Event name, or `*` to receive every dispatched event.
---@param callback fun(event: Event) Called once for each matching event.
---@return EventSubscription
function gnoblin.events.on(name, callback) end

---Register a callback that is removed after its first event.
---@param name string Event name, or `*` to receive the next dispatched event.
---@param callback fun(event: Event) Called once for the first matching event.
---@return EventSubscription
function gnoblin.events.once(name, callback) end

---Register a callback for a Mutter event. The name must start with `mutter.`.
---@param name string Mutter event name, 1 to 128 UTF-8 bytes.
---@param callback fun(event: Event) Called once for each matching event.
---@return EventSubscription
function gnoblin.events.mutter.on(name, callback) end

---Register a callback for one Mutter event. The name must start with `mutter.`.
---@param name string Mutter event name, 1 to 128 UTF-8 bytes.
---@param callback fun(event: Event) Called once for the first matching event.
---@return EventSubscription
function gnoblin.events.mutter.once(name, callback) end

---@class InputDevice
---@field id string Stable ID for this compositor device instance.
---@field name string Device name; may be empty.
---@field device_type string Device category, such as keyboard, pointer, touchpad, tablet, or pen.
---@field seat? string Seat name.
---@field vendor_id? integer USB vendor ID when available.
---@field product_id? integer USB product ID when available.
---@field capabilities string[] Supported input capabilities.
---@field revision integer Input snapshot revision.

---@class InputSource
---@field id string Source ID used by select_source.
---@field type "xkb"|"ibus" Source implementation.
---@field short_name string Short display name.
---@field name string Display name.
---@field current boolean True when this source is selected.
---@field revision integer Input source snapshot revision.

---@class InputSourceSelector
---@field type "xkb"|"ibus" Source implementation.
---@field id string Non-empty source ID.

---@class OrientationLock
---@field available boolean Whether orientation lock is supported.
---@field locked boolean Whether screen orientation is currently locked.
---@field orientation string Current orientation, or "undefined" when unavailable.
---@field source "runtime"|"config"|"system" Which setting currently controls the lock.
---@field revision integer Orientation lock snapshot revision.

---@class InputHandlerMatch
---@field type "key"|"button"|"motion"|"scroll"|"touch"|"tablet"|"gesture" Required event type.
---@field device_id? string Match only this input device ID.
---@field phase? string Match only this event phase.
---@field modifiers? integer Match the event modifier mask.
---@field keycode? integer Match this hardware key code.
---@field button? integer Match this pointer button.
---@field accelerator? string Match this accelerator.

---@class InputEvent
---@field type string Input event type.
---@field device_id string Input device ID, or empty when unavailable.
---@field phase? string Input event phase.
---@field keycode? integer Hardware key code.
---@field button? integer Pointer button.
---@field modifiers? integer Modifier mask.

---@class InputHandlerResult
---@field action "forward"|"consume" Whether to pass the event onward or consume it.

---@class TextCaret
---@field x number Caret x coordinate.
---@field y number Caret y coordinate.
---@field width number Caret width.
---@field height number Caret height.

---@class TextTarget
---@field window_id? string Target window ID when available.
---@field caret? TextCaret Caret rectangle when available.

---@class OrientationLockValue
---@field value boolean|"inherit" Lock, unlock, or restore the configured/system value.

---Return available input devices.
---@return InputDevice[]
function gnoblin.input.devices() end

---Return available XKB layouts and IBus engines.
---@return InputSource[]
function gnoblin.input.sources() end

---Return the selected input source, or nil when there is no current source.
---@return InputSource|nil
function gnoblin.input.current_source() end

---Alias for input.sources.
---@return InputSource[]
function gnoblin.input.list() end

---Alias for input.current_source.
---@return InputSource|nil
function gnoblin.input.current() end

---Select an XKB layout or IBus engine.
---@param source InputSourceSelector
---@return Operation<InputSource>
function gnoblin.input.select_source(source) end

---Return the current orientation lock state.
---@return OrientationLock
function gnoblin.input.orientation_lock() end

---Set the runtime orientation lock override, or inherit the configured/system value.
---@param value boolean|"inherit" True locks orientation; false unlocks it; "inherit" clears the runtime override.
---@return Operation<OrientationLock>
function gnoblin.input.set_orientation_lock(value) end

---Create a one-use text target from the active shortcut FocusContext.
---@param context FocusContext Context supplied to a shortcut event callback.
---@return Operation<TextTarget>
function gnoblin.input.text_target(context) end

---Register a Lua policy callback for matching input events.
---@param match InputHandlerMatch Event selectors. type is required; other selectors are optional.
---@param handler fun(event: InputEvent): InputHandlerResult|nil Return action="consume" to consume, "forward" or nil to pass through.
---@return string Handler ID.
function gnoblin.input.on(match, handler) end

---Insert one-use text through this target during a runtime event callback.
---@param text string UTF-8 text from 1 to 256 bytes, without control characters.
---@return Operation<boolean>
function TextTarget:insert_text(text) end

---@class Launch
---@field token string Caller-supplied launch token.
---@field application string Application ID, WM class, or WM class instance to observe.
---@field started_at integer Start time in Unix milliseconds.
---@field timeout_ms integer Launch observation deadline in milliseconds.
---@field state "pending"|"started"|"timed_out"|"ended" Current launch state.
---@field revision integer Launch snapshot revision.

---@class LaunchBeginArgs
---@field token string Non-empty token, at most 128 characters.
---@field application string Non-empty application identifier, at most 512 characters.
---@field timeout_ms? integer Timeout in milliseconds, from 100 to 10000. Default 3000.

---@class NativeLaunchBeginArgs
---@field token string Non-empty token, at most 128 characters.
---@field application string Non-empty application identifier, at most 512 characters.
---@field milliseconds? integer Timeout in milliseconds. Default 3000; native requests are clamped to 100–10000.

---@class LaunchEndArgs
---@field token string Non-empty token, at most 128 characters.

---@class LaunchEndResult
---@field ok boolean True when the request was accepted.
---@field token string Launch token.

---@class LaunchSnapshot
---@field launches Launch[] Current launch records.
---@field revision integer Revision of the launch snapshot.

---Begin tracking a matching application launch.
---@param launch LaunchBeginArgs
---@return Operation<Launch>
function gnoblin.launches.begin(launch) end

---Finish tracking a launch token.
---@param token string Non-empty token, at most 128 characters.
---@return Operation<LaunchEndResult>
function gnoblin.launches.finish(token) end

---Alias for launches.finish.
---@param token string Non-empty token, at most 128 characters.
---@return Operation<LaunchEndResult>
gnoblin.launches["end"] = function(token) end

---Return the current launch records.
---@return Launch[]
function gnoblin.launches.list() end

---Return the launch records and their snapshot revision.
---@return LaunchSnapshot
function gnoblin.launches.snapshot() end

---Begin tracking a matching application launch through the singular API.
---@param launch NativeLaunchBeginArgs
---@return Operation<Launch>
function gnoblin.launch.begin(launch) end

---Stop tracking a launch token through the singular API.
---@param request LaunchEndArgs
---@return Operation<LaunchEndResult>
gnoblin.launch["end"] = function(request) end

---Return the current launch snapshot through the singular API.
---@return LaunchSnapshot
function gnoblin.launch.status() end

---@class MonitorRect
---@field x integer X coordinate in compositor layout.
---@field y integer Y coordinate in compositor layout.
---@field width integer Width in logical pixels.
---@field height integer Height in logical pixels.

---@class Monitor
---@field id string Monitor ID.
---@field index integer Zero-based monitor index.
---@field x integer X coordinate in compositor layout.
---@field y integer Y coordinate in compositor layout.
---@field width integer Width in logical pixels.
---@field height integer Height in logical pixels.
---@field primary boolean Whether this is the primary monitor.
---@field scale number Display scale factor.
---@field enabled boolean Whether the monitor is enabled.
---@field name? string Display name when provided by the monitor.
---@field make? string Manufacturer when provided by the monitor.
---@field model? string Model when provided by the monitor.
---@field serial? string Serial number when provided by the monitor.
---@field refresh_rate? number Refresh rate in hertz when a current mode is available.
---@field transform? string Display transform, such as "normal" or "90".
---@field work_area? MonitorRect Work area after layer surfaces reserve exclusive zones.
---@field revision integer State revision for this snapshot.

---@class PrivacyScreenMonitor
---@field id string Monitor ID.
---@field available boolean Whether the monitor supports privacy screen control.
---@field enabled? boolean Whether privacy screen is enabled when available.
---@field locked? boolean Whether privacy screen state is locked when available.

---@class PrivacyScreenSnapshot
---@field requested_enabled boolean Requested global privacy screen state.
---@field source "runtime"|"system"|"config" Where the requested state comes from.
---@field revision integer Snapshot revision.
---@field monitors PrivacyScreenMonitor[] Per-monitor availability and state.

---@class LayerFilter
---@field monitor_id? string Exact monitor ID.
---@field namespace? string Exact layer namespace.
---@field layer? string Exact layer type.

---@class LayerSurface
---@field id string Stable layer surface ID.
---@field namespace string Layer surface namespace.
---@field title string Layer surface title.
---@field layer string Layer-shell layer value.
---@field monitor_id? string Monitor ID when assigned.
---@field revision integer State revision for this snapshot.

---@class LayerAnimationPolicy
---@field namespace string Layer namespace.
---@field enter any Enter animation policy.
---@field exit any Exit animation policy.
---@field window_shadow any Shadow policy for windows matching the layer namespace.
---@field revision integer Configuration revision.

---@class PrivacyScreenSetArgs
---@field value boolean|"inherit" true or false sets an override; "inherit" clears the runtime override.

---Return the current monitor snapshot.
---@return Monitor[]
function gnoblin.monitors.list() end

---Return the primary monitor, or nil when none is available.
---@return Monitor|nil
function gnoblin.monitors.primary() end

---Return the current privacy screen settings and per-monitor states.
---@return PrivacyScreenSnapshot
function gnoblin.monitors.privacy_screen() end

---Set the runtime privacy screen override.
---@param value boolean|"inherit" true or false sets the override; "inherit" restores the configured or system value.
---@return Operation<Json>
function gnoblin.monitors.set_privacy_screen(value) end

---Return monitors through the legacy singular namespace alias.
---@return Monitor[]
function gnoblin.monitor.list() end

---Return the current layer surface snapshot, optionally filtered.
---@param filter? LayerFilter
---@return LayerSurface[]
function gnoblin.layers.list(filter) end

---Return the configured animation policy for a layer namespace.
---@param namespace string UTF-8 namespace from 1 to 128 bytes.
---@return LayerAnimationPolicy
function gnoblin.layers.animation_policy(namespace) end

---Return layer surfaces through the legacy singular namespace alias.
---@return LayerSurface[]
function gnoblin.layer.list() end

---@alias PermissionCapability "screen-cast"|"remote-desktop"|"input-capture"|"screenshot"|"access"
---@alias PermissionLevel "inherit"|"default"|"ask"|"allow"|"deny"
---@alias PermissionReportedLevel "inherit"|"ask"|"allow"|"deny"
---@alias PermissionDecisionLevel "inherit"|"default"|"ask"|"allow"|"deny"
---@alias PortalGrantKind "screen-cast"|"remote-desktop"
---@alias RemoteDesktopDevice "keyboard"|"pointer"|"touchscreen"

---@class PermissionRule
---@field name string Unique rule name of at most 80 ASCII letters, digits, underscore, dot, or hyphen.
---@field match string Nonempty valid Lua pattern of at most 512 UTF-8 bytes, matched against the permission identity.
---@field capabilities PermissionCapability[] Nonempty capabilities selected by this rule.
---@field level PermissionLevel Rule decision level.
---@field monitors? string[] Nonempty monitor names; only for screen-cast or remote-desktop capabilities.
---@field devices? RemoteDesktopDevice[] Nonempty devices; only for remote-desktop capability.
---@field clipboard? boolean Clipboard access; only for remote-desktop capability.

---@class PermissionPolicy
---@field default PermissionReportedLevel Default decision. The deprecated "default" spelling is reported as "inherit".
---@field rules PermissionRule[] Permission rules in configured order.
---@field revision integer Policy revision.

---@class PermissionListSnapshot
---@field policy {default: PermissionReportedLevel, rules: PermissionRule[]} Committed policy values.
---@field capabilities PermissionCapability[] Capabilities accepted by the policy.
---@field levels PermissionReportedLevel[] Levels accepted for the default policy.
---@field path string Config path, or an empty string when not supplied.

---@class PermissionDecision
---@field level PermissionDecisionLevel Effective decision level.
---@field rule string Matching rule name, or an empty string when no rule matched.
---@field monitors string[] Monitor restrictions selected by the effective rule.
---@field devices RemoteDesktopDevice[] Input device restrictions selected by the effective rule.
---@field clipboard boolean Whether clipboard access is allowed by the effective rule.
---@field revision integer Policy revision used to evaluate the decision.

---@class Capability
---@field id string Stable capability identifier.
---@field description string Human-readable capability description.
---@field available boolean Whether the capability is available in this session.
---@field reason? string Present when unavailable; a machine-readable reason.
---@field revision integer Capability snapshot revision.

---@class Grant
---@field id string Opaque portal grant identifier.
---@field kind PortalGrantKind Grant type.
---@field requester string Requester identity reported by the portal.
---@field devices integer Bit mask: keyboard is 1, pointer is 2, and touchscreen is 4.
---@field clipboard boolean Whether clipboard access was granted.
---@field screenStreams boolean Whether the grant has a saved screen stream selection.

---@class PortalGrant
---@field id string Opaque portal grant identifier.
---@field kind PortalGrantKind Grant type.
---@field requester string Requester identity reported by the portal.
---@field devices RemoteDesktopDevice[] Granted input devices.
---@field clipboard boolean Whether clipboard access was granted.
---@field has_screen_streams boolean Whether the grant has active screen streams.
---@field created_at integer Grant creation time in Unix milliseconds.
---@field revision integer Grant snapshot revision.

---@class PermissionCheckArgs
---@field capability PermissionCapability Capability to evaluate.
---@field identity string Permission identity, normally prefixed by "app-id:" or "host-exe:/".

---@class PortalGrantFilter
---@field kind? PortalGrantKind Return only grants of this kind.

---@class GrantRevokeArgs
---@field kind PortalGrantKind Type of the grant to revoke.
---@field id string Nonempty opaque grant identifier.
---@field created_at? integer Nonnegative creation time in Unix milliseconds, used to guard against revoking a replaced grant.

---@class GrantRevokeResult
---@field ok boolean Whether the grant was revoked.
---@field id string Identifier of the revoked grant.

---List capabilities available in the current session.
---@return Capability[]
function gnoblin.capabilities.list() end

---Read the committed permission policy and its supported values.
---@return PermissionListSnapshot
function gnoblin.permissions.list() end

---Read the effective committed permission policy.
---@return PermissionPolicy
function gnoblin.permissions.policy() end

---Evaluate a permission for a capability and application identity. Pass a PermissionCheckArgs table or a capability and identity string.
---@param request PermissionCheckArgs|PermissionCapability
---@param identity? string Required when request is a capability string.
---@return PermissionDecision
function gnoblin.permissions.check(request, identity) end

---List portal grants, optionally filtered by grant kind.
---@param filter? PortalGrantFilter
---@return PortalGrant[]
function gnoblin.portals.grants(filter) end

---@class GrantListResult
---@field grants Grant[] Portal grants returned by the backend.

---List portal grants through an asynchronous operation.
---@return Operation<GrantListResult>
function gnoblin.grant.list() end

---Revoke a portal grant by its kind and opaque identifier.
---@param grant GrantRevokeArgs
---@return Operation<GrantRevokeResult>
function gnoblin.grant.revoke(grant) end

---Revoke this portal grant.
---@return Operation<GrantRevokeResult>
function PortalGrant:revoke() end

---@class SessionStatus
---@field state "running" Session status returned by the compositor.
---@field lock_available boolean Whether the compositor can report session lock state.
---@field revision integer Lock state revision.
---@field lock_state? "unlocked"|"covering"|"locked"|"failsafe" Present when lock_available is true.
---@field session_state? "starting"|"running"|"stopping" Session lifecycle state when supported.
---@field session_revision? integer Lifecycle revision, present with session_state.

---@class SessionActivity
---@field available boolean Whether idle activity data is available.
---@field idle boolean Whether the session has been idle for at least threshold_ms.
---@field threshold_ms integer Idle threshold in milliseconds.
---@field idle_for_ms integer Time since the last activity in milliseconds.
---@field revision integer Activity snapshot revision.

---@class RuntimeStatus
---@field state "starting"|"running"|"restarting"|"unavailable" Runtime worker state.
---@field generation integer Active runtime generation.

---@class PrivacyAvailability
---@field screen_sharing boolean Whether screen sharing state is available.
---@field recording boolean Whether recording state is available.
---@field microphone_in_use boolean Whether microphone use can be observed.
---@field camera_in_use boolean Whether camera use can be observed.
---@field location_in_use boolean Whether location use can be observed.

---@class PrivacyState
---@field available PrivacyAvailability Availability of each privacy signal.
---@field screen_sharing boolean Whether a screen sharing session is active.
---@field recording boolean Whether a recording session is active.
---@field microphone_in_use? boolean Present when microphone monitoring is available.
---@field camera_in_use? boolean Present when camera monitoring is available.
---@field location_in_use? boolean Present when location monitoring is available.
---@field revision integer Privacy state revision.

---@class VersionInfo
---@field gnoblin string Gnoblin version, or "unknown" when unavailable.
---@field gnome string GNOME version, or "unknown" when unavailable.
---@field mutter string Mutter version, or "unknown" when unavailable.
---@field lua string Lua version.
---@field api string Native API version, or "unknown" when unavailable.
---@field git_remote string Sanitized source remote, or "unknown" when unavailable.
---@field git_sha string Source revision, or "unknown" when unavailable.
---@field build_id string Build identifier, or "unknown" when unavailable.

---@class SessionLockResult
---@field dispatched boolean Whether the lock request was dispatched.
---@field subscribers integer Number of session lock subscribers.

---@class AcceptedResult
---@field accepted boolean Whether the request was accepted.

---@class ConfigReloadResult
---@field ok boolean Whether the reload request succeeded.
---@field action string Reload action reported by the runtime.

---@class PrivacyStopResult
---@field requested integer Number of privacy sessions asked to stop.

---@class LocationAuthorizationResult
---@field request_id integer Identifier of the answered authorization request.
---@field submitted boolean Whether the response was submitted.

---@class ConsoleToggleResult
---@field toggled boolean Whether the console was toggled.

---@alias ColorScheme "default"|"prefer-dark"|"prefer-light"

---Read the current compositor session and lock state.
---@return SessionStatus
function gnoblin.session.status() end

---Read the session idle state and elapsed idle time.
---@return SessionActivity
function gnoblin.session.activity() end

---Request that the compositor lock the session.
---@return Operation<SessionLockResult>
function gnoblin.session.lock() end

---Request that the session log out.
---@return Operation<AcceptedResult>
function gnoblin.session.logout() end

---Read the Lua runtime worker state and generation.
---@return RuntimeStatus
function gnoblin.runtime.status() end

---Ask the runtime to reload its configuration.
---@return Operation<ConfigReloadResult>
function gnoblin.runtime.reload_config() end

---Read the available privacy signals and current activity.
---@return PrivacyState
function gnoblin.privacy.state() end

---Request that active screen sharing sessions stop.
---@return Operation<PrivacyStopResult>
function gnoblin.privacy.stop_sharing() end

---Request that active recording sessions stop.
---@return Operation<PrivacyStopResult>
function gnoblin.privacy.stop_recording() end

---Answer a pending location authorization request. The request ID must have been received from an active authorization event subscription.
---@param request LocationAuthorizationArgs
---@return Operation<LocationAuthorizationResult>
function gnoblin.location.authorize_app(request) end

---@class LocationAuthorizationArgs
---@field request_id integer Positive ID from a pending location authorization request.
---@field allow boolean Whether to allow location access.
---@field accuracy integer 0 when denied; when allowed, one of 1, 4, 5, 6, or 8 and no greater than the requested accuracy.

---Read installed Gnoblin, GNOME, Mutter, Lua, API, and build version information.
---@return VersionInfo
function gnoblin.version() end

---Toggle the shell console.
---@return Operation<ConsoleToggleResult>
function gnoblin.console.toggle() end

---Read the current desktop color scheme, or nil when unavailable.
---@return ColorScheme|nil
function gnoblin.appearance.color_scheme() end

---Return a detached copy of the active Lua configuration table.
---@return Json
function gnoblin.snapshot() end

---@class ShortcutAction
---@field id string Action identifier.
---@field group "wm"|"mutter"|"wayland" Action group.
---@field key string Action key, with hyphens converted to underscores.
---@field description? string Action description.
---@field default_bindings string[] Default accelerator strings.

---@class ShortcutState
---@field name string Configured shortcut name.
---@field binding string|string[] One accelerator, or all configured accelerators.
---@field enabled boolean Whether the shortcut is enabled.
---@field trigger "press"|"release" Event edge that activates the shortcut.
---@field action? string Built-in action identifier.
---@field command? string[] Command argument vector.
---@field revision integer Shortcut snapshot revision.

---@class ShortcutBinding
---@field id string Caller-supplied binding ID.
---@field accelerator string Accelerator accepted by Mutter.
---@field hold "none"|"super"|"control"|"alt" Modifier family held for the binding. Default "none".
---@field trigger "press"|"release" Event edge that activates the binding. Default "press".
---@field mode "passive"|"modal" Whether other input continues while held. Default "passive".
---@field capture_input boolean Whether the bare Super session captures subsequent key input. Default false.

---@class ShortcutBindingArgs
---@field id string Unique ID, 1 to 64 ASCII letters, digits, underscores, or hyphens.
---@field accelerator string Valid accelerator. Bare "Super" requires capture_input=true, trigger="release", and hold="none".
---@field hold? "none"|"super"|"control"|"alt" Modifier family held for the binding. Default "none".
---@field trigger? "press"|"release" Activation edge. Default "press".
---@field mode? "passive"|"modal" Modal requires a non-none hold. Default "passive".
---@field capture_input? boolean Only bare "Super" supports input capture. Default false.

---@class ShortcutIdArgs
---@field id string Binding ID owned by this Lua runtime.

---@class ShortcutSessionArgs
---@field id string Binding ID owned by this Lua runtime.
---@field session_id integer Positive ID of the active binding session.

---@class ShortcutUnbindResult
---@field id string Unbound binding ID.
---@field unbound boolean True when the binding was removed.

---@class ShortcutEndSessionResult
---@field id string Binding ID.
---@field session_id integer Ended session ID.
---@field ended boolean True when the session was ended.

---@class ShortcutCaptureOptions
---@field timeout? integer Capture timeout in seconds, from 1 to 60. Default 30.

---@class ShortcutCaptureResult
---@field accelerator string Captured normalized accelerator.

---List registered shortcut actions, optionally limited to a group.
---@param group? "wm"|"mutter"|"wayland" Action group.
---@return ShortcutAction[]
function gnoblin.shortcuts.actions(group) end

---List the configured shortcut records.
---@return ShortcutState[]
function gnoblin.shortcuts.list() end

---Register a shortcut binding owned by the current Lua runtime.
---@param binding ShortcutBindingArgs
---@return Operation<ShortcutBinding>
function gnoblin.shortcuts.bind(binding) end

---Remove a shortcut binding owned by the current Lua runtime.
---@param binding ShortcutIdArgs
---@return Operation<ShortcutUnbindResult>
function gnoblin.shortcuts.unbind(binding) end

---Capture one normalized keyboard accelerator.
---@param options? ShortcutCaptureOptions
---@return Operation<ShortcutCaptureResult>
function gnoblin.shortcuts.capture(options) end

---End an active shortcut binding session.
---@param session ShortcutSessionArgs
---@return Operation<ShortcutEndSessionResult>
function gnoblin.shortcuts.end_session(session) end

---@class WindowFrame
---@field x integer Frame origin on the compositor layout, from -100000 to 100000.
---@field y integer Frame origin on the compositor layout, from -100000 to 100000.
---@field width integer Frame width, from 1 to 32768.
---@field height integer Frame height, from 1 to 32768.

---@class Window
---@field id string Stable window ID.
---@field title string Window title; empty when the native window has no title.
---@field app_id string Application ID used for matching.
---@field gtk_app_id? string GTK application ID, when present.
---@field wm_class? string Window manager class, when present.
---@field rule_app_id? string Application ID used by window rules, when present.
---@field workspace_id? string ID of the workspace containing the window.
---@field workspace_number? integer One-based workspace number.
---@field monitor_index? integer Zero-based monitor index.
---@field monitor_id? string ID of the monitor containing the window.
---@field above? boolean Whether the window is kept above others.
---@field sticky? boolean Whether the window appears on all workspaces.
---@field demands_attention? boolean Whether the window requests attention.
---@field closable? boolean Whether the window can be closed.
---@field minimizable? boolean Whether the window can be minimized.
---@field maximizable? boolean Whether the window can be maximized.
---@field movable? boolean Whether the window can be moved.
---@field resizable? boolean Whether the window can be resized.
---@field role? string Window role.
---@field type? integer Native window type value.
---@field maximized? boolean Whether the window is maximized.
---@field fullscreen? boolean Whether the window is fullscreen.
---@field minimized? boolean Whether the window is minimized.
---@field last_user_time? integer Timestamp of the most recent user interaction.
---@field parent? string ID of the parent window, when present.
---@field monitor? integer Zero-based monitor index.
---@field frame WindowFrame Window frame rectangle.
---@field focused boolean Whether the window currently has focus.
---@field modal boolean Whether the window is a modal dialog.
---@field revision integer State revision for this snapshot.

---@class WindowFilter
---@field app_id? string Exact application ID.
---@field title? string Case-insensitive substring of the title.
---@field focused? boolean Include focused windows when true, or unfocused windows when false.
---@field workspace_id? string Exact workspace ID.
---@field monitor_id? string Exact monitor ID.

---@class WindowPosition
---@field x integer X coordinate, from -100000 to 100000.
---@field y integer Y coordinate, from -100000 to 100000.

---@class WindowSize
---@field width integer Width, from 1 to 32768.
---@field height integer Height, from 1 to 32768.

---@class WindowMonitorSelector
---@field id string Monitor ID.

---@class WindowThumbnailSize
---@field width integer Thumbnail width from 1 to 480 pixels.
---@field height integer Thumbnail height from 1 to 320 pixels.

---@class FocusHistoryFilter
---@field workspace_id? string Exact workspace ID.
---@field monitor_id? string Exact monitor ID.
---@field limit? integer Maximum records from 1 to 256. Default 50.

---@class FocusContext

---@class SnapContextFrame
---@field x integer X coordinate, from -100000 to 100000.
---@field y integer Y coordinate, from -100000 to 100000.
---@field width integer Width, from 1 to 32768.
---@field height integer Height, from 1 to 32768.

---@class SnapContextCommitArgs
---@field monitor_id string Nonempty UTF-8 monitor ID of at most 128 bytes.
---@field frame SnapContextFrame Target frame rectangle.

---@class SnapContext
---@field window_id string ID of the focused window captured by this context.
---@field monitor_id string ID of the monitor containing the focused window.
---@field expires_at_us integer Monotonic expiry time in microseconds.
---@field monitor MonitorRect Monitor bounds at context creation.
---@field work_area MonitorRect Usable monitor area at context creation.
---@field original_frame WindowFrame Window frame at context creation.
---@field settings_revision integer Configuration revision captured by the context.
---@field native_generation integer Native session generation captured by the context.

---Return the current window snapshot, optionally filtered by application, title, focus, workspace, or monitor.
---@param filter? WindowFilter
---@return Window[]
function gnoblin.windows.list(filter) end

---Identity and window-rule fields for one window, the record that gnoblinctl window match
---prints. Selecting "active" means the focused window.
---@param window? string "active" or a stable window ID; the default is "active".
---@return WindowMatch
function Window:match(window) end

---The record that Window:match returns.
---@class WindowMatch
---@field id string Stable window ID of the matched window.
---@field identity WindowMatchIdentity Verified identity.
---@field match WindowRuleMatch Fields a window rule can match on.

---Identity verified from the window record.
---@class WindowMatchIdentity
---@field app_id string Application ID used for matching.
---@field gtk_app_id? string GTK application ID, when present.
---@field wm_class? string Window manager class, when present.

---Identity and window-rule fields for one window, the record that gnoblinctl window match prints.
---Return windows in most-recently-focused order, optionally filtered.
---@param filter? FocusHistoryFilter
---@return Window[]
function gnoblin.focus.history(filter) end

---Close this window.
---@return Operation<Json>
function Window:close() end

---Minimize this window.
---@return Operation<Json>
function Window:minimize() end

---Toggle this window's minimized state.
---@return Operation<Json>
function Window:toggle_minimize() end

---Remove this window from its minimized state.
---@return Operation<Json>
function Window:unminimize() end

---Restore this window from its minimized, maximized, or fullscreen state.
---@return Operation<Json>
function Window:restore() end

---Restore this window, or minimize it when already restored.
---@return Operation<Json>
function Window:restore_or_minimize() end

---Set whether this window is maximized.
---@param enabled boolean True to maximize; false to restore.
---@return Operation<Json>
function Window:set_maximized(enabled) end

---Set whether this window is fullscreen.
---@param enabled boolean True to enter fullscreen; false to leave it.
---@return Operation<Json>
function Window:set_fullscreen(enabled) end

---Set whether this window stays above other windows.
---@param enabled boolean True to keep above; false to clear.
---@return Operation<Json>
function Window:set_above(enabled) end

---Set whether this window appears on every workspace.
---@param enabled boolean True to make sticky; false to clear.
---@return Operation<Json>
function Window:set_sticky(enabled) end

---Move this window to a position in the compositor layout.
---@param position WindowPosition
---@return Operation<Json>
function Window:move(position) end

---Resize this window.
---@param size WindowSize
---@return Operation<Json>
function Window:resize(size) end

---Move this window to a workspace.
---@param workspace WorkspaceSelector Select by exactly one of id or one-based number.
---@param options? WorkspaceMoveOptions
---@return Operation<Json>
function Window:move_to_workspace(workspace, options) end

---Move this window to a monitor.
---@param monitor string|WindowMonitorSelector Monitor ID or a table containing id.
---@return Operation<Json>
function Window:move_to_monitor(monitor) end

---Focus this window using a live shortcut-event context.
---@param context FocusContext Live context from the current shortcut event.
---@return Operation<Json>
function Window:focus(context) end

---Begin an interactive move using a live shortcut-event context.
---@param context FocusContext Live context from the current shortcut event.
---@return Operation<Json>
function Window:begin_move(context) end

---Begin an interactive resize using a live shortcut-event context.
---@param edge "north"|"south"|"east"|"west"|"north_east"|"north_west"|"south_east"|"south_west"
---@param context FocusContext Live context from the current shortcut event.
---@return Operation<Json>
function Window:begin_resize(edge, context) end

---Capture a thumbnail at the requested dimensions.
---@param size WindowThumbnailSize
---@return Operation<Json>
function Window:thumbnail(size) end

---Commit a snap context to a monitor and frame. A context can be committed only once.
---@param request SnapContextCommitArgs
---@return Operation<Json>
function SnapContext:commit(request) end

---@class Workspace
---@field id? string Stable workspace ID. The current native workspace snapshot does not provide this field.
---@field number integer One-based workspace number.
---@field name string Workspace name.
---@field active boolean Whether this is the active workspace.
---@field windows integer Number of windows on this workspace.

---@class WorkspaceCreateArgs
---@field name string Nonempty UTF-8 name of at most 80 characters.
---@field id? string Optional ID. Must start with a letter or number and contain only letters, numbers, '.', '_' or '-'; at most 64 characters. Lua accepts it, but the current native compositor rejects it.
---@field activate? boolean Activate the new workspace after creation. Default false.

---@class WorkspaceRenameArgs
---@field id? string Stable workspace ID; provide exactly one of id or number.
---@field number? integer One-based workspace number from 1 to 1024; provide exactly one of id or number.
---@field name string Nonempty UTF-8 name of at most 80 characters.

---@class WorkspaceSelector
---@field id? string Stable workspace ID; provide exactly one of id or number.
---@field number? integer One-based workspace number from 1 to 1024; provide exactly one of id or number.

---@class WorkspaceMoveOptions
---@field follow? boolean Activate the destination workspace after moving. Default false.

---@class WorkspaceMoveActiveArgs
---@field workspace WorkspaceSelector Destination workspace.
---@field follow? boolean Activate the destination after moving. Default false.

---@class WorkspaceMoveWindowArgs
---@field window string Stable window ID, or "active" for the focused window.
---@field workspace WorkspaceSelector Destination workspace.
---@field follow? boolean Activate the destination after moving. Default false.

---@class WorkspaceMoveResult
---@field workspace Workspace Destination workspace snapshot.
---@field window string ID of the moved window.
---@field follow boolean Whether the destination workspace was activated.

---Return the current workspace snapshot.
---@return Workspace[]
function gnoblin.workspaces.list() end

---Return the active workspace, or nil when unavailable.
---@return Workspace|nil
function gnoblin.workspaces.active() end

---Find a workspace by its stable ID when the snapshot supplies IDs. Current native workspace snapshots omit IDs, so this returns nil there.
---@param id string Stable workspace ID.
---@return Workspace|nil
function gnoblin.workspaces.by_id(id) end

---Create a workspace with a name and optional activation.
---@param workspace WorkspaceCreateArgs
---@return Operation<Workspace>
function gnoblin.workspaces.create(workspace) end

---Rename a workspace selected by ID or one-based number.
---@param workspace WorkspaceRenameArgs
---@return Operation<Workspace>
function gnoblin.workspaces.rename(workspace) end

---Remove an inactive, empty workspace when at least one other workspace remains.
---@param workspace WorkspaceSelector
---@return Operation<Workspace>
function gnoblin.workspaces.remove(workspace) end

---Activate a workspace selected by ID or one-based number. The current native compositor supports number selectors and rejects ID selectors.
---@param workspace WorkspaceSelector
---@return Operation<Workspace>
function gnoblin.workspaces.activate(workspace) end

---Activate the next workspace, wrapping to the first.
---@return Operation<Workspace>
function gnoblin.workspaces.next() end

---Activate the previous workspace, wrapping to the last.
---@return Operation<Workspace>
function gnoblin.workspaces.previous() end

---Move the focused window to a workspace.
---@param request WorkspaceMoveActiveArgs
---@return Operation<WorkspaceMoveResult>
function gnoblin.workspaces.move_active(request) end

---Move a window to a workspace.
---@param request WorkspaceMoveWindowArgs
---@return Operation<WorkspaceMoveResult>
function gnoblin.workspaces.move_window(request) end

---Activate this workspace.
---@return Operation<Workspace>
function Workspace:activate() end

---Rename this workspace.
---@param name string Nonempty UTF-8 name of at most 80 characters.
---@return Operation<Workspace>
function Workspace:rename(name) end

---Remove this workspace if it is inactive and empty.
---@return Operation<Workspace>
function Workspace:remove() end

---Move a window into this workspace.
---@param window Window|string Window snapshot or stable window ID.
---@param options? WorkspaceMoveOptions
---@return Operation<WorkspaceMoveResult>
function Workspace:move_here(window, options) end
