We are using the microfrontend framework piral. For our pilets we want to provide a custom api. Following the tutorials we came up with code like this
export interface MyApi {
example(): void;
}
export function createMyApi(): Extend<MyApi> {
return context => {
return (api, target) => {
return {
example() {
alert(`Hello from ${target.name}!`);
}
};
};
};
}
While this seems to be working functionally we could not get this to work with typescript. What are we doing wrong? How can we provide the typings in our pilets too?
I think you may be missing the proper declaration merging.
So all in all:
Hope that helps!