# UnifiedSlide API

UnifiedSlide is exposed through `scripts/main.js` as an AMD package entry.

## Factories

```js
require(['UnifiedSlide/main'], function (UnifiedSlide) {
  const control = UnifiedSlide.createControl({ container: '#frame', language: 'ja' });
});
```

Available factories:

- `createControl(options)` - default Host-facing Control factory.
- `createEditorControl(options)` - single-file editor body profile.  Supports `mode: 'edit'` and `mode: 'view'` / `readOnly` options.
- `createWorkbenchControl(options)` - composite profile with menu, toolbar, panes and statusbar options enabled by default.
- `createViewerControl(options)` - optional view/readOnly alias backed by the same Control implementation.

## Control methods

- `mount()` / `destroy()`
- `exec(commandId, args)`
- `on(eventName, handler)` / `off(eventName, handler)`
- `getState()`
- `setOptions(options)`
- `resize()` / `refreshLayout()`
- `getCommandRegistry()`
- `getMenuContributions(options)`
- `getToolbarContributions(options)`
- `getContextMenuContributions(options)`
- `getFileCapabilities()`

## File callbacks

UnifiedSlide does not hard-code local disk, app storage or cloud storage UI in
the runtime package.  File operations call Host-supplied callbacks:

- `OpenFile(request, state)`
- `SaveFile(request, state)`

The Demo provides local-PC callback examples only as Host integration samples.


## alpha36-fix11 Programable Editing Control API

`UnifiedSlideControl` exposes `openFile(payload, context)`, `saveFile(payload, context)`, `saveAsFile(payload, context)`, `exportFile(payload, context)`, and `getFileContext()` per the single-file policy v1.3. Save and export methods return `HostSavePayload/v1` with `payload.data` populated before Host `SaveFile` persistence.
