Skip to content

Commit

Permalink
fix: Fix TS error
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Feb 22, 2024
1 parent 43b1489 commit d0f033c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
15 changes: 15 additions & 0 deletions package/src/native/FilamentProxy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
import { FilamentNativeModule } from './FilamentNativeModule'

interface TestHybridObject {
int: number
string: string

multipleArguments(first: number, second: boolean, third: string): Record<string, number>
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)
Expand Down
12 changes: 1 addition & 11 deletions package/src/test/TestHybridObject.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
import { FilamentProxy } from '../native/FilamentProxy'

interface TestHybridObject {
int: number
string: string

multipleArguments(first: number, second: boolean, third: string): Record<string, number>
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
Expand Down

0 comments on commit d0f033c

Please sign in to comment.