preload
Source: preload.js:9
contextBridge surface: the whole renderer↔main API, exposed as window.ezl. Every method is a renderer→main invoke except onMenu, the sole inbound (main→renderer) direction. Auth tokens live in the main process; the renderer only ever sees the verified entitlement payload.
Instance Methods
getFilePath(file: File): string
Resolve a dropped/picked File object to its absolute path.
Parameters
file(File) — Browser File object.
Returns
string— Absolute filesystem path.
analyzeLoudness(path: string): Promise.<object>
Ask the worker to measure a file's loudness.
Parameters
path(string) — Absolute media path.
Returns
Promise.<object>— Worker analysis message.
getPreviewAudio(path: string): Promise.<Buffer>
Transcode a file Chromium can't play (e.g. AIFF) to WAV for preview.
Parameters
path(string) — Absolute audio path.
Returns
Promise.<Buffer>— WAV bytes (renderer wraps them in a Blob URL).
getVideoPreviewProxy(path: string): Promise.<string>
Build a preview-only H.264 proxy for videos whose picture Chromium can't decode (ProRes etc.).
Parameters
path(string) — Absolute video path.
Returns
Promise.<string>— The proxy's absolute path (renderer streams it via ezl-file://).
releaseVideoPreviewProxy(): Promise.<void>
Release the current video preview proxy so its disk space is reclaimed.
Returns
Promise.<void>
showFolderPicker(): Promise.<(string|null)>
Open a native directory chooser.
Returns
Promise.<(string|null)>— Chosen folder path, or null on cancel.
getDownloadsPath(): Promise.<string>
Resolve the OS Downloads directory.
Returns
Promise.<string>
getAppInfo(
): Promise.<{version: string, platform: string, osVersion: string}>
App + OS info for the support diagnostics form.
Returns
Promise.<{version: string, platform: string, osVersion: string}>
loadPartial(name: string): Promise.<string>
Load an app-authored modal partial's markup (allowlisted names only).
Parameters
name(string) — Partial name ('settings' | 'user' | 'help' | 'help-md').
Returns
Promise.<string>— The partial's source text.
pathExists(path: string): Promise.<boolean>
Check whether a path exists on disk (overwrite warning).
Parameters
path(string) — Absolute path.
Returns
Promise.<boolean>
revealInFolder(path: string): Promise.<void>
Reveal a path in Finder/Explorer.
Parameters
path(string) — Absolute path.
Returns
Promise.<void>
openAccountPortal(): Promise.<void>
Open the web account portal in the default browser (SSO handoff as the signed-in user; minted in main).
Returns
Promise.<void>
exportLaybacks(payload: object): Promise.<object>
Run a batch layback export through the worker.
Parameters
payload(object) — Export description (paths, levels, trims, output folder).
Returns
Promise.<object>— Worker result message.
updateMetadata(payload: object): Promise.<object>
Stamp metadata tags onto a finished export.
Parameters
payload(object) — Output path + tag values.
Returns
Promise.<object>— Worker result message.
sendSupportRequest(
payload: Object,
): Promise.<{ok: boolean, status: number, reason: string}>
Submit the support form → POST /support via main, which holds the bearer token — tokens never reach the renderer.
Parameters
payload(Object)
Returns
Promise.<{ok: boolean, status: number, reason: string}>
authSession(
): Promise.<{loggedIn: boolean, payload: object, offline: boolean}>
Restore the session. Auth tokens live in the main process; the renderer only sees the verified payload.
Returns
Promise.<{loggedIn: boolean, payload: object, offline: boolean}>
authLogin(
args: Object,
): Promise.<{ok: boolean, payload: object, error: string}>
Sign in with email + password.
Parameters
args(Object)
Returns
Promise.<{ok: boolean, payload: object, error: string}>
authLogout(): Promise.<{ok: true}>
Sign out and clear local auth state.
Returns
Promise.<{ok: true}>
getSettings(): Promise.<object>
Read the full settings object (defaults resolved).
Returns
Promise.<object>
setSettings(patch: object): Promise.<object>
Merge a partial settings patch; resolves with the full updated object.
Parameters
patch(object) — Only the slice that changed.
Returns
Promise.<object>
secretAvailable(): Promise.<boolean>
Whether OS-backed secure storage is available. Secrets expose a renderer-safe subset only — no plaintext get/set; those stay in main.
Returns
Promise.<boolean>
secretHas(key: string): Promise.<boolean>
Whether a secret exists for a key (e.g. an integration is connected).
Parameters
key(string) — Secret name.
Returns
Promise.<boolean>
secretDelete(key: string): Promise.<void>
Delete a stored secret (disconnect an integration).
Parameters
key(string) — Secret name.
Returns
Promise.<void>
saveProjectDialog(): Promise.<(string|null)>
Open the native Save Project dialog for a .ezlproj path.
Returns
Promise.<(string|null)>— Chosen path, or null on cancel.
openProjectDialog(): Promise.<(string|null)>
Open the native Open Project dialog for a .ezlproj file.
Returns
Promise.<(string|null)>— Chosen path, or null on cancel.
writeProjectFile(
p: string,
obj: object,
): Promise.<({ok: true}|{error: string})>
Write the serialized project to a dialog-approved path.
Parameters
p(string) — Dialog-approved .ezlproj path.obj(object) — Project object to serialize.
Returns
Promise.<({ok: true}|{error: string})>
readProjectFile(p: string): Promise.<(object|{error: string})>
Read + parse a project file from a dialog-approved path.
Parameters
p(string) — Dialog-approved .ezlproj path.
Returns
Promise.<(object|{error: string})>— Parsed project, or {error}.
onMenu(channel: string, handler: function): function
Subscribe to main→renderer events (menu clicks) — the ONLY inbound direction. The handler is wrapped so the raw IpcRendererEvent never leaks into renderer code.
Parameters
channel(string) — Event channel (e.g. 'menu:save-project', 'auth:session').handler(function) — Called with the event's payload args.
Returns
function— Unsubscribe function.