StreamDeckPlugin
public final class StreamDeckPlugin
An object that manages a plugins’s main event loop.
-
The shared plugin.
Declaration
Swift
public static var shared: StreamDeckPlugin! -
The plugin’s delegate object.
Declaration
Swift
public let plugin: any PluginDelegate -
Instances of actions.
Declaration
Swift
public private(set) var instances: [String : any Action] { get }
-
The port that should be used to create the WebSocket
Declaration
Swift
public let port: Int32 -
A unique identifier string that should be used to register the plugin once the WebSocket is opened.
Declaration
Swift
public let uuid: String -
The event type that should be used to register the plugin once the WebSocket is opened
Declaration
Swift
public let event: String -
The Stream Deck application information and devices information.
Declaration
Swift
public let info: PluginRegistrationInfo
-
Look up the action type based on the UUID.
Declaration
Swift
public func action(forID uuid: String) -> (any Action.Type)?Parameters
uuidThe UUID of the action.
Return Value
The action’s type, if available.
-
Register a new instance of an action from a
willAppearevent.Declaration
Swift
public func registerInstance(actionID: String, context: String, coordinates: Coordinates?)Parameters
eventThe event with information about the instance.
-
Remove an instance of an action from a
willDisappearevent.Declaration
Swift
public func removeInstance(_ context: String?)Parameters
eventThe event with information about the instance.
-
Return an action by its context.
Declaration
Swift
public subscript(context: String) -> (any Action)? { get } -
Declaration
Swift
public subscript(context: String?) -> (any Action)? { get }
-
Send raw events over the the socket.
Throws
Errors while encoding the data to JSON.Declaration
Swift
public func sendEvent(_ eventType: SendableEventKey, action: String? = nil, context: String?, payload: [String : Any]?)Parameters
eventTypeThe event type.
contextThe context token.
payloadThe payload for the action.
-
Send raw events over the the socket.
Throws
Errors while encoding the data to JSON.Declaration
Swift
public func sendEvent<P>(_ eventType: SendableEventKey, action: String? = nil, context: String?, payload: P?) where P : EncodableParameters
eventTypeThe event type.
contextThe context token.
payloadThe payload for the action.
View on GitHub
StreamDeckPlugin Class Reference