Platform-specific TypeScript declarations for NativeScript for accessing native objects
84
{
"context": "This criteria evaluates how well the engineer uses tns-platform-declarations to access native Android and iOS APIs for retrieving device information. It focuses on proper usage of the package's native object access capabilities including Android SDK classes via android.* namespace and iOS SDK classes for device information.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Platform Detection",
"description": "Uses appropriate platform detection mechanism to determine whether code is running on Android or iOS (e.g., checking for existence of android or ios global objects, or using NativeScript platform utilities)",
"max_score": 15
},
{
"name": "Android Build Access",
"description": "Correctly accesses Android device information using android.os.Build class (e.g., android.os.Build.VERSION.SDK_INT for SDK version, android.os.Build.MANUFACTURER for manufacturer, android.os.Build.MODEL for model)",
"max_score": 25
},
{
"name": "iOS UIDevice Access",
"description": "Correctly accesses iOS device information using UIDevice class (e.g., UIDevice.currentDevice().systemVersion for OS version, UIDevice.currentDevice().name for device name, UIDevice.currentDevice().model for model identifier)",
"max_score": 25
},
{
"name": "Type Reference Directives",
"description": "Includes proper TypeScript triple-slash reference directives at the top of the file to import platform type definitions (/// <reference path=\"...tns-platform-declarations/android.d.ts\" /> and/or /// <reference path=\"...tns-platform-declarations/ios.d.ts\" />)",
"max_score": 20
},
{
"name": "Return Type Conformance",
"description": "Returns an object that conforms to the DeviceInfo interface specification with correct property names and types (platform, osVersion, manufacturer, deviceModel, deviceName)",
"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