types

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 0 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package types defines shared values used across the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key string

Key identifies a keyboard key or command.

const (
	// Navigation keys.
	KEY_ENTER     Key = "enter"
	KEY_ESC       Key = "esc"
	KEY_BACKSPACE Key = "backspace"
	KEY_TAB       Key = "tab"
	KEY_SHIFT_TAB Key = "shift+tab"

	// Arrow keys.
	KEY_UP       Key = "up"
	KEY_DOWN     Key = "down"
	KEY_LEFT     Key = "left"
	KEY_RIGHT    Key = "right"
	KEY_PG_UP    Key = "pgup"
	KEY_PG_DOWN  Key = "pgdown"
	KEY_ALT_UP   Key = "alt+up"
	KEY_ALT_DOWN Key = "alt+down"

	// Shortcuts.
	SHORT_CTRL_C    Key = "ctrl+c"
	SHORT_CTRL_Q    Key = "ctrl+q"
	SHORT_CTRL_N    Key = "ctrl+n"
	SHORT_CTRL_E    Key = "ctrl+e"
	SHORT_CTRL_D    Key = "ctrl+d"
	SHORT_CTRL_O    Key = "ctrl+o"
	SHORT_CTRL_X    Key = "ctrl+x"
	SHORT_CTRL_V    Key = "ctrl+v"
	SHORT_CTRL_Y    Key = "ctrl+y"
	SHORT_CTRL_Z    Key = "ctrl+z"
	SHORT_SHIFT_TAB Key = "shift+tab"

	// Command keys.
	CMD_SHIFT_ENTER Key = "shift+enter"
	CMD_ALT_ENTER   Key = "alt+enter"
	CMD_CTRL_ENTER  Key = "ctrl+enter"
	CMD_CTRL_S      Key = "ctrl+s"

	// Other keys.
	KEY_EMPTY Key = ""
)

func (Key) Symbol

func (k Key) Symbol() string

Symbol returns the glyph shown in shortcut hints, or the key itself when it has none.

type Set

type Set[T comparable] map[T]struct{}

Set stores unique values of a comparable type.

func NewSet

func NewSet[T comparable]() Set[T]

NewSet returns an empty set.

func (Set[T]) Add

func (s Set[T]) Add(value T)

Add inserts value into the set.

func (Set[T]) Has

func (s Set[T]) Has(value T) bool

Has reports whether value belongs to the set.

func (Set[T]) Remove

func (s Set[T]) Remove(value T)

Remove deletes value from the set.

func (Set[T]) Size

func (s Set[T]) Size() int

Size returns the number of values in the set.

func (Set[T]) ToSlice

func (s Set[T]) ToSlice() []T

ToSlice returns the set values in unspecified order.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL