커버리지 자료: https://kangax.github.io/compat-table/es6/
More apps in https://electron.atom.io/apps/
$ git clone https://github.com/electron/electron-api-demos
$ cd electron-api-demos
$ npm install
$ npm start
$ electron --interactive
> const electron = require('electron');
> const win = new electron.BrowserWindow({width: 800, height: 600});
> win.loadURL('https://m.naver.com');
Windows에서는 사용 불가 :-(
Renderer
Main
=> 실행 가능한 Electron 앱 생성
PROJECT_ROOT
├─node_modules
└─src
├─client
├─electron
└─server
PROJECT_ROOT
├─node_modules
└─output
├─client
├─electron
└─server.exe
1. 업데이트 체크
2. 다운로드
3. 내장 업데이트 모듈에 전달
4. 설치 및 재시작
undoButton.addEventListener('click', e => {
protopie.history.undo();
});
protopie.history.on('undostackchange', (undoCount, redoCount) => {
if (undoCount === 0) {
undoButton.disabled = true;
}
});
export class CommandHistory {
@CallbackApi
public undo() {
}
@ListenerApi
public on(eventType, callback) {
}
}
const commandHistory = new CommandHistory();
virtualApi.addService('history', commandHistory);
const server = new VirtualApiClient(tunnelClient);
undoButton.addEventListener("click", () => {
server.history.undo();
});
export class Layer {
@Watch
x = 0;
@Watch
y = 0;
}
server.command("layer_edit", layerId, {x: 10, y:20});
server.layers.on('change', (layer, prop, newValue, oldValue) => {
this.element.style.left = layer.x + 'px';
this.element.style.top = layer.y + 'px';
});
export class CommandHistory {
@CallbackApi
undo() { ... }
@CallbackApi
redo() { ... }
@ListenerApi
on(eventType, callback) { ... }
}
this.apiServer.addService('history', new CommandHistory(context));
server.history.on('undostackchange', (undoCount, redoCount) => {
...
});
server.history.undo();