mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
23 lines
550 B
TypeScript
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,
|
|
});
|
|
});
|
|
}
|