CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-tns-platform-declarations

Platform-specific TypeScript declarations for NativeScript for accessing native objects

84

1.23x
Overview
Eval results
Files

rubric.jsonevals/scenario-5/

{
  "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-declarations

tile.json