Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion NativeScript/runtime/SwiftInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
// calls it by reporting the arguments as an array: callbackBegin, each
// argument through the complete* entries, then completeArrayEnd.

#define NS_SWIFT_ABI_VERSION 13
#define NS_SWIFT_ABI_VERSION 15

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -344,6 +344,23 @@ struct NSSwiftAPI {
/* 53 */ void (*completeErrorValue)(void* token, const uint8_t* message,
intptr_t messageLength,
const uint8_t* type, intptr_t typeLength);

// A JS object argument (NSSwiftTagJSObject) carries the same handle for
// the same JS object and protocol. adapterOf returns the Swift adapter
// adopted for it (+0), or null; adoptAdapter hands the runtime the first
// one (+1), which it keeps while the JS object lives. The runtime holds
// the JS object strongly while anything else retains the adapter, weakly
// otherwise.
/* 54 */ void* (*adapterOf)(void* handle);
/* 55 */ void (*adoptAdapter)(void* handle, void* adapter);

// Called by an async thunk after starting its task, during the call that
// began `token`: `cancel(context)` runs if JS aborts the call (an
// AbortSignal passed after its arguments), and `release(context)` once
// the call settles either way.
/* 56 */ void (*setCancel)(void* token, void* context,
void (*cancel)(void* context),
void (*release)(void* context));
};

typedef void (*NSSwiftRegisterFunction)(NSSwiftRegistrar* registrar);
Expand Down
Loading
Loading