Skip to content

Commit 0c8c945

Browse files
authored
feat(types-ios): add interop type for stringFromCString (#10494)
1 parent d67d297 commit 0c8c945

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/types-ios/src/lib/ios/interop.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ declare module interop {
7676
*/
7777
function bufferFromData(data: NSData): ArrayBuffer;
7878

79+
/**
80+
* Converts a CString to a JavaScript string.
81+
* @param cString A pointer to a CString.
82+
* @param lengthInBytes The length of the string in bytes. UTF-8 characters may be more than one byte. If not provided the string is assumed to be null-terminated.
83+
* @returns A JavaScript string with length <= lengthInBytes.
84+
*/
85+
function stringFromCString(cString: Pointer | Reference<number>, lengthInBytes?: number): string;
86+
7987
/**
8088
* A type that wraps a pointer and allows read/write operations on its value.
8189
*/

0 commit comments

Comments
 (0)