From d0f033cf659588517d89fffda817b60f1de54f61 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Thu, 22 Feb 2024 13:07:56 +0100 Subject: [PATCH] fix: Fix TS error --- package/src/native/FilamentProxy.ts | 15 +++++++++++++++ package/src/test/TestHybridObject.ts | 12 +----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/package/src/native/FilamentProxy.ts b/package/src/native/FilamentProxy.ts index 1ede7b6f..44394021 100644 --- a/package/src/native/FilamentProxy.ts +++ b/package/src/native/FilamentProxy.ts @@ -1,11 +1,26 @@ import { FilamentNativeModule } from './FilamentNativeModule' +interface TestHybridObject { + int: number + string: string + + multipleArguments(first: number, second: boolean, third: string): Record + getIntGetter(): () => number + sayHelloCallback(callback: () => string): void + createNewHybridObject: () => TestHybridObject +} + export interface TFilamentProxy { /** * Loads a 3D Model from the given path. * @param path A web URL (http:// or https://), local file (file://) or resource ID. */ loadModel(path: string): number + + /** + * @private + */ + createTestObject(): TestHybridObject } // Check if we are running on-device (JSI) diff --git a/package/src/test/TestHybridObject.ts b/package/src/test/TestHybridObject.ts index 696183c1..b402f2aa 100644 --- a/package/src/test/TestHybridObject.ts +++ b/package/src/test/TestHybridObject.ts @@ -1,20 +1,10 @@ import { FilamentProxy } from '../native/FilamentProxy' -interface TestHybridObject { - int: number - string: string - - multipleArguments(first: number, second: boolean, third: string): Record - getIntGetter(): () => number - sayHelloCallback(callback: () => string): void - createNewHybridObject: () => TestHybridObject -} - export function testHybridObject() { console.log('------ BEGIN HybridObject tests...') // 1. Creation console.log('Creating HybridObject...') - const hybridObject = FilamentProxy.createTestObject() as TestHybridObject + const hybridObject = FilamentProxy.createTestObject() console.log('Created HybridObject!') // 2. Logging the entire thing as JSON