Platform-specific TypeScript declarations for NativeScript for accessing native objects
84
{
"context": "This criteria evaluates the engineer's ability to correctly use the tns-platform-declarations package's unmanaged reference lifecycle system for iOS Core Foundation memory management. The focus is on proper usage of Unmanaged<T> and its associated methods to handle different ownership semantics.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Unmanaged type usage",
"description": "Uses the Unmanaged<T> interface or type to represent unmanaged Core Foundation references (e.g., Unmanaged<NSString> or similar pattern for Core Foundation strings)",
"max_score": 20
},
{
"name": "takeRetainedValue implementation",
"description": "Uses takeRetainedValue() method in the convertRetainedString function to properly consume a +1 retain count reference and obtain the managed value",
"max_score": 25
},
{
"name": "takeUnretainedValue implementation",
"description": "Uses takeUnretainedValue() method in the convertUnretainedString function to obtain the value without affecting the retain count for +0 references",
"max_score": 25
},
{
"name": "Correct semantic distinction",
"description": "Demonstrates understanding that takeRetainedValue() is for ownership transfer (consumes +1) while takeUnretainedValue() is for borrowed references (+0), using each method in the appropriate function",
"max_score": 20
},
{
"name": "String value extraction",
"description": "Correctly extracts and returns the JavaScript string value from the managed NSString or CFString object after calling the appropriate take method",
"max_score": 10
}
]
}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