-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
uix-short.ts
87 lines (72 loc) · 2.41 KB
/
uix-short.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// deno-lint-ignore-file no-control-regex
import { HTML } from "./src/html/template-strings.ts";
import { SCSS, css } from "./src/utils/css-template-strings.ts";
/** make decorators global */
import { bindToOrigin } from "./src/app/datex-over-http.ts";
import { content as _content, bindOrigin as _bindOrigin, id as _id, layout as _layout, child as _child, use as _use, NoResources as _NoResources, standalone as _standalone} from "./src/base/decorators.ts";
import { domUtils } from "./src/app/dom-context.ts";
import { template as _template, blankTemplate as _blankTemplate } from "./src/html/template.ts";
import { style as _style } from "./src/html/style.ts";
import { client_type } from "datex-core-legacy/utils/constants.ts";
import "./src/utils/window-apis.ts";
// TODO: remove
export {unsafeHTML} from "./src/html/unsafe-html.ts";
declare global {
const id: typeof _id;
const layout: typeof _layout;
const content: typeof _content;
const value: typeof _child;
const NoResources: typeof _NoResources;
const standalone: typeof _standalone;
const bindOrigin: typeof _bindOrigin;
const template: typeof _template;
const blankTemplate: typeof _blankTemplate;
const style: typeof _style;
}
// @ts-ignore global
globalThis.content = _content;
// @ts-ignore global
globalThis.id = _id;
// @ts-ignore global
globalThis.child = _child;
// @ts-ignore global
globalThis.layout = _layout;
// @ts-ignore global
globalThis.NoResources = _NoResources;
// @ts-ignore global
globalThis.standalone = _standalone;
// @ts-ignore global
globalThis.bindOrigin = _bindOrigin;
// @ts-ignore global
globalThis.template = _template;
// @ts-ignore global
globalThis.blankTemplate = _blankTemplate;
// @ts-ignore global
globalThis.style = _style;
// @ts-ignore global HTML
globalThis.HTML = HTML;
// @ts-ignore global HTML
globalThis.SCSS = SCSS;
// @ts-ignore global HTML
globalThis.css = css;
/**
* bind to origin in function prototype
*/
const _HTML = HTML;
const _SCSS = SCSS;
const _css = css;
declare global {
const HTML: typeof _HTML;
/**
* @deprecated, use css
*/
const SCSS: typeof _SCSS;
const css: typeof _css;
// interface CallableFunction {
// bindToOrigin<T, A extends unknown[], R>(this: (this: T, ...args: A) => R, context?:any): (...args: A)=>Promise<Awaited<Promise<R>>>;
// }
}
// // @ts-ignore
// Function.prototype.bindToOrigin = function (this:(...args: any)=>any, context:any) {
// return bindToOrigin(this, context);
// }