You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hydro/packages/onlyoffice/index.ts

23 lines
550 B
TypeScript

import { Context, SystemModel, UiContextBase } from 'hydrooj';
declare module 'hydrooj' {
interface UiContextBase {
onlyofficeApi?: string;
}
}
export function apply(ctx: Context) {
Object.defineProperty(UiContextBase, 'onlyofficeApi', {
configurable: true,
enumerable: true,
get() {
return SystemModel.get('onlyoffice.api');
},
});
ctx.on('dispose', () => {
Object.defineProperty(UiContextBase, 'onlyofficeApi', {
enumerable: false,
});
});
}