Describe the feature
At the moment, only serializable data types are supported (as parameters). For return types, only void is supported...
Motivation
... which means we can't have support for callbacks (e.g: Data roundtrips from RN -> Native -> RN).
For example. Sometimes we need the data back from native side to decide on something on JS side (showing something, activating something,...).
Example code:
export type DummyType = {
testParams: string;
testCallback: (arg: string) => void;
testAsyncCallback: (arg: string) => Promise<number>;
};
export interface BrownfieldNavigationSpec {
test(arg: DummyType): void;
testReturnAsync(arg: number): Promise<string>;
}
For reference, the bare codegen does support Promise:
export interface Spec extends TurboModule {
add(a: number, b: number): Promise<number>;
}
Related Issues
N/A
Describe the feature
At the moment, only serializable data types are supported (as parameters). For return types, only
voidis supported...Motivation
... which means we can't have support for callbacks (e.g: Data roundtrips from RN -> Native -> RN).
For example. Sometimes we need the data back from native side to decide on something on JS side (showing something, activating something,...).
Example code:
For reference, the bare codegen does support Promise:
Related Issues
N/A