If you ever need something like that here is how ( thanks Yoav for the help !!!):
Public Module:
let callback;
export function registerCallback(cbk) {
callback = cbk;
}
export function yourFunction(data) {
callback(data);
}
Site Code:
import {registerCallback} from 'public/module';
$w.onReady(() => {
registerCallback(function(data) {
// here you get the data
});
})
Page Code:
import {yourFunction} from 'public/module';
yourFunction(SendTheDataToSiteCode);