typenative 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +2 -2
- package/.github/workflows/npm-publish-github-packages.yml +2 -2
- package/CHANGELOG.md +442 -1
- package/CONTRIBUTION.md +2 -1
- package/README.md +73 -25
- package/bin/cli.js +2 -0
- package/bin/index.js +75 -5
- package/bin/main.js +2 -0
- package/bin/node/assert.js +2 -2
- package/bin/node/async_hooks.js +1 -1
- package/bin/node/buffer.js +16 -5
- package/bin/node/child_process.js +7 -7
- package/bin/node/cluster.js +3 -3
- package/bin/node/core.js +41 -0
- package/bin/node/crypto_keys.js +21 -21
- package/bin/node/dgram.js +1 -1
- package/bin/node/diagnostics_channel.js +3 -3
- package/bin/node/dns.js +2 -2
- package/bin/node/events.js +18 -13
- package/bin/node/fetch.js +2 -2
- package/bin/node/fs.js +3 -3
- package/bin/node/fs_watch.js +5 -5
- package/bin/node/http.js +3 -3
- package/bin/node/http2.js +3 -3
- package/bin/node/net.js +8 -8
- package/bin/node/path.js +17 -3
- package/bin/node/process.js +47 -11
- package/bin/node/punycode.js +2 -2
- package/bin/node/readline.js +1 -1
- package/bin/node/registry.js +4 -1
- package/bin/node/sqlite.js +6 -6
- package/bin/node/stream.js +81 -15
- package/bin/node/stream_web.js +10 -10
- package/bin/node/system_extra.js +3 -3
- package/bin/node/test.js +674 -366
- package/bin/node/test_coverage.js +187 -0
- package/bin/node/test_report.js +1392 -0
- package/bin/node/test_run.js +575 -0
- package/bin/node/timers.js +8 -6
- package/bin/node/tls.js +5 -5
- package/bin/node/url.js +1 -1
- package/bin/node/util.js +31 -7
- package/bin/node/util_extra.js +7 -7
- package/bin/node/webview.js +654 -0
- package/bin/node/worker_threads.js +1 -1
- package/bin/node/zlib.js +3 -3
- package/bin/parse-node.js +6 -2
- package/bin/regex_vm.js +2057 -0
- package/bin/transpiler.js +32872 -11265
- package/bin/typecheck-node.js +2 -1
- package/bin/version.js +1 -1
- package/conformance.md +515 -345
- package/examples/README.md +71 -11
- package/examples/angular-templates/README.md +139 -0
- package/examples/angular-templates/bench.mjs +173 -0
- package/examples/angular-templates/dom-type-globals.d.ts +21 -0
- package/examples/angular-templates/dom-type-stubs.ts +21 -0
- package/examples/angular-templates/main.ts +135 -0
- package/examples/angular-templates/parity.mjs +157 -0
- package/examples/angular-templates/run-node.mjs +69 -0
- package/examples/angular-templates/vendor/angular/compiler/LICENSE +21 -0
- package/examples/desktop-notes/README.md +106 -0
- package/examples/desktop-notes/bench.mjs +125 -0
- package/examples/desktop-notes/main.ts +131 -0
- package/examples/desktop-notes/package-lock.json +726 -0
- package/examples/desktop-notes/package.json +9 -0
- package/examples/desktop-notes/ui.ts +176 -0
- package/examples/dupe-finder/README.md +78 -0
- package/examples/dupe-finder/bench.mjs +120 -0
- package/examples/dupe-finder/main.ts +87 -0
- package/examples/fibonacci/README.md +7 -7
- package/examples/hello-world/README.md +6 -6
- package/examples/json-server/README.md +19 -18
- package/examples/mandelbrot-png/README.md +63 -0
- package/examples/mandelbrot-png/bench.mjs +95 -0
- package/examples/mandelbrot-png/main.ts +98 -0
- package/examples/mandelbrot-png/preview.png +0 -0
- package/examples/marked-cli/README.md +160 -0
- package/examples/marked-cli/bench.mjs +178 -0
- package/examples/marked-cli/main.ts +292 -0
- package/examples/marked-cli/parity.mjs +185 -0
- package/examples/marked-cli/vendor/marked/LICENSE +44 -0
- package/examples/marked-cli/vendor/marked/VENDOR.md +26 -0
- package/examples/openai-chat/README.md +148 -0
- package/examples/openai-chat/bench.mjs +175 -0
- package/examples/openai-chat/main.ts +488 -0
- package/examples/react-compiler/README.md +170 -0
- package/examples/react-compiler/bench.mjs +181 -0
- package/examples/react-compiler/main.ts +158 -0
- package/examples/react-compiler/parity.mjs +362 -0
- package/examples/react-compiler/run-node.mjs +88 -0
- package/examples/react-compiler/vendor/babel/LICENSE +22 -0
- package/examples/react-compiler/vendor/babel/helper-globals/data/builtin-lower.json +15 -0
- package/examples/react-compiler/vendor/babel/helper-globals/data/builtin-upper.json +51 -0
- package/examples/react-compiler/vendor/charcodes/package.json +25 -0
- package/examples/react-compiler/vendor/invariant/LICENSE +21 -0
- package/examples/react-compiler/vendor/invariant/invariant.cjs +51 -0
- package/examples/react-compiler/vendor/invariant/invariant.d.cts +11 -0
- package/examples/react-compiler/vendor/invariant/types/LICENSE +21 -0
- package/examples/react-compiler/vendor/jridgewell/gen-mapping/LICENSE +19 -0
- package/examples/react-compiler/vendor/jridgewell/resolve-uri/LICENSE +19 -0
- package/examples/react-compiler/vendor/jridgewell/sourcemap-codec/LICENSE +19 -0
- package/examples/react-compiler/vendor/jridgewell/trace-mapping/LICENSE +19 -0
- package/examples/react-compiler/vendor/js-tokens/LICENSE +21 -0
- package/examples/react-compiler/vendor/js-tokens/index.cjs +23 -0
- package/examples/react-compiler/vendor/js-tokens/index.d.cts +13 -0
- package/examples/react-compiler/vendor/jsesc/LICENSE-MIT.txt +20 -0
- package/examples/react-compiler/vendor/jsesc/jsesc.cjs +337 -0
- package/examples/react-compiler/vendor/jsesc/jsesc.d.cts +384 -0
- package/examples/react-compiler/vendor/jsesc/types/LICENSE +21 -0
- package/examples/react-compiler/vendor/picocolors/LICENSE +15 -0
- package/examples/react-compiler/vendor/picocolors/picocolors.cjs +75 -0
- package/examples/react-compiler/vendor/picocolors/picocolors.d.cts +5 -0
- package/examples/react-compiler/vendor/picocolors/types.d.ts +51 -0
- package/examples/react-compiler/vendor/react-compiler/LICENSE +21 -0
- package/examples/react-compiler/vendor/stubs/babel-core.ts +31 -0
- package/examples/react-compiler/vendor/stubs/debug.ts +18 -0
- package/examples/react-compiler/vendor/stubs/js-tokens.d.ts +13 -0
- package/examples/react-compiler/vendor/stubs/pretty-format.ts +18 -0
- package/examples/react-compiler/vendor/zod/LICENSE +21 -0
- package/examples/react-compiler/vendor/zod-validation-error/LICENSE +9 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/utils/NonEmptyArray.ts +5 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/utils/joinPath.ts +49 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/utils/joinValues.ts +48 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/utils/stringify.ts +50 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/utils/titleCase.ts +6 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/MessageBuilder.ts +126 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/ValidationError.ts +39 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/custom.ts +12 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/errorMap.ts +78 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/index.ts +2 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidElement.ts +12 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidKey.ts +12 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidStringFormat.ts +131 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidType.ts +54 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidUnion.ts +12 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidValue.ts +40 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/notMultipleOf.ts +12 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/tooBig.ts +76 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/tooSmall.ts +76 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/types.ts +27 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/unrecognizedKeys.ts +27 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromError.ts +13 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromZodError.ts +61 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromZodIssue.ts +38 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/index.ts +20 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isValidationError.ts +5 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isValidationErrorLike.ts +8 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isZodErrorLike.ts +11 -0
- package/examples/react-compiler/vendor/zod-validation-error/lib/v4/toValidationError.ts +20 -0
- package/examples/react-compiler/vendor.mjs +688 -0
- package/examples/todo-cli/README.md +69 -0
- package/examples/todo-cli/bench.mjs +89 -0
- package/examples/todo-cli/main.ts +92 -0
- package/examples/yaml-cli/README.md +146 -0
- package/examples/yaml-cli/bench.mjs +265 -0
- package/examples/yaml-cli/main.ts +29 -0
- package/examples/yaml-cli/parity.mjs +156 -0
- package/examples/yaml-cli/vendor/yaml/LICENSE +13 -0
- package/examples/yaml-cli/vendor/yaml/VENDOR.md +25 -0
- package/govendor/github.com/jchv/go-webview2/LICENSE +22 -0
- package/govendor/github.com/jchv/go-webview2/README.md +21 -0
- package/govendor/github.com/jchv/go-webview2/common.go +84 -0
- package/govendor/github.com/jchv/go-webview2/go.mod +3 -0
- package/govendor/github.com/jchv/go-webview2/internal/w32/w32.go +194 -0
- package/govendor/github.com/jchv/go-webview2/internal/w32/w32_386.go +14 -0
- package/govendor/github.com/jchv/go-webview2/internal/w32/w32_64bit.go +15 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_COLOR.go +8 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND.go +9 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_KEY_EVENT_KIND.go +10 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_MOVE_FOCUS_REASON.go +9 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_PHYSICAL_KEY_STATUS.go +10 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_WEB_RESOURCE_CONTEXT.go +23 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventArgs.go +78 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventHandler.go +52 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2Controller.go +132 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2Controller2.go +74 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.go +48 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventArgs.go +17 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventHandler.go +48 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2Settings.go +270 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2WebResourceRequest.go +43 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventArgs.go +51 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventHandler.go +48 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2WebResourceResponse.go +21 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2_2.go +21 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2_3.go +60 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebViewSettings.go +396 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/chromium.go +361 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/chromium_386.go +24 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/chromium_amd64.go +22 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/chromium_arm64.go +26 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/comproc.go +13 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/comproc_go17.go +51 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/comproc_go18.go +16 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/corewebview2.go +411 -0
- package/govendor/github.com/jchv/go-webview2/pkg/edge/guid.go +223 -0
- package/govendor/github.com/jchv/go-webview2/webview.go +482 -0
- package/govendor/github.com/jchv/go-webview2/webviewloader/README.md +3 -0
- package/govendor/github.com/jchv/go-webview2/webviewloader/module.go +153 -0
- package/govendor/github.com/jchv/go-webview2/webviewloader/module_386.go +6 -0
- package/govendor/github.com/jchv/go-webview2/webviewloader/module_amd64.go +6 -0
- package/govendor/github.com/jchv/go-webview2/webviewloader/module_arm64.go +6 -0
- package/govendor/github.com/jchv/go-webview2/webviewloader/sdk/arm64/WebView2Loader.dll +0 -0
- package/govendor/github.com/jchv/go-webview2/webviewloader/sdk/x64/WebView2Loader.dll +0 -0
- package/govendor/github.com/jchv/go-webview2/webviewloader/sdk/x86/WebView2Loader.dll +0 -0
- package/govendor/github.com/jchv/go-winloader/LICENSE.md +7 -0
- package/govendor/github.com/jchv/go-winloader/README.md +124 -0
- package/govendor/github.com/jchv/go-winloader/common.go +11 -0
- package/govendor/github.com/jchv/go-winloader/go.mod +3 -0
- package/govendor/github.com/jchv/go-winloader/internal/loader/loader.go +25 -0
- package/govendor/github.com/jchv/go-winloader/internal/loader/machine.go +53 -0
- package/govendor/github.com/jchv/go-winloader/internal/memloader/cache.go +42 -0
- package/govendor/github.com/jchv/go-winloader/internal/memloader/loader.go +253 -0
- package/govendor/github.com/jchv/go-winloader/internal/pe/export.go +76 -0
- package/govendor/github.com/jchv/go-winloader/internal/pe/format.go +522 -0
- package/govendor/github.com/jchv/go-winloader/internal/pe/import.go +106 -0
- package/govendor/github.com/jchv/go-winloader/internal/pe/module.go +91 -0
- package/govendor/github.com/jchv/go-winloader/internal/pe/reloc.go +177 -0
- package/govendor/github.com/jchv/go-winloader/internal/pe/util.go +40 -0
- package/govendor/github.com/jchv/go-winloader/internal/vmem/common.go +55 -0
- package/govendor/github.com/jchv/go-winloader/internal/vmem/memory_other.go +71 -0
- package/govendor/github.com/jchv/go-winloader/internal/vmem/memory_windows.go +179 -0
- package/govendor/github.com/jchv/go-winloader/internal/winloader/hacks_other.go +17 -0
- package/govendor/github.com/jchv/go-winloader/internal/winloader/hacks_windows.go +73 -0
- package/govendor/github.com/jchv/go-winloader/internal/winloader/loader_windows.go +64 -0
- package/govendor/github.com/jchv/go-winloader/internal/winloader/machine_windows.go +32 -0
- package/govendor/github.com/jchv/go-winloader/internal/winloader/nativearch_386.go +9 -0
- package/govendor/github.com/jchv/go-winloader/internal/winloader/nativearch_amd64.go +9 -0
- package/govendor/github.com/jchv/go-winloader/internal/winloader/nativearch_arm64.go +9 -0
- package/govendor/github.com/jchv/go-winloader/loader_other.go +24 -0
- package/govendor/github.com/jchv/go-winloader/loader_windows.go +33 -0
- package/govendor/manifest.txt +3 -1
- package/package.json +8 -5
- package/performance/README.md +195 -0
- package/performance/any-dynamic.ts +21 -0
- package/performance/any-record-view.ts +20 -0
- package/performance/arr-hof.ts +21 -0
- package/performance/arr-push-index.ts +15 -0
- package/performance/arr-sort.ts +21 -0
- package/performance/async-await.ts +24 -0
- package/performance/class-dispatch.ts +52 -0
- package/performance/events-emit.ts +27 -0
- package/performance/exc-throw-rare.ts +25 -0
- package/performance/exc-try-catch.ts +26 -0
- package/performance/fn-closures.ts +29 -0
- package/performance/fn-recursion-tree.ts +31 -0
- package/performance/gen-for-of.ts +46 -0
- package/performance/json-roundtrip.ts +27 -0
- package/performance/map-delete.ts +24 -0
- package/performance/map-string-keys.ts +22 -0
- package/performance/num-arith-loop.ts +14 -0
- package/performance/num-bitwise.ts +21 -0
- package/performance/num-mod-int.ts +16 -0
- package/performance/num-to-string.ts +16 -0
- package/performance/obj-alloc.ts +32 -0
- package/performance/regex-exec.ts +29 -0
- package/performance/regex-site.ts +28 -0
- package/performance/set-ops.ts +20 -0
- package/performance/str-char-scan.ts +35 -0
- package/performance/str-concat-plus.ts +18 -0
- package/performance/str-concat.ts +24 -0
- package/performance/str-short-scan.ts +26 -0
- package/performance/str-split-join.ts +23 -0
- package/performance/str-template.ts +16 -0
- package/performance/union-switch.ts +57 -0
- package/tsparser/check.go +2 -1
- package/tsparser/main.go +5 -0
- package/types/typenative-npm.d.ts +193 -4
- package/types/typenative.d.ts +138 -41
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
package edge
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"unsafe"
|
|
5
|
+
|
|
6
|
+
"golang.org/x/sys/windows"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
// ICoreWebviewSettings is the merged settings class
|
|
10
|
+
|
|
11
|
+
type _ICoreWebViewSettingsVtbl struct {
|
|
12
|
+
_IUnknownVtbl
|
|
13
|
+
GetIsScriptEnabled ComProc
|
|
14
|
+
PutIsScriptEnabled ComProc
|
|
15
|
+
GetIsWebMessageEnabled ComProc
|
|
16
|
+
PutIsWebMessageEnabled ComProc
|
|
17
|
+
GetAreDefaultScriptDialogsEnabled ComProc
|
|
18
|
+
PutAreDefaultScriptDialogsEnabled ComProc
|
|
19
|
+
GetIsStatusBarEnabled ComProc
|
|
20
|
+
PutIsStatusBarEnabled ComProc
|
|
21
|
+
GetAreDevToolsEnabled ComProc
|
|
22
|
+
PutAreDevToolsEnabled ComProc
|
|
23
|
+
GetAreDefaultContextMenusEnabled ComProc
|
|
24
|
+
PutAreDefaultContextMenusEnabled ComProc
|
|
25
|
+
GetAreHostObjectsAllowed ComProc
|
|
26
|
+
PutAreHostObjectsAllowed ComProc
|
|
27
|
+
GetIsZoomControlEnabled ComProc
|
|
28
|
+
PutIsZoomControlEnabled ComProc
|
|
29
|
+
GetIsBuiltInErrorPageEnabled ComProc
|
|
30
|
+
PutIsBuiltInErrorPageEnabled ComProc
|
|
31
|
+
GetUserAgent ComProc
|
|
32
|
+
PutUserAgent ComProc
|
|
33
|
+
GetAreBrowserAcceleratorKeysEnabled ComProc
|
|
34
|
+
PutAreBrowserAcceleratorKeysEnabled ComProc
|
|
35
|
+
GetIsPasswordAutosaveEnabled ComProc
|
|
36
|
+
PutIsPasswordAutosaveEnabled ComProc
|
|
37
|
+
GetIsGeneralAutofillEnabled ComProc
|
|
38
|
+
PutIsGeneralAutofillEnabled ComProc
|
|
39
|
+
GetIsPinchZoomEnabled ComProc
|
|
40
|
+
PutIsPinchZoomEnabled ComProc
|
|
41
|
+
GetIsSwipeNavigationEnabled ComProc
|
|
42
|
+
PutIsSwipeNavigationEnabled ComProc
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type ICoreWebViewSettings struct {
|
|
46
|
+
vtbl *_ICoreWebViewSettingsVtbl
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
func (i *ICoreWebViewSettings) AddRef() uintptr {
|
|
50
|
+
r, _, _ := i.vtbl.AddRef.Call()
|
|
51
|
+
return r
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
func (i *ICoreWebViewSettings) GetIsScriptEnabled() (bool, error) {
|
|
55
|
+
var err error
|
|
56
|
+
var isScriptEnabled bool
|
|
57
|
+
_, _, err = i.vtbl.GetIsScriptEnabled.Call(
|
|
58
|
+
uintptr(unsafe.Pointer(i)),
|
|
59
|
+
uintptr(unsafe.Pointer(&isScriptEnabled)),
|
|
60
|
+
)
|
|
61
|
+
if err != windows.ERROR_SUCCESS {
|
|
62
|
+
return false, err
|
|
63
|
+
}
|
|
64
|
+
return isScriptEnabled, nil
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
func (i *ICoreWebViewSettings) PutIsScriptEnabled(isScriptEnabled bool) error {
|
|
68
|
+
var err error
|
|
69
|
+
|
|
70
|
+
_, _, err = i.vtbl.PutIsScriptEnabled.Call(
|
|
71
|
+
uintptr(unsafe.Pointer(i)),
|
|
72
|
+
uintptr(boolToInt(isScriptEnabled)),
|
|
73
|
+
)
|
|
74
|
+
if err != windows.ERROR_SUCCESS {
|
|
75
|
+
return err
|
|
76
|
+
}
|
|
77
|
+
return nil
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
func (i *ICoreWebViewSettings) GetIsWebMessageEnabled() (bool, error) {
|
|
81
|
+
var err error
|
|
82
|
+
var isWebMessageEnabled bool
|
|
83
|
+
_, _, err = i.vtbl.GetIsWebMessageEnabled.Call(
|
|
84
|
+
uintptr(unsafe.Pointer(i)),
|
|
85
|
+
uintptr(unsafe.Pointer(&isWebMessageEnabled)),
|
|
86
|
+
)
|
|
87
|
+
if err != windows.ERROR_SUCCESS {
|
|
88
|
+
return false, err
|
|
89
|
+
}
|
|
90
|
+
return isWebMessageEnabled, nil
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
func (i *ICoreWebViewSettings) PutIsWebMessageEnabled(isWebMessageEnabled bool) error {
|
|
94
|
+
var err error
|
|
95
|
+
|
|
96
|
+
_, _, err = i.vtbl.PutIsWebMessageEnabled.Call(
|
|
97
|
+
uintptr(unsafe.Pointer(i)),
|
|
98
|
+
uintptr(boolToInt(isWebMessageEnabled)),
|
|
99
|
+
)
|
|
100
|
+
if err != windows.ERROR_SUCCESS {
|
|
101
|
+
return err
|
|
102
|
+
}
|
|
103
|
+
return nil
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
func (i *ICoreWebViewSettings) GetAreDefaultScriptDialogsEnabled() (bool, error) {
|
|
107
|
+
var err error
|
|
108
|
+
var areDefaultScriptDialogsEnabled bool
|
|
109
|
+
_, _, err = i.vtbl.GetAreDefaultScriptDialogsEnabled.Call(
|
|
110
|
+
uintptr(unsafe.Pointer(i)),
|
|
111
|
+
uintptr(unsafe.Pointer(&areDefaultScriptDialogsEnabled)),
|
|
112
|
+
)
|
|
113
|
+
if err != windows.ERROR_SUCCESS {
|
|
114
|
+
return false, err
|
|
115
|
+
}
|
|
116
|
+
return areDefaultScriptDialogsEnabled, nil
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
func (i *ICoreWebViewSettings) PutAreDefaultScriptDialogsEnabled(areDefaultScriptDialogsEnabled bool) error {
|
|
120
|
+
var err error
|
|
121
|
+
|
|
122
|
+
_, _, err = i.vtbl.PutAreDefaultScriptDialogsEnabled.Call(
|
|
123
|
+
uintptr(unsafe.Pointer(i)),
|
|
124
|
+
uintptr(boolToInt(areDefaultScriptDialogsEnabled)),
|
|
125
|
+
)
|
|
126
|
+
if err != windows.ERROR_SUCCESS {
|
|
127
|
+
return err
|
|
128
|
+
}
|
|
129
|
+
return nil
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
func (i *ICoreWebViewSettings) GetIsStatusBarEnabled() (bool, error) {
|
|
133
|
+
var err error
|
|
134
|
+
var isStatusBarEnabled bool
|
|
135
|
+
_, _, err = i.vtbl.GetIsStatusBarEnabled.Call(
|
|
136
|
+
uintptr(unsafe.Pointer(i)),
|
|
137
|
+
uintptr(unsafe.Pointer(&isStatusBarEnabled)),
|
|
138
|
+
)
|
|
139
|
+
if err != windows.ERROR_SUCCESS {
|
|
140
|
+
return false, err
|
|
141
|
+
}
|
|
142
|
+
return isStatusBarEnabled, nil
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
func (i *ICoreWebViewSettings) PutIsStatusBarEnabled(isStatusBarEnabled bool) error {
|
|
146
|
+
var err error
|
|
147
|
+
|
|
148
|
+
_, _, err = i.vtbl.PutIsStatusBarEnabled.Call(
|
|
149
|
+
uintptr(unsafe.Pointer(i)),
|
|
150
|
+
uintptr(boolToInt(isStatusBarEnabled)),
|
|
151
|
+
)
|
|
152
|
+
if err != windows.ERROR_SUCCESS {
|
|
153
|
+
return err
|
|
154
|
+
}
|
|
155
|
+
return nil
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
func (i *ICoreWebViewSettings) GetAreDevToolsEnabled() (bool, error) {
|
|
159
|
+
var err error
|
|
160
|
+
var areDevToolsEnabled bool
|
|
161
|
+
_, _, err = i.vtbl.GetAreDevToolsEnabled.Call(
|
|
162
|
+
uintptr(unsafe.Pointer(i)),
|
|
163
|
+
uintptr(unsafe.Pointer(&areDevToolsEnabled)),
|
|
164
|
+
)
|
|
165
|
+
if err != windows.ERROR_SUCCESS {
|
|
166
|
+
return false, err
|
|
167
|
+
}
|
|
168
|
+
return areDevToolsEnabled, nil
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
func (i *ICoreWebViewSettings) PutAreDevToolsEnabled(areDevToolsEnabled bool) error {
|
|
172
|
+
var err error
|
|
173
|
+
_, _, err = i.vtbl.PutAreDevToolsEnabled.Call(
|
|
174
|
+
uintptr(unsafe.Pointer(i)),
|
|
175
|
+
uintptr(boolToInt(areDevToolsEnabled)),
|
|
176
|
+
)
|
|
177
|
+
if err != windows.ERROR_SUCCESS {
|
|
178
|
+
return err
|
|
179
|
+
}
|
|
180
|
+
return nil
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
func (i *ICoreWebViewSettings) GetAreDefaultContextMenusEnabled() (bool, error) {
|
|
184
|
+
var err error
|
|
185
|
+
var enabled bool
|
|
186
|
+
_, _, err = i.vtbl.GetAreDefaultContextMenusEnabled.Call(
|
|
187
|
+
uintptr(unsafe.Pointer(i)),
|
|
188
|
+
uintptr(unsafe.Pointer(&enabled)),
|
|
189
|
+
)
|
|
190
|
+
if err != windows.ERROR_SUCCESS {
|
|
191
|
+
return false, err
|
|
192
|
+
}
|
|
193
|
+
return enabled, nil
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
func (i *ICoreWebViewSettings) PutAreDefaultContextMenusEnabled(enabled bool) error {
|
|
197
|
+
var err error
|
|
198
|
+
_, _, err = i.vtbl.PutAreDefaultContextMenusEnabled.Call(
|
|
199
|
+
uintptr(unsafe.Pointer(i)),
|
|
200
|
+
uintptr(boolToInt(enabled)),
|
|
201
|
+
)
|
|
202
|
+
if err != windows.ERROR_SUCCESS {
|
|
203
|
+
return err
|
|
204
|
+
}
|
|
205
|
+
return nil
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
func (i *ICoreWebViewSettings) GetAreHostObjectsAllowed() (bool, error) {
|
|
209
|
+
var err error
|
|
210
|
+
var allowed bool
|
|
211
|
+
_, _, err = i.vtbl.GetAreHostObjectsAllowed.Call(
|
|
212
|
+
uintptr(unsafe.Pointer(i)),
|
|
213
|
+
uintptr(unsafe.Pointer(&allowed)),
|
|
214
|
+
)
|
|
215
|
+
if err != windows.ERROR_SUCCESS {
|
|
216
|
+
return false, err
|
|
217
|
+
}
|
|
218
|
+
return allowed, nil
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
func (i *ICoreWebViewSettings) PutAreHostObjectsAllowed(allowed bool) error {
|
|
222
|
+
var err error
|
|
223
|
+
|
|
224
|
+
_, _, err = i.vtbl.PutAreHostObjectsAllowed.Call(
|
|
225
|
+
uintptr(unsafe.Pointer(i)),
|
|
226
|
+
uintptr(boolToInt(allowed)),
|
|
227
|
+
)
|
|
228
|
+
if err != windows.ERROR_SUCCESS {
|
|
229
|
+
return err
|
|
230
|
+
}
|
|
231
|
+
return nil
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
func (i *ICoreWebViewSettings) GetIsZoomControlEnabled() (bool, error) {
|
|
235
|
+
var err error
|
|
236
|
+
var enabled bool
|
|
237
|
+
_, _, err = i.vtbl.GetIsZoomControlEnabled.Call(
|
|
238
|
+
uintptr(unsafe.Pointer(i)),
|
|
239
|
+
uintptr(unsafe.Pointer(&enabled)),
|
|
240
|
+
)
|
|
241
|
+
if err != windows.ERROR_SUCCESS {
|
|
242
|
+
return false, err
|
|
243
|
+
}
|
|
244
|
+
return enabled, nil
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
func (i *ICoreWebViewSettings) PutIsZoomControlEnabled(enabled bool) error {
|
|
248
|
+
var err error
|
|
249
|
+
|
|
250
|
+
_, _, err = i.vtbl.PutIsZoomControlEnabled.Call(
|
|
251
|
+
uintptr(unsafe.Pointer(i)),
|
|
252
|
+
uintptr(boolToInt(enabled)),
|
|
253
|
+
)
|
|
254
|
+
if err != windows.ERROR_SUCCESS {
|
|
255
|
+
return err
|
|
256
|
+
}
|
|
257
|
+
return nil
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
func (i *ICoreWebViewSettings) GetIsBuiltInErrorPageEnabled() (bool, error) {
|
|
261
|
+
var err error
|
|
262
|
+
var enabled bool
|
|
263
|
+
_, _, err = i.vtbl.GetIsBuiltInErrorPageEnabled.Call(
|
|
264
|
+
uintptr(unsafe.Pointer(i)),
|
|
265
|
+
uintptr(unsafe.Pointer(&enabled)),
|
|
266
|
+
)
|
|
267
|
+
if err != windows.ERROR_SUCCESS {
|
|
268
|
+
return false, err
|
|
269
|
+
}
|
|
270
|
+
return enabled, nil
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
func (i *ICoreWebViewSettings) PutIsBuiltInErrorPageEnabled(enabled bool) error {
|
|
274
|
+
var err error
|
|
275
|
+
|
|
276
|
+
_, _, err = i.vtbl.PutIsBuiltInErrorPageEnabled.Call(
|
|
277
|
+
uintptr(unsafe.Pointer(i)),
|
|
278
|
+
uintptr(boolToInt(enabled)),
|
|
279
|
+
)
|
|
280
|
+
if err != windows.ERROR_SUCCESS {
|
|
281
|
+
return err
|
|
282
|
+
}
|
|
283
|
+
return nil
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
func (i *ICoreWebViewSettings) GetUserAgent() (string, error) {
|
|
287
|
+
var err error
|
|
288
|
+
// Create *uint16 to hold result
|
|
289
|
+
var _userAgent *uint16
|
|
290
|
+
_, _, err = i.vtbl.GetUserAgent.Call(
|
|
291
|
+
uintptr(unsafe.Pointer(i)),
|
|
292
|
+
uintptr(unsafe.Pointer(_userAgent)),
|
|
293
|
+
)
|
|
294
|
+
if err != windows.ERROR_SUCCESS {
|
|
295
|
+
return "", err
|
|
296
|
+
} // Get result and cleanup
|
|
297
|
+
userAgent := windows.UTF16PtrToString(_userAgent)
|
|
298
|
+
windows.CoTaskMemFree(unsafe.Pointer(_userAgent))
|
|
299
|
+
return userAgent, nil
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
func (i *ICoreWebViewSettings) PutUserAgent(userAgent string) error {
|
|
303
|
+
var err error
|
|
304
|
+
// Convert string 'userAgent' to *uint16
|
|
305
|
+
_userAgent, err := windows.UTF16PtrFromString(userAgent)
|
|
306
|
+
if err != nil {
|
|
307
|
+
return err
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
_, _, err = i.vtbl.PutUserAgent.Call(
|
|
311
|
+
uintptr(unsafe.Pointer(i)),
|
|
312
|
+
uintptr(unsafe.Pointer(_userAgent)),
|
|
313
|
+
)
|
|
314
|
+
if err != windows.ERROR_SUCCESS {
|
|
315
|
+
return err
|
|
316
|
+
}
|
|
317
|
+
return nil
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
func (i *ICoreWebViewSettings) GetAreBrowserAcceleratorKeysEnabled() (bool, error) {
|
|
321
|
+
var err error
|
|
322
|
+
var enabled bool
|
|
323
|
+
_, _, err = i.vtbl.GetAreBrowserAcceleratorKeysEnabled.Call(
|
|
324
|
+
uintptr(unsafe.Pointer(i)),
|
|
325
|
+
uintptr(unsafe.Pointer(&enabled)),
|
|
326
|
+
)
|
|
327
|
+
if err != windows.ERROR_SUCCESS {
|
|
328
|
+
return false, err
|
|
329
|
+
}
|
|
330
|
+
return enabled, nil
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
func (i *ICoreWebViewSettings) PutAreBrowserAcceleratorKeysEnabled(enabled bool) error {
|
|
334
|
+
var err error
|
|
335
|
+
|
|
336
|
+
_, _, err = i.vtbl.PutAreBrowserAcceleratorKeysEnabled.Call(
|
|
337
|
+
uintptr(unsafe.Pointer(i)),
|
|
338
|
+
uintptr(boolToInt(enabled)),
|
|
339
|
+
)
|
|
340
|
+
if err != windows.ERROR_SUCCESS {
|
|
341
|
+
return err
|
|
342
|
+
}
|
|
343
|
+
return nil
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
func (i *ICoreWebViewSettings) GetIsPinchZoomEnabled() (bool, error) {
|
|
347
|
+
var err error
|
|
348
|
+
var enabled bool
|
|
349
|
+
_, _, err = i.vtbl.GetIsPinchZoomEnabled.Call(
|
|
350
|
+
uintptr(unsafe.Pointer(i)),
|
|
351
|
+
uintptr(unsafe.Pointer(&enabled)),
|
|
352
|
+
)
|
|
353
|
+
if err != windows.ERROR_SUCCESS {
|
|
354
|
+
return false, err
|
|
355
|
+
}
|
|
356
|
+
return enabled, nil
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
func (i *ICoreWebViewSettings) PutIsPinchZoomEnabled(enabled bool) error {
|
|
360
|
+
var err error
|
|
361
|
+
|
|
362
|
+
_, _, err = i.vtbl.PutIsPinchZoomEnabled.Call(
|
|
363
|
+
uintptr(unsafe.Pointer(i)),
|
|
364
|
+
uintptr(boolToInt(enabled)),
|
|
365
|
+
)
|
|
366
|
+
if err != windows.ERROR_SUCCESS {
|
|
367
|
+
return err
|
|
368
|
+
}
|
|
369
|
+
return nil
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
func (i *ICoreWebViewSettings) GetIsSwipeNavigationEnabled() (bool, error) {
|
|
373
|
+
var err error
|
|
374
|
+
var enabled bool
|
|
375
|
+
_, _, err = i.vtbl.GetIsSwipeNavigationEnabled.Call(
|
|
376
|
+
uintptr(unsafe.Pointer(i)),
|
|
377
|
+
uintptr(unsafe.Pointer(&enabled)),
|
|
378
|
+
)
|
|
379
|
+
if err != windows.ERROR_SUCCESS {
|
|
380
|
+
return false, err
|
|
381
|
+
}
|
|
382
|
+
return enabled, nil
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
func (i *ICoreWebViewSettings) PutIsSwipeNavigationEnabled(enabled bool) error {
|
|
386
|
+
var err error
|
|
387
|
+
|
|
388
|
+
_, _, err = i.vtbl.PutIsSwipeNavigationEnabled.Call(
|
|
389
|
+
uintptr(unsafe.Pointer(i)),
|
|
390
|
+
uintptr(boolToInt(enabled)),
|
|
391
|
+
)
|
|
392
|
+
if err != windows.ERROR_SUCCESS {
|
|
393
|
+
return err
|
|
394
|
+
}
|
|
395
|
+
return nil
|
|
396
|
+
}
|