Platform-specific TypeScript declarations for NativeScript for accessing native objects
84
{
"context": "This evaluation assesses how well the engineer uses the tns-platform-declarations package's interop module for pointer arithmetic and memory management. The focus is on correct usage of interop.alloc(), interop.Pointer operations (add/subtract), interop.Reference for typed memory access, and interop.sizeof() for type sizing.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Memory Allocation",
"description": "Uses interop.alloc() to allocate native memory buffers. The function should return an AdoptedPointer for automatic memory management.",
"max_score": 20
},
{
"name": "Pointer Arithmetic",
"description": "Uses interop.Pointer.add() or .subtract() methods to calculate offset positions in memory when navigating buffers. Should create new pointer instances at offset locations.",
"max_score": 25
},
{
"name": "Typed References",
"description": "Uses interop.Reference with interop.types.uint8 (or similar byte type) to read and write individual bytes at pointer locations. Should access .value property to get/set data.",
"max_score": 25
},
{
"name": "Type Sizing",
"description": "Uses interop.sizeof() with interop.types.uint8 (or similar) to determine byte sizes when calculating memory offsets and allocations.",
"max_score": 15
},
{
"name": "Buffer Copy Implementation",
"description": "Implements byte copying using pointer arithmetic and typed references in a loop or similar construct to transfer data from source to destination.",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-tns-platform-declarationsevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10