@pact-foundation/pact-core 13.4.1-beta.1 → 13.4.1-beta.2
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/build/Makefile +352 -0
- package/build/binding.Makefile +6 -0
- package/build/copy_release_artifacts.target.mk +47 -0
- package/build/gyp-mac-tool +615 -0
- package/build/pact.target.mk +205 -0
- package/build/set_osx_install_name.target.mk +47 -0
- package/package.json +1 -1
- package/src/ffi/declarations.d.ts +48 -29
- package/src/ffi/declarations.js +51 -25
- package/src/ffi/declarations.js.map +1 -1
- package/src/ffi/index.d.ts +0 -6
- package/src/ffi/index.js +0 -33
- package/src/ffi/index.js.map +1 -1
- package/src/ffi/internals/index.d.ts +0 -2
- package/src/ffi/internals/index.js +1 -11
- package/src/ffi/internals/index.js.map +1 -1
- package/src/ffi/internals/types.d.ts +2 -4
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/src/index.js.map +1 -1
- package/src/logger/index.d.ts +2 -5
- package/src/logger/index.js +2 -15
- package/src/logger/index.js.map +1 -1
- package/src/publisher.d.ts +1 -0
- package/src/publisher.js +11 -4
- package/src/publisher.js.map +1 -1
- package/src/verifier/nativeVerifier.js +9 -6
- package/src/verifier/nativeVerifier.js.map +1 -1
- package/src/verifier/types.d.ts +3 -0
- package/src/verifier/validateOptions.js +3 -1
- package/src/verifier/validateOptions.js.map +1 -1
- package/standalone/install.d.ts +1 -1
- package/standalone/install.js +1 -1
- package/src/consumer/checkErrors.d.ts +0 -7
- package/src/consumer/checkErrors.js +0 -41
- package/src/consumer/checkErrors.js.map +0 -1
- package/src/consumer/index.d.ts +0 -3
- package/src/consumer/index.js +0 -133
- package/src/consumer/index.js.map +0 -1
- package/src/consumer/types.d.ts +0 -106
- package/src/consumer/types.js +0 -3
- package/src/consumer/types.js.map +0 -1
- package/src/ffi/argumentMapper/index.d.ts +0 -2
- package/src/ffi/argumentMapper/index.js +0 -47
- package/src/ffi/argumentMapper/index.js.map +0 -1
- package/src/ffi/argumentMapper/types.d.ts +0 -8
- package/src/ffi/argumentMapper/types.js +0 -3
- package/src/ffi/argumentMapper/types.js.map +0 -1
- package/src/ffi/types.d.ts +0 -15
- package/src/ffi/types.js +0 -28
- package/src/ffi/types.js.map +0 -1
- package/src/verifier/arguments.d.ts +0 -13
- package/src/verifier/arguments.js +0 -89
- package/src/verifier/arguments.js.map +0 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# This file is generated by gyp; do not edit.
|
|
2
|
+
|
|
3
|
+
TOOLSET := target
|
|
4
|
+
TARGET := pact
|
|
5
|
+
DEFS_Debug := \
|
|
6
|
+
'-DNODE_GYP_MODULE_NAME=pact' \
|
|
7
|
+
'-DUSING_UV_SHARED=1' \
|
|
8
|
+
'-DUSING_V8_SHARED=1' \
|
|
9
|
+
'-DV8_DEPRECATION_WARNINGS=1' \
|
|
10
|
+
'-DV8_DEPRECATION_WARNINGS' \
|
|
11
|
+
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
|
|
12
|
+
'-D_DARWIN_USE_64_BIT_INODE=1' \
|
|
13
|
+
'-D_LARGEFILE_SOURCE' \
|
|
14
|
+
'-D_FILE_OFFSET_BITS=64' \
|
|
15
|
+
'-DOPENSSL_NO_PINSHARED' \
|
|
16
|
+
'-DOPENSSL_THREADS' \
|
|
17
|
+
'-DNAPI_CPP_EXCEPTIONS' \
|
|
18
|
+
'-DBUILDING_NODE_EXTENSION' \
|
|
19
|
+
'-DDEBUG' \
|
|
20
|
+
'-D_DEBUG' \
|
|
21
|
+
'-DV8_ENABLE_CHECKS'
|
|
22
|
+
|
|
23
|
+
# Flags passed to all source files.
|
|
24
|
+
CFLAGS_Debug := \
|
|
25
|
+
-O0 \
|
|
26
|
+
-gdwarf-2 \
|
|
27
|
+
-fvisibility=hidden \
|
|
28
|
+
-mmacosx-version-min=10.7 \
|
|
29
|
+
-arch x86_64 \
|
|
30
|
+
-Wall \
|
|
31
|
+
-Wendif-labels \
|
|
32
|
+
-W \
|
|
33
|
+
-Wno-unused-parameter
|
|
34
|
+
|
|
35
|
+
# Flags passed to only C files.
|
|
36
|
+
CFLAGS_C_Debug := \
|
|
37
|
+
-fno-strict-aliasing
|
|
38
|
+
|
|
39
|
+
# Flags passed to only C++ files.
|
|
40
|
+
CFLAGS_CC_Debug := \
|
|
41
|
+
-std=gnu++1y \
|
|
42
|
+
-stdlib=libc++ \
|
|
43
|
+
-fno-rtti \
|
|
44
|
+
-fno-strict-aliasing
|
|
45
|
+
|
|
46
|
+
# Flags passed to only ObjC files.
|
|
47
|
+
CFLAGS_OBJC_Debug :=
|
|
48
|
+
|
|
49
|
+
# Flags passed to only ObjC++ files.
|
|
50
|
+
CFLAGS_OBJCC_Debug :=
|
|
51
|
+
|
|
52
|
+
INCS_Debug := \
|
|
53
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/include/node \
|
|
54
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/src \
|
|
55
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/deps/openssl/config \
|
|
56
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/deps/openssl/openssl/include \
|
|
57
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/deps/uv/include \
|
|
58
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/deps/zlib \
|
|
59
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/deps/v8/include \
|
|
60
|
+
-I$(srcdir)/node_modules/node-addon-api \
|
|
61
|
+
-I/Users/matthewfellows/development/public/pact-js-core/native
|
|
62
|
+
|
|
63
|
+
DEFS_Release := \
|
|
64
|
+
'-DNODE_GYP_MODULE_NAME=pact' \
|
|
65
|
+
'-DUSING_UV_SHARED=1' \
|
|
66
|
+
'-DUSING_V8_SHARED=1' \
|
|
67
|
+
'-DV8_DEPRECATION_WARNINGS=1' \
|
|
68
|
+
'-DV8_DEPRECATION_WARNINGS' \
|
|
69
|
+
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
|
|
70
|
+
'-D_DARWIN_USE_64_BIT_INODE=1' \
|
|
71
|
+
'-D_LARGEFILE_SOURCE' \
|
|
72
|
+
'-D_FILE_OFFSET_BITS=64' \
|
|
73
|
+
'-DOPENSSL_NO_PINSHARED' \
|
|
74
|
+
'-DOPENSSL_THREADS' \
|
|
75
|
+
'-DNAPI_CPP_EXCEPTIONS' \
|
|
76
|
+
'-DBUILDING_NODE_EXTENSION'
|
|
77
|
+
|
|
78
|
+
# Flags passed to all source files.
|
|
79
|
+
CFLAGS_Release := \
|
|
80
|
+
-O3 \
|
|
81
|
+
-gdwarf-2 \
|
|
82
|
+
-fvisibility=hidden \
|
|
83
|
+
-mmacosx-version-min=10.7 \
|
|
84
|
+
-arch x86_64 \
|
|
85
|
+
-Wall \
|
|
86
|
+
-Wendif-labels \
|
|
87
|
+
-W \
|
|
88
|
+
-Wno-unused-parameter
|
|
89
|
+
|
|
90
|
+
# Flags passed to only C files.
|
|
91
|
+
CFLAGS_C_Release := \
|
|
92
|
+
-fno-strict-aliasing
|
|
93
|
+
|
|
94
|
+
# Flags passed to only C++ files.
|
|
95
|
+
CFLAGS_CC_Release := \
|
|
96
|
+
-std=gnu++1y \
|
|
97
|
+
-stdlib=libc++ \
|
|
98
|
+
-fno-rtti \
|
|
99
|
+
-fno-strict-aliasing
|
|
100
|
+
|
|
101
|
+
# Flags passed to only ObjC files.
|
|
102
|
+
CFLAGS_OBJC_Release :=
|
|
103
|
+
|
|
104
|
+
# Flags passed to only ObjC++ files.
|
|
105
|
+
CFLAGS_OBJCC_Release :=
|
|
106
|
+
|
|
107
|
+
INCS_Release := \
|
|
108
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/include/node \
|
|
109
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/src \
|
|
110
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/deps/openssl/config \
|
|
111
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/deps/openssl/openssl/include \
|
|
112
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/deps/uv/include \
|
|
113
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/deps/zlib \
|
|
114
|
+
-I/Users/matthewfellows/Library/Caches/node-gyp/12.18.0/deps/v8/include \
|
|
115
|
+
-I$(srcdir)/node_modules/node-addon-api \
|
|
116
|
+
-I/Users/matthewfellows/development/public/pact-js-core/native
|
|
117
|
+
|
|
118
|
+
OBJS := \
|
|
119
|
+
$(obj).target/$(TARGET)/native/addon.o \
|
|
120
|
+
$(obj).target/$(TARGET)/native/ffi.o \
|
|
121
|
+
$(obj).target/$(TARGET)/native/consumer.o \
|
|
122
|
+
$(obj).target/$(TARGET)/native/provider.o \
|
|
123
|
+
$(obj).target/$(TARGET)/native/plugin.o
|
|
124
|
+
|
|
125
|
+
# Add to the list of files we specially track dependencies for.
|
|
126
|
+
all_deps += $(OBJS)
|
|
127
|
+
|
|
128
|
+
# CFLAGS et al overrides must be target-local.
|
|
129
|
+
# See "Target-specific Variable Values" in the GNU Make manual.
|
|
130
|
+
$(OBJS): TOOLSET := $(TOOLSET)
|
|
131
|
+
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
|
|
132
|
+
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
|
|
133
|
+
$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))
|
|
134
|
+
$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))
|
|
135
|
+
|
|
136
|
+
# Suffix rules, putting all outputs into $(obj).
|
|
137
|
+
|
|
138
|
+
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
|
|
139
|
+
@$(call do_cmd,cxx,1)
|
|
140
|
+
|
|
141
|
+
# Try building from generated source, too.
|
|
142
|
+
|
|
143
|
+
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
|
|
144
|
+
@$(call do_cmd,cxx,1)
|
|
145
|
+
|
|
146
|
+
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD
|
|
147
|
+
@$(call do_cmd,cxx,1)
|
|
148
|
+
|
|
149
|
+
# End of this set of suffix rules
|
|
150
|
+
### Rules for final target.
|
|
151
|
+
LDFLAGS_Debug := \
|
|
152
|
+
-undefined dynamic_lookup \
|
|
153
|
+
-Wl,-no_pie \
|
|
154
|
+
-Wl,-search_paths_first \
|
|
155
|
+
-mmacosx-version-min=10.7 \
|
|
156
|
+
-arch x86_64 \
|
|
157
|
+
-L$(builddir) \
|
|
158
|
+
-stdlib=libc++ \
|
|
159
|
+
-L/Users/matthewfellows/development/public/pact-js-core/native
|
|
160
|
+
|
|
161
|
+
LIBTOOLFLAGS_Debug := \
|
|
162
|
+
-undefined dynamic_lookup \
|
|
163
|
+
-Wl,-no_pie \
|
|
164
|
+
-Wl,-search_paths_first
|
|
165
|
+
|
|
166
|
+
LDFLAGS_Release := \
|
|
167
|
+
-undefined dynamic_lookup \
|
|
168
|
+
-Wl,-no_pie \
|
|
169
|
+
-Wl,-search_paths_first \
|
|
170
|
+
-mmacosx-version-min=10.7 \
|
|
171
|
+
-arch x86_64 \
|
|
172
|
+
-L$(builddir) \
|
|
173
|
+
-stdlib=libc++ \
|
|
174
|
+
-L/Users/matthewfellows/development/public/pact-js-core/native
|
|
175
|
+
|
|
176
|
+
LIBTOOLFLAGS_Release := \
|
|
177
|
+
-undefined dynamic_lookup \
|
|
178
|
+
-Wl,-no_pie \
|
|
179
|
+
-Wl,-search_paths_first
|
|
180
|
+
|
|
181
|
+
LIBS := \
|
|
182
|
+
-lpact_ffi \
|
|
183
|
+
-L/Users/matthewfellows/development/public/pact-js-core/ffi \
|
|
184
|
+
-Wl,-rpath,@loader_path
|
|
185
|
+
|
|
186
|
+
$(builddir)/pact.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
|
|
187
|
+
$(builddir)/pact.node: LIBS := $(LIBS)
|
|
188
|
+
$(builddir)/pact.node: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))
|
|
189
|
+
$(builddir)/pact.node: TOOLSET := $(TOOLSET)
|
|
190
|
+
$(builddir)/pact.node: $(OBJS) FORCE_DO_CMD
|
|
191
|
+
$(call do_cmd,solink_module)
|
|
192
|
+
|
|
193
|
+
all_deps += $(builddir)/pact.node
|
|
194
|
+
# Add target alias
|
|
195
|
+
.PHONY: pact
|
|
196
|
+
pact: $(builddir)/pact.node
|
|
197
|
+
|
|
198
|
+
# Short alias for building this executable.
|
|
199
|
+
.PHONY: pact.node
|
|
200
|
+
pact.node: $(builddir)/pact.node
|
|
201
|
+
|
|
202
|
+
# Add executable to "all" target.
|
|
203
|
+
.PHONY: all
|
|
204
|
+
all: $(builddir)/pact.node
|
|
205
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# This file is generated by gyp; do not edit.
|
|
2
|
+
|
|
3
|
+
TOOLSET := target
|
|
4
|
+
TARGET := set_osx_install_name
|
|
5
|
+
### Rules for action "modify install_name on osx":
|
|
6
|
+
quiet_cmd_binding_gyp_set_osx_install_name_target_modify_install_name_on_osx = ACTION binding_gyp_set_osx_install_name_target_modify_install_name_on_osx $@
|
|
7
|
+
cmd_binding_gyp_set_osx_install_name_target_modify_install_name_on_osx = LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd $(srcdir)/.; mkdir -p /Users/matthewfellows/development/public/pact-js-core/build/Release; install_name_tool -change libpact_ffi.dylib @rpath/libpact_ffi.dylib /Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node
|
|
8
|
+
|
|
9
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: obj := $(abs_obj)
|
|
10
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: builddir := $(abs_builddir)
|
|
11
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: export BUILT_FRAMEWORKS_DIR := ${abs_builddir}
|
|
12
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: export BUILT_PRODUCTS_DIR := ${abs_builddir}
|
|
13
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: export CONFIGURATION := ${BUILDTYPE}
|
|
14
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: export PRODUCT_NAME := set_osx_install_name
|
|
15
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: export SDKROOT :=
|
|
16
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: export SRCROOT := ${abs_srcdir}/
|
|
17
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: export SOURCE_ROOT := ${SRCROOT}
|
|
18
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: export TARGET_BUILD_DIR := ${abs_builddir}
|
|
19
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: export TEMP_DIR := ${TMPDIR}
|
|
20
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: TOOLSET := $(TOOLSET)
|
|
21
|
+
/Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node: /Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node FORCE_DO_CMD
|
|
22
|
+
$(call do_cmd,binding_gyp_set_osx_install_name_target_modify_install_name_on_osx)
|
|
23
|
+
|
|
24
|
+
all_deps += /Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node
|
|
25
|
+
action_binding_gyp_set_osx_install_name_target_modify_install_name_on_osx_outputs := /Users/matthewfellows/development/public/pact-js-core/build/Release/pact.node
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Rules for final target.
|
|
29
|
+
# Build our special outputs first.
|
|
30
|
+
$(obj).target/set_osx_install_name.stamp: | $(action_binding_gyp_set_osx_install_name_target_modify_install_name_on_osx_outputs)
|
|
31
|
+
|
|
32
|
+
# Preserve order dependency of special output on deps.
|
|
33
|
+
$(action_binding_gyp_set_osx_install_name_target_modify_install_name_on_osx_outputs): | $(builddir)/pact.node $(obj).target/copy_release_artifacts.stamp
|
|
34
|
+
|
|
35
|
+
$(obj).target/set_osx_install_name.stamp: TOOLSET := $(TOOLSET)
|
|
36
|
+
$(obj).target/set_osx_install_name.stamp: $(builddir)/pact.node $(obj).target/copy_release_artifacts.stamp FORCE_DO_CMD
|
|
37
|
+
$(call do_cmd,touch)
|
|
38
|
+
|
|
39
|
+
all_deps += $(obj).target/set_osx_install_name.stamp
|
|
40
|
+
# Add target alias
|
|
41
|
+
.PHONY: set_osx_install_name
|
|
42
|
+
set_osx_install_name: $(obj).target/set_osx_install_name.stamp
|
|
43
|
+
|
|
44
|
+
# Add target alias to "all" target.
|
|
45
|
+
.PHONY: all
|
|
46
|
+
all: set_osx_install_name
|
|
47
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pact-foundation/pact-core",
|
|
3
|
-
"version": "13.4.1-beta.
|
|
3
|
+
"version": "13.4.1-beta.2",
|
|
4
4
|
"description": "Core of @pact-foundation/pact. You almost certainly don't want to depend on this directly.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"homepage": "https://github.com/pact-foundation/pact-js-core#readme",
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import ref = require('ref-napi');
|
|
2
|
+
import refStructDi = require('ref-struct-di');
|
|
3
|
+
declare const PactHandle: refStructDi.StructType<{
|
|
4
|
+
pact: ref.Type<ref.Pointer<void>>;
|
|
5
|
+
}>;
|
|
6
|
+
declare const InteractionHandle: refStructDi.StructType<{
|
|
7
|
+
pact: ref.Type<ref.Pointer<void>>;
|
|
8
|
+
interaction: ref.Type<ref.Pointer<void>>;
|
|
9
|
+
}>;
|
|
3
10
|
export declare type FfiDeclarations = {
|
|
4
11
|
pactffi_init: ['string', ['string']];
|
|
5
12
|
pactffi_version: ['string', []];
|
|
6
13
|
pactffi_free_string: ['void', ['string']];
|
|
7
|
-
pactffi_verify: ['
|
|
14
|
+
pactffi_verify: ['int', ['string']];
|
|
8
15
|
pactffi_create_mock_server_for_pact: [
|
|
9
16
|
'int',
|
|
10
17
|
[
|
|
@@ -14,8 +21,7 @@ export declare type FfiDeclarations = {
|
|
|
14
21
|
]
|
|
15
22
|
];
|
|
16
23
|
pactffi_new_pact: [typeof PactHandle, ['string', 'string']];
|
|
17
|
-
pactffi_with_specification: ['
|
|
18
|
-
pactffi_mock_server_matched: ['bool', ['int32']];
|
|
24
|
+
pactffi_with_specification: ['void', [typeof PactHandle, 'int']];
|
|
19
25
|
pactffi_new_interaction: [
|
|
20
26
|
typeof InteractionHandle,
|
|
21
27
|
[
|
|
@@ -23,10 +29,10 @@ export declare type FfiDeclarations = {
|
|
|
23
29
|
'string'
|
|
24
30
|
]
|
|
25
31
|
];
|
|
26
|
-
pactffi_upon_receiving: ['
|
|
27
|
-
pactffi_given: ['
|
|
32
|
+
pactffi_upon_receiving: ['void', [typeof InteractionHandle, 'string']];
|
|
33
|
+
pactffi_given: ['void', [typeof InteractionHandle, 'string']];
|
|
28
34
|
pactffi_given_with_param: [
|
|
29
|
-
'
|
|
35
|
+
'void',
|
|
30
36
|
[
|
|
31
37
|
typeof InteractionHandle,
|
|
32
38
|
'string',
|
|
@@ -35,7 +41,7 @@ export declare type FfiDeclarations = {
|
|
|
35
41
|
]
|
|
36
42
|
];
|
|
37
43
|
pactffi_with_request: [
|
|
38
|
-
'
|
|
44
|
+
'void',
|
|
39
45
|
[
|
|
40
46
|
typeof InteractionHandle,
|
|
41
47
|
'string',
|
|
@@ -43,7 +49,7 @@ export declare type FfiDeclarations = {
|
|
|
43
49
|
]
|
|
44
50
|
];
|
|
45
51
|
pactffi_with_query_parameter: [
|
|
46
|
-
'
|
|
52
|
+
'void',
|
|
47
53
|
[
|
|
48
54
|
typeof InteractionHandle,
|
|
49
55
|
'string',
|
|
@@ -52,7 +58,7 @@ export declare type FfiDeclarations = {
|
|
|
52
58
|
]
|
|
53
59
|
];
|
|
54
60
|
pactffi_with_header: [
|
|
55
|
-
'
|
|
61
|
+
'void',
|
|
56
62
|
[
|
|
57
63
|
typeof InteractionHandle,
|
|
58
64
|
'int',
|
|
@@ -62,7 +68,7 @@ export declare type FfiDeclarations = {
|
|
|
62
68
|
]
|
|
63
69
|
];
|
|
64
70
|
pactffi_with_body: [
|
|
65
|
-
'
|
|
71
|
+
'void',
|
|
66
72
|
[
|
|
67
73
|
typeof InteractionHandle,
|
|
68
74
|
'int',
|
|
@@ -70,42 +76,55 @@ export declare type FfiDeclarations = {
|
|
|
70
76
|
'string'
|
|
71
77
|
]
|
|
72
78
|
];
|
|
73
|
-
|
|
74
|
-
'
|
|
79
|
+
pactffi_with_binary_file: [
|
|
80
|
+
'void',
|
|
75
81
|
[
|
|
76
82
|
typeof InteractionHandle,
|
|
77
83
|
'int',
|
|
78
84
|
'string',
|
|
79
85
|
'string',
|
|
80
|
-
'
|
|
86
|
+
'int'
|
|
81
87
|
]
|
|
82
88
|
];
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
pactffi_cleanup_mock_server: ['bool', ['int']];
|
|
86
|
-
pactffi_mock_server_mismatches: ['string', ['int']];
|
|
87
|
-
pactffi_get_tls_ca_certificate: ['string', []];
|
|
88
|
-
pactffi_log_message: ['void', ['string', 'string', 'string']];
|
|
89
|
-
pactffi_log_to_buffer: ['int32', ['int32']];
|
|
90
|
-
pactffi_init_with_log_level: ['void', ['int32']];
|
|
91
|
-
pactffi_log_to_stdout: ['int32', ['int32']];
|
|
92
|
-
pactffi_log_to_file: ['int32', ['string', 'int32', 'int32']];
|
|
93
|
-
pactffi_fetch_log_buffer: ['string', ['int32']];
|
|
94
|
-
pactffi_with_pact_metadata: [
|
|
95
|
-
'bool',
|
|
89
|
+
pactffi_with_multipart_file: [
|
|
90
|
+
'void',
|
|
96
91
|
[
|
|
97
|
-
typeof
|
|
92
|
+
typeof InteractionHandle,
|
|
93
|
+
'int',
|
|
98
94
|
'string',
|
|
99
95
|
'string',
|
|
100
96
|
'string'
|
|
101
97
|
]
|
|
102
98
|
];
|
|
99
|
+
pactffi_response_status: ['void', [typeof InteractionHandle, 'int']];
|
|
100
|
+
pactffi_write_pact_file: ['int', ['int', 'string']];
|
|
101
|
+
pactffi_cleanup_mock_server: ['bool', ['int']];
|
|
102
|
+
pactffi_mock_server_mismatches: ['string', ['int']];
|
|
103
|
+
pactffi_get_tls_ca_certificate: ['string', []];
|
|
104
|
+
pactffi_log_message: ['void', ['string', 'string', 'string']];
|
|
105
|
+
pactffi_log_to_buffer: ['int', ['int']];
|
|
106
|
+
pactffi_init_with_log_level: ['void', ['int']];
|
|
107
|
+
pactffi_log_to_stdout: ['int', ['int']];
|
|
108
|
+
pactffi_log_to_file: ['int', ['string', 'int', 'int']];
|
|
109
|
+
pactffi_fetch_log_buffer: ['string', ['int']];
|
|
103
110
|
};
|
|
104
111
|
export declare const declarations: FfiDeclarations;
|
|
105
112
|
export declare enum FfiFunctionResult {
|
|
106
113
|
RESULT_OK = 0,
|
|
107
114
|
RESULT_FAILED = 1
|
|
108
115
|
}
|
|
116
|
+
export declare enum FfiSpecificationVersion {
|
|
117
|
+
SPECIFICATION_VERSION_UNKNOWN = 0,
|
|
118
|
+
SPECIFICATION_VERSION_V1 = 1,
|
|
119
|
+
SPECIFICATION_VERSION_V1_1 = 2,
|
|
120
|
+
SPECIFICATION_VERSION_V2 = 3,
|
|
121
|
+
SPECIFICATION_VERSION_V3 = 4,
|
|
122
|
+
SPECIFICATION_VERSION_V4 = 5
|
|
123
|
+
}
|
|
124
|
+
export declare enum FfiInteractionPart {
|
|
125
|
+
INTERACTION_PART_REQUEST = 0,
|
|
126
|
+
INTERACTION_PART_RESPONSE = 1
|
|
127
|
+
}
|
|
109
128
|
export declare enum FfiLogLevelFilter {
|
|
110
129
|
LOG_LEVEL_OFF = 0,
|
|
111
130
|
LOG_LEVEL_ERROR = 1,
|
package/src/ffi/declarations.js
CHANGED
|
@@ -1,59 +1,85 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FfiLogLevelFilter = exports.FfiFunctionResult = exports.declarations = void 0;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
exports.FfiLogLevelFilter = exports.FfiInteractionPart = exports.FfiSpecificationVersion = exports.FfiFunctionResult = exports.declarations = void 0;
|
|
4
|
+
var ref = require("ref-napi");
|
|
5
|
+
var refStructDi = require("ref-struct-di");
|
|
6
|
+
var struct = refStructDi(ref);
|
|
7
|
+
var unknown = ref.types.void;
|
|
8
|
+
var pact = unknown;
|
|
9
|
+
var interaction = unknown;
|
|
10
|
+
var InteractionPtr = ref.refType(interaction);
|
|
11
|
+
var PactPtr = ref.refType(pact);
|
|
12
|
+
var PactHandle = struct({
|
|
13
|
+
pact: PactPtr,
|
|
14
|
+
});
|
|
15
|
+
var InteractionHandle = struct({
|
|
16
|
+
pact: PactPtr,
|
|
17
|
+
interaction: InteractionPtr,
|
|
18
|
+
});
|
|
6
19
|
exports.declarations = {
|
|
7
20
|
pactffi_init: ['string', ['string']],
|
|
8
21
|
pactffi_version: ['string', []],
|
|
9
22
|
pactffi_free_string: ['void', ['string']],
|
|
10
|
-
pactffi_verify: ['
|
|
23
|
+
pactffi_verify: ['int', ['string']],
|
|
11
24
|
pactffi_create_mock_server_for_pact: ['int', [PactHandle, 'string', 'bool']],
|
|
12
25
|
pactffi_new_pact: [PactHandle, ['string', 'string']],
|
|
13
|
-
pactffi_with_specification: ['
|
|
14
|
-
pactffi_mock_server_matched: ['bool', ['int32']],
|
|
26
|
+
pactffi_with_specification: ['void', [PactHandle, 'int']],
|
|
15
27
|
pactffi_new_interaction: [InteractionHandle, [PactHandle, 'string']],
|
|
16
|
-
pactffi_upon_receiving: ['
|
|
17
|
-
pactffi_given: ['
|
|
28
|
+
pactffi_upon_receiving: ['void', [InteractionHandle, 'string']],
|
|
29
|
+
pactffi_given: ['void', [InteractionHandle, 'string']],
|
|
18
30
|
pactffi_given_with_param: [
|
|
19
|
-
'
|
|
31
|
+
'void',
|
|
20
32
|
[InteractionHandle, 'string', 'string', 'string'],
|
|
21
33
|
],
|
|
22
|
-
pactffi_with_request: ['
|
|
34
|
+
pactffi_with_request: ['void', [InteractionHandle, 'string', 'string']],
|
|
23
35
|
pactffi_with_query_parameter: [
|
|
24
|
-
'
|
|
36
|
+
'void',
|
|
25
37
|
[InteractionHandle, 'string', 'int', 'string'],
|
|
26
38
|
],
|
|
27
39
|
pactffi_with_header: [
|
|
28
|
-
'
|
|
40
|
+
'void',
|
|
29
41
|
[InteractionHandle, 'int', 'string', 'int', 'string'],
|
|
30
42
|
],
|
|
31
|
-
pactffi_with_body: ['
|
|
43
|
+
pactffi_with_body: ['void', [InteractionHandle, 'int', 'string', 'string']],
|
|
44
|
+
pactffi_with_binary_file: [
|
|
45
|
+
'void',
|
|
46
|
+
[InteractionHandle, 'int', 'string', 'string', 'int'],
|
|
47
|
+
],
|
|
32
48
|
pactffi_with_multipart_file: [
|
|
33
|
-
'
|
|
49
|
+
'void',
|
|
34
50
|
[InteractionHandle, 'int', 'string', 'string', 'string'],
|
|
35
51
|
],
|
|
36
|
-
pactffi_response_status: ['
|
|
37
|
-
pactffi_write_pact_file: ['
|
|
52
|
+
pactffi_response_status: ['void', [InteractionHandle, 'int']],
|
|
53
|
+
pactffi_write_pact_file: ['int', ['int', 'string']],
|
|
38
54
|
pactffi_cleanup_mock_server: ['bool', ['int']],
|
|
39
55
|
pactffi_mock_server_mismatches: ['string', ['int']],
|
|
40
56
|
pactffi_get_tls_ca_certificate: ['string', []],
|
|
41
57
|
pactffi_log_message: ['void', ['string', 'string', 'string']],
|
|
42
|
-
pactffi_log_to_buffer: ['
|
|
43
|
-
pactffi_init_with_log_level: ['void', ['
|
|
44
|
-
pactffi_fetch_log_buffer: ['string', ['
|
|
45
|
-
pactffi_log_to_stdout: ['
|
|
46
|
-
pactffi_log_to_file: ['
|
|
47
|
-
pactffi_with_pact_metadata: [
|
|
48
|
-
'bool',
|
|
49
|
-
[PactHandle, 'string', 'string', 'string'],
|
|
50
|
-
],
|
|
58
|
+
pactffi_log_to_buffer: ['int', ['int']],
|
|
59
|
+
pactffi_init_with_log_level: ['void', ['int']],
|
|
60
|
+
pactffi_fetch_log_buffer: ['string', ['int']],
|
|
61
|
+
pactffi_log_to_stdout: ['int', ['int']],
|
|
62
|
+
pactffi_log_to_file: ['int', ['string', 'int', 'int']],
|
|
51
63
|
};
|
|
52
64
|
var FfiFunctionResult;
|
|
53
65
|
(function (FfiFunctionResult) {
|
|
54
66
|
FfiFunctionResult[FfiFunctionResult["RESULT_OK"] = 0] = "RESULT_OK";
|
|
55
67
|
FfiFunctionResult[FfiFunctionResult["RESULT_FAILED"] = 1] = "RESULT_FAILED";
|
|
56
68
|
})(FfiFunctionResult = exports.FfiFunctionResult || (exports.FfiFunctionResult = {}));
|
|
69
|
+
var FfiSpecificationVersion;
|
|
70
|
+
(function (FfiSpecificationVersion) {
|
|
71
|
+
FfiSpecificationVersion[FfiSpecificationVersion["SPECIFICATION_VERSION_UNKNOWN"] = 0] = "SPECIFICATION_VERSION_UNKNOWN";
|
|
72
|
+
FfiSpecificationVersion[FfiSpecificationVersion["SPECIFICATION_VERSION_V1"] = 1] = "SPECIFICATION_VERSION_V1";
|
|
73
|
+
FfiSpecificationVersion[FfiSpecificationVersion["SPECIFICATION_VERSION_V1_1"] = 2] = "SPECIFICATION_VERSION_V1_1";
|
|
74
|
+
FfiSpecificationVersion[FfiSpecificationVersion["SPECIFICATION_VERSION_V2"] = 3] = "SPECIFICATION_VERSION_V2";
|
|
75
|
+
FfiSpecificationVersion[FfiSpecificationVersion["SPECIFICATION_VERSION_V3"] = 4] = "SPECIFICATION_VERSION_V3";
|
|
76
|
+
FfiSpecificationVersion[FfiSpecificationVersion["SPECIFICATION_VERSION_V4"] = 5] = "SPECIFICATION_VERSION_V4";
|
|
77
|
+
})(FfiSpecificationVersion = exports.FfiSpecificationVersion || (exports.FfiSpecificationVersion = {}));
|
|
78
|
+
var FfiInteractionPart;
|
|
79
|
+
(function (FfiInteractionPart) {
|
|
80
|
+
FfiInteractionPart[FfiInteractionPart["INTERACTION_PART_REQUEST"] = 0] = "INTERACTION_PART_REQUEST";
|
|
81
|
+
FfiInteractionPart[FfiInteractionPart["INTERACTION_PART_RESPONSE"] = 1] = "INTERACTION_PART_RESPONSE";
|
|
82
|
+
})(FfiInteractionPart = exports.FfiInteractionPart || (exports.FfiInteractionPart = {}));
|
|
57
83
|
var FfiLogLevelFilter;
|
|
58
84
|
(function (FfiLogLevelFilter) {
|
|
59
85
|
FfiLogLevelFilter[FfiLogLevelFilter["LOG_LEVEL_OFF"] = 0] = "LOG_LEVEL_OFF";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations.js","sourceRoot":"","sources":["declarations.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"declarations.js","sourceRoot":"","sources":["declarations.ts"],"names":[],"mappings":"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"}
|
package/src/ffi/index.d.ts
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FfiBinding } from './internals/types';
|
|
2
|
-
import { LogLevel } from '../logger/types';
|
|
3
|
-
import { FfiDeclarations } from './declarations';
|
|
4
|
-
declare let ffi: Omit<FfiBinding<FfiDeclarations>, 'pactffi_init'>;
|
|
5
|
-
export declare const getFfiLib: (logLevel?: LogLevel) => typeof ffi;
|
|
6
|
-
export {};
|
package/src/ffi/index.js
CHANGED
|
@@ -1,35 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFfiLib = void 0;
|
|
4
|
-
var internals_1 = require("./internals");
|
|
5
|
-
var logger_1 = require("../logger");
|
|
6
|
-
var declarations_1 = require("./declarations");
|
|
7
|
-
var LOG_ENV_VAR_NAME = 'PACT_LOG_LEVEL';
|
|
8
|
-
var PACT_FFI_VERSION = '0.1.3';
|
|
9
|
-
var ffi;
|
|
10
|
-
var ffiLogLevel;
|
|
11
|
-
var initialiseFfi = function (logLevel) {
|
|
12
|
-
logger_1.default.debug("Initalising native core at log level '" + logLevel + "'");
|
|
13
|
-
process.env[LOG_ENV_VAR_NAME] = logLevel.toUpperCase();
|
|
14
|
-
ffiLogLevel = logLevel;
|
|
15
|
-
var lib = internals_1.createFfi(internals_1.libName('pact_ffi', "v" + PACT_FFI_VERSION), declarations_1.declarations);
|
|
16
|
-
lib.pactffi_init(LOG_ENV_VAR_NAME);
|
|
17
|
-
return lib;
|
|
18
|
-
};
|
|
19
|
-
var getFfiLib = function (logLevel) {
|
|
20
|
-
if (logLevel === void 0) { logLevel = logger_1.DEFAULT_LOG_LEVEL; }
|
|
21
|
-
if (!ffi) {
|
|
22
|
-
logger_1.default.trace('Initiliasing ffi for the first time');
|
|
23
|
-
ffi = initialiseFfi(logLevel);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
logger_1.default.trace('Ffi has already been initialised, no need to repeat it');
|
|
27
|
-
if (logLevel !== ffiLogLevel) {
|
|
28
|
-
logger_1.default.warn("The pact native core has already been initialised at log level '" + ffiLogLevel + "'");
|
|
29
|
-
logger_1.default.warn("The new requested log level '" + logLevel + "' will be ignored");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return ffi;
|
|
33
|
-
};
|
|
34
|
-
exports.getFfiLib = getFfiLib;
|
|
35
2
|
//# sourceMappingURL=index.js.map
|
package/src/ffi/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { FfiBinding } from './types';
|
|
3
|
-
export declare const createFfi: <T>(filename: string, description: T) => FfiBinding<T>;
|
|
4
2
|
export declare const libName: (library: string, version: string, processArch?: string, processPlatform?: NodeJS.Platform) => string;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.libName =
|
|
4
|
-
var ffi = require("ffi-napi");
|
|
5
|
-
var path = require("path");
|
|
6
|
-
var logger_1 = require("../../logger");
|
|
3
|
+
exports.libName = void 0;
|
|
7
4
|
var PLATFORM_LOOKUP = {
|
|
8
5
|
linux: 'linux',
|
|
9
6
|
darwin: 'osx',
|
|
@@ -21,13 +18,6 @@ var EXTENSION_LOOKUP = {
|
|
|
21
18
|
'linux-x86_64': 'so',
|
|
22
19
|
'windows-x86_64': 'dll',
|
|
23
20
|
};
|
|
24
|
-
var createFfi = function (filename, description) {
|
|
25
|
-
logger_1.default.trace("Native core located at '" + filename + "'");
|
|
26
|
-
var lib = ffi.Library(path.resolve(__dirname, '..', '..', '..', 'ffi', filename), description);
|
|
27
|
-
logger_1.default.trace("Native core linked successfully");
|
|
28
|
-
return lib;
|
|
29
|
-
};
|
|
30
|
-
exports.createFfi = createFfi;
|
|
31
21
|
var libName = function (library, version, processArch, processPlatform) {
|
|
32
22
|
if (processArch === void 0) { processArch = process.arch; }
|
|
33
23
|
if (processPlatform === void 0) { processPlatform = process.platform; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAQA,IAAM,eAAe,GAAG;IACtB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,SAAS;CACjB,CAAC;AAIF,IAAM,qBAAqB,GAAG;IAC5B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,EAAE;CACV,CAAC;AAIF,IAAM,WAAW,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;AAIrE,IAAM,gBAAgB,GAAG;IACvB,YAAY,EAAE,OAAO;IACrB,0BAA0B,EAAE,OAAO;IACnC,cAAc,EAAE,IAAI;IACpB,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAmBK,IAAM,OAAO,GAAG,UACrB,OAAe,EACf,OAAe,EACf,WAA0B,EAC1B,eAAkC;IADlC,4BAAA,EAAA,cAAc,OAAO,CAAC,IAAI;IAC1B,gCAAA,EAAA,kBAAkB,OAAO,CAAC,QAAQ;IAElC,IAAM,IAAI,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;IACtC,IAAM,QAAQ,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC;IAElD,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;QACtB,MAAM,IAAI,KAAK,CACb,wFAAsF,eAAe,SAAI,WAAW,MAAG,CACxH,CAAC;KACH;IAED,IAAM,MAAM,GAAM,QAAQ,SAAI,IAAM,CAAC;IAErC,IAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CACb,gGAA8F,MAAM,MAAG,CACxG,CAAC;KACH;IAED,IAAM,aAAa,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAC7D,IAAI,aAAa,KAAK,SAAS,EAAE;QAC/B,MAAM,IAAI,KAAK,CACb,gEAA8D,eAAe,MAAG,CACjF,CAAC;KACH;IAED,OAAU,OAAO,SAAI,aAAa,GAAG,OAAO,SAAI,MAAM,SAAI,SAAW,CAAC;AACxE,CAAC,CAAC;AAhCW,QAAA,OAAO,WAgClB"}
|
|
@@ -2,9 +2,8 @@ declare type AsyncFfiCall<Args extends unknown[], ReturnType> = {
|
|
|
2
2
|
async: (...args: [...Args, (err: Error, ret: ReturnType) => void]) => ReturnType;
|
|
3
3
|
};
|
|
4
4
|
declare type FfiFunction<T> = T extends (...a: infer Args) => infer ReturnType ? T & AsyncFfiCall<Args, ReturnType> : never;
|
|
5
|
-
declare type VariableType = 'string' | 'void' | 'int' | '
|
|
6
|
-
declare type
|
|
7
|
-
declare type ActualType<T> = [T] extends ['string'] ? string : [T] extends ['void'] ? void : [number] extends [T] ? UnpackEnum<T> : ['int32'] extends [T] ? [T] extends ['int32'] ? number : UnpackEnum<T> : ['int'] extends [T] ? [T] extends ['int'] ? number : UnpackEnum<T> : [T] extends ['double' | 'float'] ? number : [T] extends ['bool'] ? boolean : T;
|
|
5
|
+
declare type VariableType = 'string' | 'void' | 'int' | 'double' | 'float' | any;
|
|
6
|
+
declare type ActualType<T> = [T] extends ['string'] ? string : [T] extends ['void'] ? void : [T] extends ['int' | 'double' | 'float'] ? number : T;
|
|
8
7
|
declare type ArrayActualType<Tuple extends [...Array<unknown>]> = {
|
|
9
8
|
[Index in keyof Tuple]: ActualType<Tuple[Index]>;
|
|
10
9
|
} & {
|
|
@@ -21,5 +20,4 @@ declare type LibDescription<Functions extends string> = {
|
|
|
21
20
|
export declare type FfiBinding<T> = T extends LibDescription<string> ? {
|
|
22
21
|
[Key in keyof T]: FfiFunction<FunctionFromArray<T[Key]>>;
|
|
23
22
|
} : never;
|
|
24
|
-
export declare type FfiEnum<T> = T | 'int32';
|
|
25
23
|
export {};
|