Platform-specific TypeScript declarations for NativeScript for accessing native objects
84
Build a TypeScript module that provides utilities for working with geometric shapes using native iOS structs in a NativeScript application.
Your module should provide functionality to:
The module should work with native struct types and handle coordinate systems appropriately.
/**
* Creates a rectangle with the specified origin and dimensions
*/
export function createRectangle(x: number, y: number, width: number, height: number): any;
/**
* Calculates the area of a rectangle
*/
export function calculateArea(rect: any): number;
/**
* Checks if two rectangles are equal
*/
export function areRectanglesEqual(rect1: any, rect2: any): boolean;
/**
* Creates a copy of a rectangle with width and height scaled by the given factor
*/
export function scaleRectangle(rect: any, scaleFactor: number): any;
/**
* Checks if a point is contained within a rectangle
*/
export function containsPoint(rect: any, x: number, y: number): boolean;@generates
Provides TypeScript type definitions for NativeScript platform APIs, including iOS native struct types and interoperability utilities.
@satisfied-by
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