-
Notifications
You must be signed in to change notification settings - Fork 552
Expand file tree
/
Copy pathhostobjectsoptions.yml
More file actions
130 lines (122 loc) · 5.16 KB
/
hostobjectsoptions.yml
File metadata and controls
130 lines (122 loc) · 5.16 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
### YamlMime:TSType
name: HostObjectsOptions
uid: 'WebView2Script!HostObjectsOptions:class'
package: WebView2Script!
fullName: HostObjectsOptions
summary: Contains options applicable to `CoreWebView2.AddHostObjectToScript` added script proxies.
remarks: ''
isPreview: false
isDeprecated: false
type: class
properties:
- name: defaultSyncProxy
uid: 'WebView2Script!HostObjectsOptions#defaultSyncProxy:member'
package: WebView2Script!
fullName: defaultSyncProxy
summary: >-
When calling a method on a synchronous proxy, the result should also be a synchronous proxy. But in some cases,
the sync or async context is lost (for example, when providing to native code a reference to a function, and then
calling that function in native code). In these cases, the proxy will be asynchronous if this option is
`false`<!-- -->, and synchronous if this option is `true`<!-- -->.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'defaultSyncProxy: boolean;'
return:
type: boolean
- name: forceAsyncMethodMatches
uid: 'WebView2Script!HostObjectsOptions#forceAsyncMethodMatches:member'
package: WebView2Script!
fullName: forceAsyncMethodMatches
summary: >-
This is an array of regular expressions. When calling a method on a synchronous proxy, the method call will be
performed asynchronously if the method name matches a string or regular expression in this array. Setting this
value to `/Async$/` will make any method that ends with `Async` be an asynchronous method call. If an async method
doesn't match here and isn't forced to be asynchronous, the method will be invoked synchronously, blocking
execution of the calling JavaScript and then returning the resolution of the promise, rather than returning a
promise.
This defaults to `[]`<!-- -->.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'forceAsyncMethodMatches: RegExp[];'
return:
type: 'RegExp[]'
- name: forceLocalProperties
uid: 'WebView2Script!HostObjectsOptions#forceLocalProperties:member'
package: WebView2Script!
fullName: forceLocalProperties
summary: >-
This is an array of host object property names that will be run locally, instead of being called on the native
host object. This defaults to `['then', 'toJSON', Symbol.toString, Symbol.toPrimitive]`<!-- -->. You can add other
properties to specify that they should be run locally on the javascript host object proxy.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'forceLocalProperties: string[];'
return:
type: 'string[]'
- name: ignoreMemberNotFoundError
uid: 'WebView2Script!HostObjectsOptions#ignoreMemberNotFoundError:member'
package: WebView2Script!
fullName: ignoreMemberNotFoundError
summary: >-
By default, an exception is thrown when attempting to get the value of a proxy property that doesn't exist on the
corresponding native class. Setting this property to `true` changes the behavior to match Chakra WinRT projection
(and general JavaScript) behavior of returning `undefined` with no error.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'ignoreMemberNotFoundError: boolean;'
return:
type: boolean
- name: log
uid: 'WebView2Script!HostObjectsOptions#log:member'
package: WebView2Script!
fullName: log
summary: >-
This is a callback delegate that will be called with debug information if non-null.
For example, you can set this to `console.log.bind(console)` to have it print debug information to the console, to
help when troubleshooting host object usage.
By default this is `null`<!-- -->.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'log: (...data: any[]) => void;'
return:
type: '(...data: any[]) => void'
- name: shouldPassTypedArraysAsArrays
uid: 'WebView2Script!HostObjectsOptions#shouldPassTypedArraysAsArrays:member'
package: WebView2Script!
fullName: shouldPassTypedArraysAsArrays
summary: >-
By default, typed arrays are passed to the host as `IDispatch`. To instead pass typed arrays to the host
as `array`, set this to `true`.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'shouldPassTypedArraysAsArrays: boolean;'
return:
type: boolean
- name: shouldSerializeDates
uid: 'WebView2Script!HostObjectsOptions#shouldSerializeDates:member'
package: WebView2Script!
fullName: shouldSerializeDates
summary: >-
By default this is `false`<!-- -->, and javascript `Date` objects will be sent to host objects as a string using
`JSON.stringify`<!-- -->.
You can set this property to `true` to have `Date` objects properly serialize as a `VT_DATE` when sending to the
native host object, and have `VT_DATE` properties and return values create a JavaScript `Date` object.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'shouldSerializeDates: boolean;'
return:
type: boolean