Commit Graph
4 Commits
Author SHA1 Message Date
Marc RousavyandGitHub 6998588b70 chore: Rename BorrowingReference<T> -> WeakReference<T>, and OwningReference<T> -> BorrowingReference<T> (#523)
* chore: Rename `BorrowingReference<T>` -> `WeakReference<T>`, and `OwningReference<T>` -> `BorrowingReference<T>`

* chore: Remove unused flag

* chore: Lint

* fix: remove unnecessary nullptr compare
2025-02-03 18:30:04 +01:00
Marc RousavyandGitHub a06c7d44af feat: Add new ArrayBuffer APIs (copy(), wrap(), allocate(), toData()) (#463)
* feat: Add `ArrayBuffer::copyBuffer(..)` API

* feat: Add `wrap` API for Kotlin

* feat: Add `ArrayBuffer.copy(data:)`

* perf: Copy Data a bit more effectively

* fix: Rename a bunch of things

* docs: Add creating docs

* feat: Add `ArrayBufferHolder.toData()`

* feat: Add `ArrayBuffer::copy(std::vector&)`

* perf: Change type of `.data` to `uint8_t*` to avoid upcast

* feat: Add `copyIfNeeded` flag

* Update array-buffers.md
2025-01-07 16:35:59 +01:00
Marc RousavyandGitHub 992c709caf feat: Safely wrap a Swift closure in a C++ accessible SwiftClosure struct and allow parameters bi-directionally (#81)
* feat: Safely wrap a Swift closure in a `SwiftClosure` struct callable from C++

* Unsafely unwrap (`!`)

* fix: Fix visibility modifiers

* fix: Rename `ClosureWrapper` -> `SwiftClosure`

* Update SwiftClosure.hpp

* Update SwiftClosure.hpp

* Create `SwiftFunction` base

* regen

* feat: Properly create `std::function` from Swift closure

* fix: Forward params I think

* Update SwiftCxxBridgedType.ts

* feat: Use static function pointer to allow for C++ types

* fix: Only do this for Swift

* Update SwiftCxxBridgedType.ts

* fix: Properly unwrap using `Unmanaged`

* fix: Fix Swift compiler crash by moving function to `std::shared_ptr` before capturing it

* feat: Properly share func before capturing it

* Update SwiftCxxTypeHelper.ts
2024-08-29 15:21:25 +02:00
Marc RousavyandGitHub c31936286d feat: Support ArrayBuffer in Swift 🥳 (#37)
* feat: Support `ArrayBuffer` in Swift

* feat: Create `ArrayBufferHolder` that holds a `std::shared_ptr<ArrayBuffer>`

* fix: Fix `void*` cast in Swift

* feat: Create `.allocate(..)` helper init

* fix: Fix `initializeToZero`

* feat: Add `createNewBuffer`

* fix: regenerate missing specs

* fix: Move import to iOS only, on Android we dont have that

* chore: Format
2024-08-14 19:34:31 +02:00