sdk

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EventDidReceiveSettings      = "didReceiveSettings"
	EventDidReceiveGlobalSetting = "didReceiveGlobalSettings"
	EventKeyDown                 = "keyDown"
	EventKeyUp                   = "keyUp"
	EventTouchTap                = "touchTap"
	EventDialPress               = "dialPress" // deprecated
	EventDialUp                  = "dialUp"
	EventDialDown                = "dialDown"
	EventDialRotate              = "dialRotate"
	EventWillAppear              = "willAppear"
	EventWillDisappear           = "willDisappear"
	EventTitleParametersDidChang = "titleParametersDidChange"
	EventDeviceDidConnect        = "deviceDidConnect"
	EventDeviceDidDisconnect     = "deviceDidDisconnect"
	EventApplicationDidLaunch    = "applicationDidLaunch"
	EventApplicationDidTerminate = "applicationDidTerminate"
	EventSystemDidWakeUp         = "systemDidWakeUp"
	EventPropertyInspectorDidApp = "propertyInspectorDidAppear"
	EventPropertyInspectorDidDis = "propertyInspectorDidDisappear"
	EventSendToPlugin            = "sendToPlugin"
	EventSendToPropertyInspector = "sendToPropertyInspector"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceDidConnectEvent added in v0.1.2

type DeviceDidConnectEvent struct {
	Event      string `json:"event,omitempty"`
	Device     string `json:"device,omitempty"`
	DeviceInfo struct {
		Name string `json:"name,omitempty"`
		Type int    `json:"type,omitempty"`
		Size struct {
			Columns int `json:"columns,omitempty"`
			Rows    int `json:"rows,omitempty"`
		} `json:"size,omitempty"`
	} `json:"deviceInfo,omitempty"`
}

type DeviceDidDisconnectEvent added in v0.1.2

type DeviceDidDisconnectEvent struct {
	Event  string `json:"event,omitempty"`
	Device string `json:"device,omitempty"`
}

type DialEvent

type DialEvent struct {
	Action  string `json:"action,omitempty"`
	Event   string `json:"event,omitempty"`
	Context string `json:"context,omitempty"`
	Device  string `json:"device,omitempty"`
	Payload struct {
		Controller  string      `json:"controller,omitempty"`
		Settings    interface{} `json:"settings,omitempty"`
		Coordinates struct {
			Column int `json:"column,omitempty"`
			Row    int `json:"row,omitempty"`
		} `json:"coordinates,omitempty"`
	} `json:"payload,omitempty"`
}

type DialPressEvent

type DialPressEvent struct {
	Action  string `json:"action,omitempty"`
	Event   string `json:"event,omitempty"`
	Context string `json:"context,omitempty"`
	Device  string `json:"device,omitempty"`
	Payload struct {
		Settings    interface{} `json:"settings,omitempty"`
		Coordinates struct {
			Column int `json:"column,omitempty"`
			Row    int `json:"row,omitempty"`
		} `json:"coordinates,omitempty"`
		Pressed bool `json:"pressed,omitempty"`
	} `json:"payload,omitempty"`
}

type DialRotateEvent

type DialRotateEvent struct {
	Action  string `json:"action,omitempty"`
	Event   string `json:"event,omitempty"`
	Context string `json:"context,omitempty"`
	Device  string `json:"device,omitempty"`
	Payload struct {
		Settings    interface{} `json:"settings,omitempty"`
		Coordinates struct {
			Column int `json:"column,omitempty"`
			Row    int `json:"row,omitempty"`
		} `json:"coordinates,omitempty"`
		Ticks   int  `json:"ticks,omitempty"`
		Pressed bool `json:"pressed,omitempty"`
	} `json:"payload,omitempty"`
}

type EventEnvelope

type EventEnvelope struct {
	Path  string
	Event interface{}
}

func (*EventEnvelope) UnmarshalJSON

func (g *EventEnvelope) UnmarshalJSON(data []byte) error

type HandlerFunc

type HandlerFunc func(*Plugin, interface{})

type Info

type Info struct {
	Application struct {
		Font            string `json:"font"`
		Language        string `json:"language"`
		Platform        string `json:"platform"`
		PlatformVersion string `json:"platformVersion"`
		Version         string `json:"version"`
	} `json:"application"`
	Plugin struct {
		UUID    string `json:"uuid"`
		Version string `json:"version"`
	} `json:"plugin"`
	DevicePixelRatio int `json:"devicePixelRatio"`
	Colors           struct {
		ButtonPressedBackgroundColor string `json:"buttonPressedBackgroundColor"`
		ButtonPressedBorderColor     string `json:"buttonPressedBorderColor"`
		ButtonPressedTextColor       string `json:"buttonPressedTextColor"`
		DisabledColor                string `json:"disabledColor"`
		HighlightColor               string `json:"highlightColor"`
		MouseDownColor               string `json:"mouseDownColor"`
	} `json:"colors"`
	Devices []struct {
		ID   string `json:"id"`
		Name string `json:"name"`
		Size struct {
			Columns int `json:"columns"`
			Rows    int `json:"rows"`
		} `json:"size"`
		Type int `json:"type"`
	} `json:"devices"`
}

type Plugin

type Plugin struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin() (*Plugin, error)

func (*Plugin) Handle

func (p *Plugin) Handle(path string, f HandlerFunc)

func (*Plugin) Run

func (p *Plugin) Run() error

func (*Plugin) SetFeedback

func (p *Plugin) SetFeedback(c string, payload map[string]string) error

type SetFeedbackEvent

type SetFeedbackEvent struct {
	Event   string            `json:"event,omitempty"`
	Context string            `json:"context,omitempty"`
	Payload map[string]string `json:"payload,omitempty"`
}

type TouchTapEvent

type TouchTapEvent struct {
	Action  string `json:"action,omitempty"`
	Event   string `json:"event,omitempty"`
	Context string `json:"context,omitempty"`
	Device  string `json:"device,omitempty"`
	Payload struct {
		Settings    interface{} `json:"settings,omitempty"`
		Coordinates struct {
			Column int `json:"column,omitempty"`
			Row    int `json:"row,omitempty"`
		} `json:"coordinates,omitempty"`
		TapPos []int `json:"tapPos,omitempty"`
		Hold   bool  `json:"hold,omitempty"`
	} `json:"payload,omitempty"`
}

type WillAppearEvent

type WillAppearEvent struct {
	Action  string `json:"action,omitempty"`
	Event   string `json:"event,omitempty"`
	Context string `json:"context,omitempty"`
	Device  string `json:"device,omitempty"`
	Payload struct {
		Controller  string      `json:"controller,omitempty"`
		Settings    interface{} `json:"settings,omitempty"`
		Coordinates struct {
			Column int `json:"column,omitempty"`
			Row    int `json:"row,omitempty"`
		} `json:"coordinates,omitempty"`
		State           int  `json:"state,omitempty"`
		IsInMultiAction bool `json:"isInMultiAction,omitempty"`
	} `json:"payload,omitempty"`
}

type WillDisappearEvent added in v0.1.1

type WillDisappearEvent struct {
	Action  string `json:"action,omitempty"`
	Event   string `json:"event,omitempty"`
	Context string `json:"context,omitempty"`
	Device  string `json:"device,omitempty"`
	Payload struct {
		Controller  string      `json:"controller,omitempty"`
		Settings    interface{} `json:"settings,omitempty"`
		Coordinates struct {
			Column int `json:"column,omitempty"`
			Row    int `json:"row,omitempty"`
		} `json:"coordinates,omitempty"`
		State           int  `json:"state,omitempty"`
		IsInMultiAction bool `json:"isInMultiAction,omitempty"`
	} `json:"payload,omitempty"`
}

Jump to

Keyboard shortcuts

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