slint-ui
Version:
Slint is a declarative GUI toolkit to build native user interfaces for desktop and embedded applications.
964 lines (963 loc) • 41.9 kB
TypeScript
import { DataTransfer } from "../../binding.cjs";
declare const _data: {
/**
* The enum reports what happened to the `PointerEventButton` in the event
*/
readonly PointerEventKind: {
/**
* The action was cancelled.
*/
readonly Cancel: "cancel";
/**
* The button was pressed.
*/
readonly Down: "down";
/**
* The button was released.
*/
readonly Up: "up";
/**
* The pointer has moved,
*/
readonly Move: "move";
};
/**
* This enum describes the different types of buttons for a pointer event,
* typically on a mouse or a pencil.
*/
readonly PointerEventButton: {
/**
* A button that is none of left, right, middle, back or forward. For example,
* this is used for the task button on a mouse with many buttons.
*/
readonly Other: "other";
/**
* The left button.
*/
readonly Left: "left";
/**
* The right button.
*/
readonly Right: "right";
/**
* The center button.
*/
readonly Middle: "middle";
/**
* The back button.
*/
readonly Back: "back";
/**
* The forward button.
*/
readonly Forward: "forward";
};
/**
* This enum represents the different values for the `accessible-role` property, used to describe the
* role of an element in the context of assistive technology such as screen readers.
*
* In addition to widget roles, this enum includes *landmark* roles (`banner`, `complementary`,
* `content-info`, `form`, `main`, `navigation`, `region`, `search`).
* Landmarks identify large content areas that screen reader users can jump between,
* giving the application a navigable structure similar to headings in a document.
* See [WAI-ARIA Landmark Regions](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/)
* for guidance on when and how to use them.
*/
readonly AccessibleRole: {
/**
* The element isn't accessible.
*/
readonly None: "none";
/**
* The element is a `Button` or behaves like one.
*/
readonly Button: "button";
/**
* The element is a `CheckBox` or behaves like one.
*/
readonly Checkbox: "checkbox";
/**
* The element is a `ComboBox` or behaves like one.
*/
readonly Combobox: "combobox";
/**
* The element is a `GroupBox` or behaves like one.
*/
readonly Groupbox: "groupbox";
/**
* The element is an `Image` or behaves like one. This is automatically applied to `Image` elements.
*/
readonly Image: "image";
/**
* The element is a `ListView` or behaves like one.
*/
readonly List: "list";
/**
* The element is a `Slider` or behaves like one.
*/
readonly Slider: "slider";
/**
* The element is a `SpinBox` or behaves like one.
*/
readonly Spinbox: "spinbox";
/**
* The element is a `Tab` or behaves like one.
*/
readonly Tab: "tab";
/**
* The element is similar to the tab bar in a `TabWidget`.
*/
readonly TabList: "tab-list";
/**
* The element is a container for tab content.
*/
readonly TabPanel: "tab-panel";
/**
* The role for a `Text` element. This is automatically applied to `Text` elements.
*/
readonly Text: "text";
/**
* The role for a `TableView` or behaves like one.
*/
readonly Table: "table";
/**
* The role for a TreeView or behaves like one. (Not provided yet)
*/
readonly Tree: "tree";
/**
* The element is a `ProgressIndicator` or behaves like one.
*/
readonly ProgressIndicator: "progress-indicator";
/**
* The role for widget with editable text such as a `LineEdit` or a `TextEdit`.
* This is automatically applied to `TextInput` elements.
*/
readonly TextInput: "text-input";
/**
* The element is a `Switch` or behaves like one.
*/
readonly Switch: "switch";
/**
* The element is an item in a `ListView`.
*/
readonly ListItem: "list-item";
/**
* The element is a `RadioButton` or behaves like one.
*/
readonly RadioButton: "radio-button";
/**
* The element is a container grouping related `RadioButton`s.
*/
readonly RadioGroup: "radio-group";
/**
* Landmark: the header area of the application, typically containing a logo, title, or global navigation.
*/
readonly Banner: "banner";
/**
* Landmark: a supporting section that complements the main content, such as a sidebar.
*/
readonly Complementary: "complementary";
/**
* Landmark: information about the application or its content, typically at the bottom (e.g. status bar, copyright).
*/
readonly ContentInfo: "content-info";
/**
* Landmark: a region containing input fields and controls for submitting information.
*/
readonly Form: "form";
/**
* Landmark: the primary content of the application. Each view should have exactly one `main` landmark.
*/
readonly Main: "main";
/**
* Landmark: a group of links or controls used for navigating the application.
*/
readonly Navigation: "navigation";
/**
* Landmark: a generic section significant enough to be listed in a summary.
* Use a more specific landmark if one applies.
*/
readonly Region: "region";
/**
* Landmark: a region containing controls for searching or filtering content.
*/
readonly Search: "search";
};
/**
* This enum represents the different values of the `accessible-live-region` property.
* It indicates that an element is a live region whose content changes should be
* announced by assistive technologies.
*/
readonly AccessibleLiveness: {
/**
* Use in regions that present information that is of low-importance to the user.
* Assistive technologies are expected to not announce changes unless the user explicitly asks for it.
*/
readonly Off: "off";
/**
* Use in regions that present new information to users.
* Assistive technologies are expected to not interrupt the user to inform of changes to the live region.
*/
readonly Polite: "polite";
/**
* Use in regions that present information that a user should know about right away.
* Assistive technologies are expected to announce to the user as soon as possible.
*/
readonly Assertive: "assertive";
};
/**
* This enum represents the different values of the `sort-order` property.
* It's used to sort a `StandardTableView` by a column.
*/
readonly SortOrder: {
/**
* The column is unsorted.
*/
readonly Unsorted: "unsorted";
/**
* The column is sorted in ascending order.
*/
readonly Ascending: "ascending";
/**
* The column is sorted in descending order.
*/
readonly Descending: "descending";
};
/**
* Represents the orientation of an element or widget such as the `Slider`.
*/
readonly Orientation: {
/**
* Element is oriented horizontally.
*/
readonly Horizontal: "horizontal";
/**
* Element is oriented vertically.
*/
readonly Vertical: "vertical";
};
/**
* This enum indicates the color scheme used by the widget style. Use this to explicitly switch
* between dark and light schemes, or choose Unknown to fall back to the system default.
*/
readonly ColorScheme: {
/**
* The scheme is not known and a system wide setting configures this. This could mean that
* the widgets are shown in a dark or light scheme, but it could also be a custom color scheme.
*/
readonly Unknown: "unknown";
/**
* The style chooses light colors for the background and dark for the foreground.
*/
readonly Dark: "dark";
/**
* The style chooses dark colors for the background and light for the foreground.
*/
readonly Light: "light";
};
/**
* This enum describes the action negotiated between the source of a drag (`DragArea`)
* and its target (`DropArea`) during a drag-and-drop operation. The source declares
* which actions it permits, the target picks one in its `can-drop` callback, and the
* chosen action is reported back to the source via `drag-finished` so that, for
* example, a `move` source can remove the original data. The same enum is used for
* drags that come from another application or window once native drag-and-drop is
* in play.
*/
readonly DragAction: {
/**
* No action: the drag is rejected, no drop will be delivered.
*/
readonly None: "none";
/**
* The data is copied to the target; the source retains it.
*/
readonly Copy: "copy";
/**
* The data is moved to the target; the source should remove it once the
* operation completes.
*/
readonly Move: "move";
/**
* A link to the source data is created at the target; neither side gives
* up ownership.
*/
readonly Link: "link";
};
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* The `KeyboardModifiers` struct provides booleans to indicate possible modifier keys on a keyboard, such as Shift, Control, etc.
* It is provided as part of `KeyEvent`'s `modifiers` field.
*
* Keyboard shortcuts on Apple platforms typically use the Command key (⌘), such as Command+C for "Copy". On other platforms
* the same shortcut is typically represented using Control+C. To make it easier to develop cross-platform applications, on macOS,
* Slint maps the Command key to the control modifier, and the Control key to the meta modifier.
*
* On Windows, the Windows key is mapped to the meta modifier.
*/
readonly KeyboardModifiers: (props?: Partial<language.KeyboardModifiers>) => language.KeyboardModifiers;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* Represents a Pointer event sent by the windowing system.
* This structure is passed to the `pointer-event` callback of the `TouchArea` element.
*/
readonly PointerEvent: (props?: Partial<language.PointerEvent>) => language.PointerEvent;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* Represents a Pointer scroll (or wheel) event sent by the windowing system.
* This structure is passed to the `scroll-event` callback of the `TouchArea` element.
*/
readonly PointerScrollEvent: (props?: Partial<language.PointerScrollEvent>) => language.PointerScrollEvent;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* This structure is generated and passed to the key press and release callbacks of the `FocusScope` element.
*/
readonly KeyEvent: (props?: Partial<language.KeyEvent>) => language.KeyEvent;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* This structure is passed to the callbacks of the `DropArea` element
*/
readonly DropEvent: (props?: Partial<language.DropEvent>) => language.DropEvent;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* Represents an item in a StandardListView and a StandardTableView.
*/
readonly StandardListViewItem: (props?: Partial<language.StandardListViewItem>) => language.StandardListViewItem;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* This is used to define the column and the column header of a TableView
*/
readonly TableColumn: (props?: Partial<language.TableColumn>) => language.TableColumn;
};
/**
* Built-in enums and structs from the Slint language.
* Enum values are accessed via `language.ColorScheme.Dark`; struct values via the
* factory call `language.PointerEvent({ button: … })`. Enum and struct types are
* available in type position as `language.ColorScheme` / `language.PointerEvent`.
*/
export declare const language: {
/**
* The enum reports what happened to the `PointerEventButton` in the event
*/
readonly PointerEventKind: {
/**
* The action was cancelled.
*/
readonly Cancel: "cancel";
/**
* The button was pressed.
*/
readonly Down: "down";
/**
* The button was released.
*/
readonly Up: "up";
/**
* The pointer has moved,
*/
readonly Move: "move";
};
/**
* This enum describes the different types of buttons for a pointer event,
* typically on a mouse or a pencil.
*/
readonly PointerEventButton: {
/**
* A button that is none of left, right, middle, back or forward. For example,
* this is used for the task button on a mouse with many buttons.
*/
readonly Other: "other";
/**
* The left button.
*/
readonly Left: "left";
/**
* The right button.
*/
readonly Right: "right";
/**
* The center button.
*/
readonly Middle: "middle";
/**
* The back button.
*/
readonly Back: "back";
/**
* The forward button.
*/
readonly Forward: "forward";
};
/**
* This enum represents the different values for the `accessible-role` property, used to describe the
* role of an element in the context of assistive technology such as screen readers.
*
* In addition to widget roles, this enum includes *landmark* roles (`banner`, `complementary`,
* `content-info`, `form`, `main`, `navigation`, `region`, `search`).
* Landmarks identify large content areas that screen reader users can jump between,
* giving the application a navigable structure similar to headings in a document.
* See [WAI-ARIA Landmark Regions](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/)
* for guidance on when and how to use them.
*/
readonly AccessibleRole: {
/**
* The element isn't accessible.
*/
readonly None: "none";
/**
* The element is a `Button` or behaves like one.
*/
readonly Button: "button";
/**
* The element is a `CheckBox` or behaves like one.
*/
readonly Checkbox: "checkbox";
/**
* The element is a `ComboBox` or behaves like one.
*/
readonly Combobox: "combobox";
/**
* The element is a `GroupBox` or behaves like one.
*/
readonly Groupbox: "groupbox";
/**
* The element is an `Image` or behaves like one. This is automatically applied to `Image` elements.
*/
readonly Image: "image";
/**
* The element is a `ListView` or behaves like one.
*/
readonly List: "list";
/**
* The element is a `Slider` or behaves like one.
*/
readonly Slider: "slider";
/**
* The element is a `SpinBox` or behaves like one.
*/
readonly Spinbox: "spinbox";
/**
* The element is a `Tab` or behaves like one.
*/
readonly Tab: "tab";
/**
* The element is similar to the tab bar in a `TabWidget`.
*/
readonly TabList: "tab-list";
/**
* The element is a container for tab content.
*/
readonly TabPanel: "tab-panel";
/**
* The role for a `Text` element. This is automatically applied to `Text` elements.
*/
readonly Text: "text";
/**
* The role for a `TableView` or behaves like one.
*/
readonly Table: "table";
/**
* The role for a TreeView or behaves like one. (Not provided yet)
*/
readonly Tree: "tree";
/**
* The element is a `ProgressIndicator` or behaves like one.
*/
readonly ProgressIndicator: "progress-indicator";
/**
* The role for widget with editable text such as a `LineEdit` or a `TextEdit`.
* This is automatically applied to `TextInput` elements.
*/
readonly TextInput: "text-input";
/**
* The element is a `Switch` or behaves like one.
*/
readonly Switch: "switch";
/**
* The element is an item in a `ListView`.
*/
readonly ListItem: "list-item";
/**
* The element is a `RadioButton` or behaves like one.
*/
readonly RadioButton: "radio-button";
/**
* The element is a container grouping related `RadioButton`s.
*/
readonly RadioGroup: "radio-group";
/**
* Landmark: the header area of the application, typically containing a logo, title, or global navigation.
*/
readonly Banner: "banner";
/**
* Landmark: a supporting section that complements the main content, such as a sidebar.
*/
readonly Complementary: "complementary";
/**
* Landmark: information about the application or its content, typically at the bottom (e.g. status bar, copyright).
*/
readonly ContentInfo: "content-info";
/**
* Landmark: a region containing input fields and controls for submitting information.
*/
readonly Form: "form";
/**
* Landmark: the primary content of the application. Each view should have exactly one `main` landmark.
*/
readonly Main: "main";
/**
* Landmark: a group of links or controls used for navigating the application.
*/
readonly Navigation: "navigation";
/**
* Landmark: a generic section significant enough to be listed in a summary.
* Use a more specific landmark if one applies.
*/
readonly Region: "region";
/**
* Landmark: a region containing controls for searching or filtering content.
*/
readonly Search: "search";
};
/**
* This enum represents the different values of the `accessible-live-region` property.
* It indicates that an element is a live region whose content changes should be
* announced by assistive technologies.
*/
readonly AccessibleLiveness: {
/**
* Use in regions that present information that is of low-importance to the user.
* Assistive technologies are expected to not announce changes unless the user explicitly asks for it.
*/
readonly Off: "off";
/**
* Use in regions that present new information to users.
* Assistive technologies are expected to not interrupt the user to inform of changes to the live region.
*/
readonly Polite: "polite";
/**
* Use in regions that present information that a user should know about right away.
* Assistive technologies are expected to announce to the user as soon as possible.
*/
readonly Assertive: "assertive";
};
/**
* This enum represents the different values of the `sort-order` property.
* It's used to sort a `StandardTableView` by a column.
*/
readonly SortOrder: {
/**
* The column is unsorted.
*/
readonly Unsorted: "unsorted";
/**
* The column is sorted in ascending order.
*/
readonly Ascending: "ascending";
/**
* The column is sorted in descending order.
*/
readonly Descending: "descending";
};
/**
* Represents the orientation of an element or widget such as the `Slider`.
*/
readonly Orientation: {
/**
* Element is oriented horizontally.
*/
readonly Horizontal: "horizontal";
/**
* Element is oriented vertically.
*/
readonly Vertical: "vertical";
};
/**
* This enum indicates the color scheme used by the widget style. Use this to explicitly switch
* between dark and light schemes, or choose Unknown to fall back to the system default.
*/
readonly ColorScheme: {
/**
* The scheme is not known and a system wide setting configures this. This could mean that
* the widgets are shown in a dark or light scheme, but it could also be a custom color scheme.
*/
readonly Unknown: "unknown";
/**
* The style chooses light colors for the background and dark for the foreground.
*/
readonly Dark: "dark";
/**
* The style chooses dark colors for the background and light for the foreground.
*/
readonly Light: "light";
};
/**
* This enum describes the action negotiated between the source of a drag (`DragArea`)
* and its target (`DropArea`) during a drag-and-drop operation. The source declares
* which actions it permits, the target picks one in its `can-drop` callback, and the
* chosen action is reported back to the source via `drag-finished` so that, for
* example, a `move` source can remove the original data. The same enum is used for
* drags that come from another application or window once native drag-and-drop is
* in play.
*/
readonly DragAction: {
/**
* No action: the drag is rejected, no drop will be delivered.
*/
readonly None: "none";
/**
* The data is copied to the target; the source retains it.
*/
readonly Copy: "copy";
/**
* The data is moved to the target; the source should remove it once the
* operation completes.
*/
readonly Move: "move";
/**
* A link to the source data is created at the target; neither side gives
* up ownership.
*/
readonly Link: "link";
};
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* The `KeyboardModifiers` struct provides booleans to indicate possible modifier keys on a keyboard, such as Shift, Control, etc.
* It is provided as part of `KeyEvent`'s `modifiers` field.
*
* Keyboard shortcuts on Apple platforms typically use the Command key (⌘), such as Command+C for "Copy". On other platforms
* the same shortcut is typically represented using Control+C. To make it easier to develop cross-platform applications, on macOS,
* Slint maps the Command key to the control modifier, and the Control key to the meta modifier.
*
* On Windows, the Windows key is mapped to the meta modifier.
*/
readonly KeyboardModifiers: (props?: Partial<language.KeyboardModifiers>) => language.KeyboardModifiers;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* Represents a Pointer event sent by the windowing system.
* This structure is passed to the `pointer-event` callback of the `TouchArea` element.
*/
readonly PointerEvent: (props?: Partial<language.PointerEvent>) => language.PointerEvent;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* Represents a Pointer scroll (or wheel) event sent by the windowing system.
* This structure is passed to the `scroll-event` callback of the `TouchArea` element.
*/
readonly PointerScrollEvent: (props?: Partial<language.PointerScrollEvent>) => language.PointerScrollEvent;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* This structure is generated and passed to the key press and release callbacks of the `FocusScope` element.
*/
readonly KeyEvent: (props?: Partial<language.KeyEvent>) => language.KeyEvent;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* This structure is passed to the callbacks of the `DropArea` element
*/
readonly DropEvent: (props?: Partial<language.DropEvent>) => language.DropEvent;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* Represents an item in a StandardListView and a StandardTableView.
*/
readonly StandardListViewItem: (props?: Partial<language.StandardListViewItem>) => language.StandardListViewItem;
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* This is used to define the column and the column header of a TableView
*/
readonly TableColumn: (props?: Partial<language.TableColumn>) => language.TableColumn;
};
/** Named types for the enum values in {@link language} and the built-in language structs. */
export declare namespace language {
/**
* The enum reports what happened to the `PointerEventButton` in the event
*
* Variants:
* - `language.PointerEventKind.Cancel` (`"cancel"`) — The action was cancelled.
* - `language.PointerEventKind.Down` (`"down"`) — The button was pressed.
* - `language.PointerEventKind.Up` (`"up"`) — The button was released.
* - `language.PointerEventKind.Move` (`"move"`) — The pointer has moved,
*/
type PointerEventKind = (typeof _data.PointerEventKind)[keyof typeof _data.PointerEventKind];
/**
* This enum describes the different types of buttons for a pointer event,
* typically on a mouse or a pencil.
*
* Variants:
* - `language.PointerEventButton.Other` (`"other"`) — A button that is none of left, right, middle, back or forward. For example, this is used for the task button on a mouse with many buttons.
* - `language.PointerEventButton.Left` (`"left"`) — The left button.
* - `language.PointerEventButton.Right` (`"right"`) — The right button.
* - `language.PointerEventButton.Middle` (`"middle"`) — The center button.
* - `language.PointerEventButton.Back` (`"back"`) — The back button.
* - `language.PointerEventButton.Forward` (`"forward"`) — The forward button.
*/
type PointerEventButton = (typeof _data.PointerEventButton)[keyof typeof _data.PointerEventButton];
/**
* This enum represents the different values for the `accessible-role` property, used to describe the
* role of an element in the context of assistive technology such as screen readers.
*
* In addition to widget roles, this enum includes *landmark* roles (`banner`, `complementary`,
* `content-info`, `form`, `main`, `navigation`, `region`, `search`).
* Landmarks identify large content areas that screen reader users can jump between,
* giving the application a navigable structure similar to headings in a document.
* See [WAI-ARIA Landmark Regions](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/)
* for guidance on when and how to use them.
*
* Variants:
* - `language.AccessibleRole.None` (`"none"`) — The element isn't accessible.
* - `language.AccessibleRole.Button` (`"button"`) — The element is a `Button` or behaves like one.
* - `language.AccessibleRole.Checkbox` (`"checkbox"`) — The element is a `CheckBox` or behaves like one.
* - `language.AccessibleRole.Combobox` (`"combobox"`) — The element is a `ComboBox` or behaves like one.
* - `language.AccessibleRole.Groupbox` (`"groupbox"`) — The element is a `GroupBox` or behaves like one.
* - `language.AccessibleRole.Image` (`"image"`) — The element is an `Image` or behaves like one. This is automatically applied to `Image` elements.
* - `language.AccessibleRole.List` (`"list"`) — The element is a `ListView` or behaves like one.
* - `language.AccessibleRole.Slider` (`"slider"`) — The element is a `Slider` or behaves like one.
* - `language.AccessibleRole.Spinbox` (`"spinbox"`) — The element is a `SpinBox` or behaves like one.
* - `language.AccessibleRole.Tab` (`"tab"`) — The element is a `Tab` or behaves like one.
* - `language.AccessibleRole.TabList` (`"tab-list"`) — The element is similar to the tab bar in a `TabWidget`.
* - `language.AccessibleRole.TabPanel` (`"tab-panel"`) — The element is a container for tab content.
* - `language.AccessibleRole.Text` (`"text"`) — The role for a `Text` element. This is automatically applied to `Text` elements.
* - `language.AccessibleRole.Table` (`"table"`) — The role for a `TableView` or behaves like one.
* - `language.AccessibleRole.Tree` (`"tree"`) — The role for a TreeView or behaves like one. (Not provided yet)
* - `language.AccessibleRole.ProgressIndicator` (`"progress-indicator"`) — The element is a `ProgressIndicator` or behaves like one.
* - `language.AccessibleRole.TextInput` (`"text-input"`) — The role for widget with editable text such as a `LineEdit` or a `TextEdit`. This is automatically applied to `TextInput` elements.
* - `language.AccessibleRole.Switch` (`"switch"`) — The element is a `Switch` or behaves like one.
* - `language.AccessibleRole.ListItem` (`"list-item"`) — The element is an item in a `ListView`.
* - `language.AccessibleRole.RadioButton` (`"radio-button"`) — The element is a `RadioButton` or behaves like one.
* - `language.AccessibleRole.RadioGroup` (`"radio-group"`) — The element is a container grouping related `RadioButton`s.
* - `language.AccessibleRole.Banner` (`"banner"`) — Landmark: the header area of the application, typically containing a logo, title, or global navigation.
* - `language.AccessibleRole.Complementary` (`"complementary"`) — Landmark: a supporting section that complements the main content, such as a sidebar.
* - `language.AccessibleRole.ContentInfo` (`"content-info"`) — Landmark: information about the application or its content, typically at the bottom (e.g. status bar, copyright).
* - `language.AccessibleRole.Form` (`"form"`) — Landmark: a region containing input fields and controls for submitting information.
* - `language.AccessibleRole.Main` (`"main"`) — Landmark: the primary content of the application. Each view should have exactly one `main` landmark.
* - `language.AccessibleRole.Navigation` (`"navigation"`) — Landmark: a group of links or controls used for navigating the application.
* - `language.AccessibleRole.Region` (`"region"`) — Landmark: a generic section significant enough to be listed in a summary. Use a more specific landmark if one applies.
* - `language.AccessibleRole.Search` (`"search"`) — Landmark: a region containing controls for searching or filtering content.
*/
type AccessibleRole = (typeof _data.AccessibleRole)[keyof typeof _data.AccessibleRole];
/**
* This enum represents the different values of the `accessible-live-region` property.
* It indicates that an element is a live region whose content changes should be
* announced by assistive technologies.
*
* Variants:
* - `language.AccessibleLiveness.Off` (`"off"`) — Use in regions that present information that is of low-importance to the user. Assistive technologies are expected to not announce changes unless the user explicitly asks for it.
* - `language.AccessibleLiveness.Polite` (`"polite"`) — Use in regions that present new information to users. Assistive technologies are expected to not interrupt the user to inform of changes to the live region.
* - `language.AccessibleLiveness.Assertive` (`"assertive"`) — Use in regions that present information that a user should know about right away. Assistive technologies are expected to announce to the user as soon as possible.
*/
type AccessibleLiveness = (typeof _data.AccessibleLiveness)[keyof typeof _data.AccessibleLiveness];
/**
* This enum represents the different values of the `sort-order` property.
* It's used to sort a `StandardTableView` by a column.
*
* Variants:
* - `language.SortOrder.Unsorted` (`"unsorted"`) — The column is unsorted.
* - `language.SortOrder.Ascending` (`"ascending"`) — The column is sorted in ascending order.
* - `language.SortOrder.Descending` (`"descending"`) — The column is sorted in descending order.
*/
type SortOrder = (typeof _data.SortOrder)[keyof typeof _data.SortOrder];
/**
* Represents the orientation of an element or widget such as the `Slider`.
*
* Variants:
* - `language.Orientation.Horizontal` (`"horizontal"`) — Element is oriented horizontally.
* - `language.Orientation.Vertical` (`"vertical"`) — Element is oriented vertically.
*/
type Orientation = (typeof _data.Orientation)[keyof typeof _data.Orientation];
/**
* This enum indicates the color scheme used by the widget style. Use this to explicitly switch
* between dark and light schemes, or choose Unknown to fall back to the system default.
*
* Variants:
* - `language.ColorScheme.Unknown` (`"unknown"`) — The scheme is not known and a system wide setting configures this. This could mean that the widgets are shown in a dark or light scheme, but it could also be a custom color scheme.
* - `language.ColorScheme.Dark` (`"dark"`) — The style chooses light colors for the background and dark for the foreground.
* - `language.ColorScheme.Light` (`"light"`) — The style chooses dark colors for the background and light for the foreground.
*/
type ColorScheme = (typeof _data.ColorScheme)[keyof typeof _data.ColorScheme];
/**
* This enum describes the action negotiated between the source of a drag (`DragArea`)
* and its target (`DropArea`) during a drag-and-drop operation. The source declares
* which actions it permits, the target picks one in its `can-drop` callback, and the
* chosen action is reported back to the source via `drag-finished` so that, for
* example, a `move` source can remove the original data. The same enum is used for
* drags that come from another application or window once native drag-and-drop is
* in play.
*
* Variants:
* - `language.DragAction.None` (`"none"`) — No action: the drag is rejected, no drop will be delivered.
* - `language.DragAction.Copy` (`"copy"`) — The data is copied to the target; the source retains it.
* - `language.DragAction.Move` (`"move"`) — The data is moved to the target; the source should remove it once the operation completes.
* - `language.DragAction.Link` (`"link"`) — A link to the source data is created at the target; neither side gives up ownership.
*/
type DragAction = (typeof _data.DragAction)[keyof typeof _data.DragAction];
/**
* The `KeyboardModifiers` struct provides booleans to indicate possible modifier keys on a keyboard, such as Shift, Control, etc.
* It is provided as part of `KeyEvent`'s `modifiers` field.
*
* Keyboard shortcuts on Apple platforms typically use the Command key (⌘), such as Command+C for "Copy". On other platforms
* the same shortcut is typically represented using Control+C. To make it easier to develop cross-platform applications, on macOS,
* Slint maps the Command key to the control modifier, and the Control key to the meta modifier.
*
* On Windows, the Windows key is mapped to the meta modifier.
*/
type KeyboardModifiers = {
/**
* Indicates the Alt key on a keyboard.
*/
alt: boolean;
/**
* Indicates the Control key on a keyboard, except on macOS, where it is the Command key (⌘).
*/
control: boolean;
/**
* Indicates the Shift key on a keyboard.
*/
shift: boolean;
/**
* Indicates the Control key on macos, and the Windows key on Windows.
*/
meta: boolean;
};
/**
* Represents a Pointer event sent by the windowing system.
* This structure is passed to the `pointer-event` callback of the `TouchArea` element.
*/
type PointerEvent = {
/**
* The button that was pressed or released
*/
button: PointerEventButton;
/**
* The kind of the event
*/
kind: PointerEventKind;
/**
* The keyboard modifiers pressed during the event
*/
modifiers: KeyboardModifiers;
/**
* The unique ID of the touch point, indicating the finger ID. 0 means it's not a touch event (e.g., mouse).
*/
touch_finger_id: number;
};
/**
* Represents a Pointer scroll (or wheel) event sent by the windowing system.
* This structure is passed to the `scroll-event` callback of the `TouchArea` element.
*/
type PointerScrollEvent = {
/**
* The amount of pixel in the horizontal direction
*/
delta_x: number;
/**
* The amount of pixel in the vertical direction
*/
delta_y: number;
/**
* The keyboard modifiers pressed during the event
*/
modifiers: KeyboardModifiers;
};
/**
* This structure is generated and passed to the key press and release callbacks of the `FocusScope` element.
*/
type KeyEvent = {
/**
* The unicode representation of the key pressed.
*/
text: string;
/**
* The keyboard modifiers active at the time of the key press event.
*/
modifiers: KeyboardModifiers;
/**
* This field is set to true for key press events that are repeated,
* i.e. the key is held down. It's always false for key release events.
*/
repeat: boolean;
};
/**
* This structure is passed to the callbacks of the `DropArea` element
*/
type DropEvent = {
/**
* The payload set on the source `DragArea`.
*/
data: DataTransfer;
/**
* The cursor position in the `DropArea`'s local coordinates.
*/
position: {
x: number;
y: number;
};
/**
* The action negotiated from current modifier state, clamped to the allowed set;
* when no modifier is pressed, the first allowed of move, copy, link.
* Updated on every `DragMove`. The target's `can-drop` callback can return this
* to honor the user's modifier choice, or override with any other allowed action.
*/
proposed_action: DragAction;
};
/**
* Represents an item in a StandardListView and a StandardTableView.
*/
type StandardListViewItem = {
/**
* The text content of the item
*/
text: string;
};
/**
* This is used to define the column and the column header of a TableView
*/
type TableColumn = {
/**
* The title of the column header
*/
title: string;
/**
* The minimum column width (logical length)
*/
min_width: number;
/**
* The horizontal column stretch
*/
horizontal_stretch: number;
/**
* Sorts the column
*/
sort_order: SortOrder;
/**
* the actual width of the column (logical length)
*/
width: number;
};
}
export {};