// start bridge
import { getRootVc, runOnUIThread } from './nativescript-bridge';
// log native calls directly
console.log(NSString.alloc().initWithString('Hello 👋 🎉 ~ NativeScript Team'));
// Here's 2 samples:
global.dreamBig = () => {
    const message = 'Dream big!';
    if (global.android) {
        return new java.lang.String(message);
    }
    else {
        return NSString.alloc().initWithString(message);
    }
};
// ^^ Now try calling from Ionic with:
/**
 * import { native } from '@nativescript/capacitor';
 *
 * native.dreamBig().value.then(v => console.log(v));
 */
global.openNativeModalView = () => {
    if (global.android) {
        // sample
    }
    else {
        // everything view related, do on ui thread
        runOnUIThread(() => {
            const vc = UIViewController.alloc().init();
            vc.view.backgroundColor = UIColor.blueColor;
            getRootVc().presentModalViewControllerAnimated(vc, true);
        });
    }
};
// ^^ Now try calling from Ionic with:
/**
 * import { native } from '@nativescript/capacitor';
 *
 * native.openNativeModalView();
 */
//# sourceMappingURL=nativescript-sample.js.map