mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Typescript - freeze window.ssf api
This commit is contained in:
parent
7fd7cbfcad
commit
1803469ea0
@ -5,6 +5,12 @@ import * as ReactDOM from 'react-dom';
|
||||
import WindowsTitleBar from '../renderer/windows-title-bar';
|
||||
import { SSFApi } from './ssf-api';
|
||||
|
||||
interface ISSFWindow extends Window {
|
||||
ssf?: SSFApi;
|
||||
}
|
||||
|
||||
const ssfWindow: ISSFWindow = window;
|
||||
|
||||
/**
|
||||
* creates API exposed from electron.
|
||||
*/
|
||||
@ -23,7 +29,8 @@ const createAPI = () => {
|
||||
// API exposed to renderer process.
|
||||
//
|
||||
// @ts-ignore
|
||||
window.ssf = new SSFApi();
|
||||
ssfWindow.ssf = new SSFApi();
|
||||
Object.freeze(ssfWindow.ssf);
|
||||
};
|
||||
|
||||
createAPI();
|
||||
|
Loading…
Reference in New Issue
Block a user