Skip to content

Commit 9348dc9

Browse files
Update scripting API documentation (#592)
This PR updates the scripting API documentation generated from the rive repository. Generated from commit: 22eca6b13dcbce189372ef6fa86328c008efaf85 Repository: rive-app/rive Workflow run: https://github.com/rive-app/rive/actions/runs/23823175270 Co-authored-by: csmartdalton <csmartdalton@users.noreply.github.com>
1 parent 89dee26 commit 9348dc9

12 files changed

Lines changed: 325 additions & 2 deletions

docs.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,19 @@
266266
"pages": [
267267
"scripting/api-reference/artboards/animation",
268268
"scripting/api-reference/artboards/artboard",
269+
"scripting/api-reference/artboards/focus-event",
270+
"scripting/api-reference/artboards/key-phase",
271+
"scripting/api-reference/artboards/keyboard-event",
272+
"scripting/api-reference/artboards/listener-context",
269273
"scripting/api-reference/artboards/node-data",
270274
"scripting/api-reference/artboards/node-read-data",
275+
"scripting/api-reference/artboards/none-event",
271276
"scripting/api-reference/artboards/pointer-event",
272-
"scripting/api-reference/artboards/view-model"
277+
"scripting/api-reference/artboards/pointer-type",
278+
"scripting/api-reference/artboards/reported-event",
279+
"scripting/api-reference/artboards/text-input",
280+
"scripting/api-reference/artboards/view-model",
281+
"scripting/api-reference/artboards/view-model-change"
273282
]
274283
},
275284
{
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: FocusEvent
3+
---
4+
5+
Represents a Focus event data
6+
7+
8+
## Fields
9+
10+
### `isFocus`
11+
12+
Whether the element gained or lost focus
13+
14+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: KeyPhase
3+
---
4+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: KeyboardEvent
3+
---
4+
5+
Represents a keyboard interaction.
6+
7+
8+
## Fields
9+
10+
### `key`
11+
12+
The pressed key
13+
14+
15+
### `shift`
16+
17+
Whether the shift modifier is pressed.
18+
19+
20+
### `control`
21+
22+
Whether the control modifier is pressed.
23+
24+
25+
### `alt`
26+
27+
Whether the alt modifier is pressed.
28+
29+
30+
### `meta`
31+
32+
Whether the meta modifier is pressed.
33+
34+
35+
### `phase`
36+
37+
Phase of the keyboard event (down, repeat or up).
38+
39+
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
title: ListenerContext
3+
---
4+
5+
Represents the context of a listener perform action
6+
7+
8+
## Methods
9+
10+
### `isPointerEvent`
11+
12+
{/* isPointerEvent: (self: ListenerContext) -> boolean */}
13+
<div class="signature">
14+
```lua
15+
isPointerEvent() -> boolean
16+
```
17+
</div>
18+
19+
returns true if the perform action was invoked through a pointer event
20+
21+
22+
### `isKeyboardEvent`
23+
24+
{/* isKeyboardEvent: (self: ListenerContext) -> boolean */}
25+
<div class="signature">
26+
```lua
27+
isKeyboardEvent() -> boolean
28+
```
29+
</div>
30+
31+
returns true if the perform action was invoked through a keyboard event
32+
33+
34+
### `isTextInput`
35+
36+
{/* isTextInput: (self: ListenerContext) -> boolean */}
37+
<div class="signature">
38+
```lua
39+
isTextInput() -> boolean
40+
```
41+
</div>
42+
43+
returns true if the perform action was invoked through a text input
44+
45+
46+
### `isFocus`
47+
48+
{/* isFocus: (self: ListenerContext) -> boolean */}
49+
<div class="signature">
50+
```lua
51+
isFocus() -> boolean
52+
```
53+
</div>
54+
55+
returns true if the perform action was invoked through a focus change
56+
57+
58+
### `isReportedEvent`
59+
60+
{/* isReportedEvent: (self: ListenerContext) -> boolean */}
61+
<div class="signature">
62+
```lua
63+
isReportedEvent() -> boolean
64+
```
65+
</div>
66+
67+
returns true if the perform action was invoked through a Rive event
68+
69+
70+
### `isViewModelChange`
71+
72+
{/* isViewModelChange: (self: ListenerContext) -> boolean */}
73+
<div class="signature">
74+
```lua
75+
isViewModelChange() -> boolean
76+
```
77+
</div>
78+
79+
returns true if the perform action was invoked through a view model change
80+
81+
82+
### `isNone`
83+
84+
{/* isNone: (self: ListenerContext) -> boolean */}
85+
<div class="signature">
86+
```lua
87+
isNone() -> boolean
88+
```
89+
</div>
90+
91+
returns true if the perform action is none of the known types
92+
93+
94+
### `asPointerEvent`
95+
96+
{/* asPointerEvent: (self: ListenerContext) -> PointerEvent? */}
97+
<div class="signature">
98+
```lua
99+
asPointerEvent() -> PointerEvent?
100+
```
101+
</div>
102+
103+
returns a pointer event if context is of type pointer event, null otherwise
104+
105+
106+
### `asKeyboardEvent`
107+
108+
{/* asKeyboardEvent: (self: ListenerContext) -> KeyboardEvent? */}
109+
<div class="signature">
110+
```lua
111+
asKeyboardEvent() -> KeyboardEvent?
112+
```
113+
</div>
114+
115+
returns a keyboard event if context is of type keyboard event, null otherwise
116+
117+
118+
### `asTextInput`
119+
120+
{/* asTextInput: (self: ListenerContext) -> TextInput? */}
121+
<div class="signature">
122+
```lua
123+
asTextInput() -> TextInput?
124+
```
125+
</div>
126+
127+
returns a text input event if context is of type text input event, null otherwise
128+
129+
130+
### `asFocus`
131+
132+
{/* asFocus: (self: ListenerContext) -> FocusEvent? */}
133+
<div class="signature">
134+
```lua
135+
asFocus() -> FocusEvent?
136+
```
137+
</div>
138+
139+
returns a focus event event if context is of type focus event, null otherwise
140+
141+
142+
### `asReportedEvent`
143+
144+
{/* asReportedEvent: (self: ListenerContext) -> ReportedEvent? */}
145+
<div class="signature">
146+
```lua
147+
asReportedEvent() -> ReportedEvent?
148+
```
149+
</div>
150+
151+
returns a reported event if context is of type reported evnet, null otherwise
152+
153+
154+
### `asViewModelChange`
155+
156+
{/* asViewModelChange: (self: ListenerContext) -> ViewModelChange? */}
157+
<div class="signature">
158+
```lua
159+
asViewModelChange() -> ViewModelChange?
160+
```
161+
</div>
162+
163+
returns a view model change if context is of type view model, null otherwise
164+
165+
166+
### `asNone`
167+
168+
{/* asNone: (self: ListenerContext) -> NoneEvent? */}
169+
<div class="signature">
170+
```lua
171+
asNone() -> NoneEvent?
172+
```
173+
</div>
174+
175+
returns a noop event if context is of type none, null otherwise
176+
177+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: NoneEvent
3+
---
4+
5+
Represents a reported event
6+
7+

scripting/api-reference/artboards/pointer-event.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ The position of the pointer in local coordinates.
1717
The unique identifier for the pointer.
1818

1919

20+
### `type`
21+
22+
The type of event (pointerDown, pointerUp, click, pointerEnter, pointerMove, etc).
23+
24+
2025
## Constructors
2126

2227
### `new`
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: PointerType
3+
---
4+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: ReportedEvent
3+
---
4+
5+
Represents a reported event
6+
7+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: TextInput
3+
---
4+
5+
Represents a Text input data
6+
7+
8+
## Fields
9+
10+
### `text`
11+
12+
The text passed as input
13+
14+

0 commit comments

Comments
 (0)