Files

29 lines
652 B
JavaScript

import { adapterFor, detectSurface } from "./surface.js";
import * as desktop from "./desktop.js";
import * as web from "./web.js";
const ADAPTERS = {
web,
desktop,
};
export function currentSurface(input) {
return detectSurface(input);
}
export function hostAdapter(kind = detectSurface()) {
return ADAPTERS[adapterFor(kind)] || web;
}
export function scheduleRestart(request, ctx, options = {}) {
return hostAdapter().scheduleRestart(request, ctx, options);
}
export function scheduleCleanupRestart(opts) {
return hostAdapter().scheduleCleanupRestart(opts);
}
export function restartNote() {
return hostAdapter().restartNote();
}