importapi

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImportOptions

type ImportOptions struct {
	// Required, editor type
	EditorType pluginapi.EditorType
	// Required, input stream, contains the keymap config for different editors
	InputStream io.Reader
	// Optional, existing onekeymap base setting
	Base *keymapv1.Keymap
}

ImportOptions provides configuration for an import operation.

type ImportResult

type ImportResult struct {
	// The converted keymap setting.
	Setting *keymapv1.Keymap
	// Any issues that arose during the import process.
	Report *keymapv1.ValidationReport

	// The changes to the keymap setting.
	Changes *KeymapChanges
}

ImportResult represents the result of an import operation.

type Importer

type Importer interface {
	// Import converts keymaps from a source stream. It returns the converted
	// settings and a report detailing any conflicts or unmapped actions.
	Import(ctx context.Context, opts ImportOptions) (*ImportResult, error)
}

Importer defines the interface for the import service, which handles the conversion of editor-specific keymaps into the universal format.

type KeymapChanges

type KeymapChanges struct {
	// The keymaps that are added.
	Add []*keymapv1.Action
	// The keymaps that are removed.
	Remove []*keymapv1.Action
	// The keymaps that are updated.
	Update []KeymapDiff
}

KeymapChanges represents the changes to a keymap setting.

type KeymapDiff

type KeymapDiff struct {
	Before *keymapv1.Action
	After  *keymapv1.Action
}

Jump to

Keyboard shortcuts

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