Home > @rainway/web > OutgoingInput
OutgoingInput type
An input we're asking to perform in someone's interactive stream.
This is a discriminated union type: match on type
to distinguish types of input, and then handle the fields of the narrowed type.
See: https://basarat.gitbook.io/typescript/type-system/discriminated-unions
Signature:
export declare type OutgoingInput = Readonly<({
type: InputType.Gamepad;
} & IGamepadReport) | ({
type: InputType.MouseAbsolute;
} & IMouseAbsolute) | ({
type: InputType.MouseRelative;
} & IMouseRelative) | ({
type: InputType.MouseClick;
} & IMouseClick) | ({
type: InputType.MouseScroll;
} & IMouseScroll) | {
type: InputType.Keyboard;
action: KeyboardAction;
key: VirtualKey;
} | ({
type: InputType.PasteText;
} & ILogicalInput) | ({
type: InputType.TouchesAbsolute;
} & ITouchesAbsolute) | ({
type: InputType.PenAbsolute;
} & IPenAbsolute) | ({
type: InputType.ViewportResize;
} & IViewportResize) | ({
type: InputType.SetClipboardText;
} & ISetClipboardText)>;
References: InputType.Gamepad, IGamepadReport, InputType.MouseAbsolute, IMouseAbsolute, InputType.MouseRelative, IMouseRelative, InputType.MouseClick, IMouseClick, InputType.MouseScroll, IMouseScroll, InputType.Keyboard, KeyboardAction, VirtualKey, InputType.PasteText, ILogicalInput, InputType.TouchesAbsolute, ITouchesAbsolute, InputType.PenAbsolute, IPenAbsolute, InputType.ViewportResize, IViewportResize, InputType.SetClipboardText, ISetClipboardText