mirror of
				https://github.com/NativeScript/NativeScript.git
				synced 2025-11-04 12:58:38 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			577 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			577 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import type { View } from '../../ui/core/view';
 | 
						|
 | 
						|
declare namespace org {
 | 
						|
	namespace nativescript {
 | 
						|
		class Bootstrap {
 | 
						|
			static isEmbeddedNativeScript: boolean;
 | 
						|
		}
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
export function isEmbedded(): boolean {
 | 
						|
	return org.nativescript?.Bootstrap?.isEmbeddedNativeScript;
 | 
						|
}
 | 
						|
 | 
						|
let embeddedView: View | undefined;
 | 
						|
 | 
						|
export function setEmbeddedView(view: View | undefined): void {
 | 
						|
	embeddedView = view;
 | 
						|
}
 | 
						|
 | 
						|
export function getEmbeddedView(): View {
 | 
						|
	if (!embeddedView) {
 | 
						|
		throw new Error("{N} Core: Fragment content view not set or set to 'undefined'");
 | 
						|
	}
 | 
						|
	return embeddedView;
 | 
						|
}
 |