exporterapi

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 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 DiffType

type DiffType int

DiffType represents the type of diff output format.

const (
	// DiffTypeUnspecified represents an unspecified diff type.
	DiffTypeUnspecified DiffType = iota
	// DiffTypeASCII represents ASCII diff format.
	DiffTypeASCII
	// DiffTypeUnified represents unified diff format.
	DiffTypeUnified
)

func (DiffType) String

func (d DiffType) String() string

String returns the string representation of the DiffType.

type ExportOptions

type ExportOptions struct {
	// Editor type
	EditorType pluginapi.EditorType
	// Optional, existing base keymap for specific editor
	Base io.Reader
	// TODO(xinnjie): export api level enum is not a good idea
	DiffType DiffType
	// file path for the keymap config
	FilePath string
}

ExportOptions provides configuration for an export operation.

type ExportReport

type ExportReport struct {
	// The diff between the base and the exported keymap.
	Diff string

	// SkipActions reports actions that were not exported and why.
	SkipActions []pluginapi.ExportSkipAction
}

ExportReport details issues encountered during an export operation.

type Exporter

type Exporter interface {
	// Export converts a KeymapSetting and writes it to a destination stream.
	// It returns a report detailing any issues encountered during the conversion.
	Export(
		ctx context.Context,
		destination io.Writer,
		setting keymap.Keymap,
		opts ExportOptions,
	) (*ExportReport, error)
}

Exporter defines the contract for converting a universal KeymapSetting into an editor-specific format.

Jump to

Keyboard shortcuts

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