mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: remove deprecation
This commit is contained in:
1 parent
833b960a48
commit
9971967fd1
11 files changed
+47
-20
No files matched your search
@@ -1,8 +1,22 @@
|
||||
import { SystemModel, UiContextBase } from 'hydrooj';
|
||||
import { Context, SystemModel, UiContextBase } from 'hydrooj';
|
||||
|
||||
declare module 'hydrooj' {
|
||||
interface UiContextBase {
|
||||
onlyofficeApi?: string;
|
||||
}
|
||||
}
|
||||
UiContextBase.onlyofficeApi = SystemModel.get('onlyoffice.api');
|
||||
|
||||
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,
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user