FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnative/src/pythonnative/sdk/commands.py at v0.43.1 · pythonnative/pythonnative · GitHub
pythonnative
pythonnative
Repository navigation
Code
Issues
11
(11)
Pull requests
4
(4)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnative
/
src
/
pythonnative
/
sdk
/
commands.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
47 lines (42 loc) · 2.03 KB
Breadcrumbs
pythonnative
/
src
/
pythonnative
/
sdk
/
commands.py
Copy path
File metadata and controls
47 lines (42 loc) · 2.03 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""Canonical imperative view commands and their wire arguments."""
from
typing
import
Any
def
_command
(
*
,
result
:
Any
=
None
,
required
:
tuple
[
str
, ...]
=
(),
**
fields
:
Any
)
->
dict
[
str
,
Any
]:
return
{
"arguments"
:
fields
,
"required"
:
list
(
required
),
"result"
:
result
or
{
"type"
:
"null"
},
"defaults"
: {}}
def
commands
(
name
:
str
)
->
dict
[
str
,
Any
]:
"""Return the portable commands implemented by native view managers."""
number
,
integer
,
boolean
,
string
=
({
"type"
:
kind
}
for
kind
in
(
"number"
,
"integer"
,
"boolean"
,
"string"
))
scroll
=
{
"scroll_to_offset"
:
_command
(
x
=
number
,
y
=
number
,
animated
=
boolean
),
"scroll_to_end"
:
_command
(
animated
=
boolean
),
"get_scroll_offset"
:
_command
(
result
=
{
"type"
:
"object"
,
"properties"
: {
"x"
:
number
,
"y"
:
number
},
"required"
: [
"x"
,
"y"
],
"additionalProperties"
:
False
,
}
),
"flash_scroll_indicators"
:
_command
(),
}
if
name
==
"ScrollView"
:
return
scroll
if
name
==
"VirtualList"
:
return
scroll
|
{
"scroll_to_index"
:
_command
(
required
=
(
"index"
,),
index
=
integer
,
animated
=
boolean
)}
if
name
==
"TextInput"
:
return
{
**
{
command
:
_command
()
for
command
in
(
"focus"
,
"blur"
,
"clear"
,
"select_all"
)},
"get_value"
:
_command
(
result
=
string
),
"set_selection"
:
_command
(
required
=
(
"start"
,),
start
=
integer
,
end
=
integer
),
}
if
name
==
"ScreenStack"
:
return
{
"restore_stack"
:
_command
()}
if
name
==
"WebView"
:
return
{
key
:
_command
()
for
key
in
(
"reload"
,
"go_back"
,
"go_forward"
,
"stop_loading"
)}
|
{
"can_go_back"
:
_command
(
result
=
boolean
),
"can_go_forward"
:
_command
(
result
=
boolean
),
"get_url"
:
_command
(
result
=
string
),
"eval_js"
:
_command
(
required
=
(
"script"
,),
script
=
string
),
"inject_javascript"
:
_command
(
required
=
(
"script"
,),
script
=
string
),
"load_url"
:
_command
(
required
=
(
"url"
,),
url
=
string
),
}
return
{}
Back
|
FazBrowse Home
|
New Git URL