MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / nativeScriptInfo

Function nativeScriptInfo

packages/nativescript-inspector/src/index.ts:2286–2312  ·  view source on GitHub ↗
(
  view: View,
  type: string,
  sourceRoot = "",
)

Source from the content-addressed store, hash-verified

2284}
2285
2286function nativeScriptInfo(
2287 view: View,
2288 type: string,
2289 sourceRoot = "",
2290): JSONObject {
2291 const anyView = view as any;
2292 const sourceLocation = sourceLocationForView(view, sourceRoot);
2293 return {
2294 id: stringValue(anyView.id),
2295 className: stringValue(anyView.className),
2296 type,
2297 sourceLocation,
2298 sourceFile: sourceString(sourceLocation, "file"),
2299 sourceLine: sourceNumber(sourceLocation, "line"),
2300 sourceColumn: sourceNumber(sourceLocation, "column"),
2301 text: cleanGeneratedNativeScriptText(stringValue(anyView.text), type),
2302 title: cleanGeneratedNativeScriptText(stringValue(anyView.title), type),
2303 src: nativeScriptImageSource(view, type),
2304 testID:
2305 stringValue(read(view, "testID")) ||
2306 stringValue(read(view, "testId")) ||
2307 stringValue(read(view, "automationText")),
2308 accessibilityLabel: stringValue(read(view, "accessibilityLabel")),
2309 accessibilityHint: stringValue(read(view, "accessibilityHint")),
2310 accessibilityValue: stringValue(read(view, "accessibilityValue")),
2311 };
2312}
2313
2314function nativeScriptTitle(view: View, type: string): string {
2315 const anyView = view as any;

Callers 1

nativeScriptNodeMethod · 0.85

Calls 7

sourceLocationForViewFunction · 0.85
stringValueFunction · 0.85
sourceStringFunction · 0.85
sourceNumberFunction · 0.85
nativeScriptImageSourceFunction · 0.85
readFunction · 0.85

Tested by

no test coverage detected