dom-render 1.0.97 → 1.0.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/dom-render.iml +9 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/jpa-buddy.xml +6 -0
- package/.idea/misc.xml +8 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/README.MD +6 -793
- package/package.json +1 -1
- package/DomRender.d.ts +0 -13
- package/DomRender.js +0 -72
- package/DomRenderProxy.d.ts +0 -30
- package/DomRenderProxy.js +0 -510
- package/components/ComponentSet.d.ts +0 -10
- package/components/ComponentSet.js +0 -13
- package/configs/Config.d.ts +0 -34
- package/configs/Config.js +0 -2
- package/configs/TargetAttr.d.ts +0 -6
- package/configs/TargetAttr.js +0 -2
- package/configs/TargetElement.d.ts +0 -14
- package/configs/TargetElement.js +0 -2
- package/css/parse/index.d.ts +0 -1
- package/css/parse/index.js +0 -512
- package/css/stringify/compiler.d.ts +0 -32
- package/css/stringify/compiler.js +0 -40
- package/css/stringify/compress.d.ts +0 -75
- package/css/stringify/compress.js +0 -156
- package/css/stringify/identity.d.ts +0 -85
- package/css/stringify/identity.js +0 -194
- package/css/stringify/index.d.ts +0 -14
- package/css/stringify/index.js +0 -44
- package/dist/bundle.js +0 -5493
- package/events/EventManager.d.ts +0 -49
- package/events/EventManager.js +0 -529
- package/iterators/Range.d.ts +0 -23
- package/iterators/Range.js +0 -80
- package/lifecycle/OnBeforeReturnGet.d.ts +0 -3
- package/lifecycle/OnBeforeReturnGet.js +0 -2
- package/lifecycle/OnBeforeReturnSet.d.ts +0 -3
- package/lifecycle/OnBeforeReturnSet.js +0 -2
- package/lifecycle/OnChangeAttrRender.d.ts +0 -3
- package/lifecycle/OnChangeAttrRender.js +0 -2
- package/lifecycle/OnCreateRender.d.ts +0 -3
- package/lifecycle/OnCreateRender.js +0 -2
- package/lifecycle/OnDestroyRender.d.ts +0 -4
- package/lifecycle/OnDestroyRender.js +0 -2
- package/lifecycle/OnInitRender.d.ts +0 -3
- package/lifecycle/OnInitRender.js +0 -2
- package/lifecycle/OnProxyDomRender.d.ts +0 -4
- package/lifecycle/OnProxyDomRender.js +0 -2
- package/managers/RenderManager.d.ts +0 -3
- package/managers/RenderManager.js +0 -18
- package/messenger/DefaultMessenger.d.ts +0 -3
- package/messenger/DefaultMessenger.js +0 -27
- package/messenger/Messenger.d.ts +0 -78
- package/messenger/Messenger.js +0 -201
- package/operators/Appender.d.ts +0 -10
- package/operators/Appender.js +0 -64
- package/operators/AttrExpresion.d.ts +0 -0
- package/operators/AttrExpresion.js +0 -44
- package/operators/Dr.d.ts +0 -8
- package/operators/Dr.js +0 -101
- package/operators/DrAppender.d.ts +0 -8
- package/operators/DrAppender.js +0 -107
- package/operators/DrFor.d.ts +0 -8
- package/operators/DrFor.js +0 -104
- package/operators/DrForOf.d.ts +0 -8
- package/operators/DrForOf.js +0 -107
- package/operators/DrForm.d.ts +0 -8
- package/operators/DrForm.js +0 -138
- package/operators/DrIf.d.ts +0 -8
- package/operators/DrIf.js +0 -108
- package/operators/DrInnerHTML.d.ts +0 -8
- package/operators/DrInnerHTML.js +0 -99
- package/operators/DrInnerText.d.ts +0 -8
- package/operators/DrInnerText.js +0 -97
- package/operators/DrPre.d.ts +0 -7
- package/operators/DrPre.js +0 -73
- package/operators/DrRepeat.d.ts +0 -8
- package/operators/DrRepeat.js +0 -105
- package/operators/DrTargetAttr.d.ts +0 -7
- package/operators/DrTargetAttr.js +0 -98
- package/operators/DrTargetElement.d.ts +0 -7
- package/operators/DrTargetElement.js +0 -114
- package/operators/DrThis.d.ts +0 -5
- package/operators/DrThis.js +0 -108
- package/operators/DrThisProperty.d.ts +0 -10
- package/operators/DrThisProperty.js +0 -143
- package/operators/OperatorExecuter.d.ts +0 -49
- package/operators/OperatorExecuter.js +0 -89
- package/operators/OperatorExecuterAttrRequire.d.ts +0 -8
- package/operators/OperatorExecuterAttrRequire.js +0 -79
- package/rawsets/AttrInitCallBack.d.ts +0 -5
- package/rawsets/AttrInitCallBack.js +0 -2
- package/rawsets/Attrs.d.ts +0 -24
- package/rawsets/Attrs.js +0 -2
- package/rawsets/CreatorMetaData.d.ts +0 -18
- package/rawsets/CreatorMetaData.js +0 -2
- package/rawsets/DestroyOptionType.d.ts +0 -4
- package/rawsets/DestroyOptionType.js +0 -8
- package/rawsets/ElementInitCallBack.d.ts +0 -8
- package/rawsets/ElementInitCallBack.js +0 -2
- package/rawsets/RawSet.d.ts +0 -118
- package/rawsets/RawSet.js +0 -1141
- package/rawsets/RawSetOperatorType.d.ts +0 -3
- package/rawsets/RawSetOperatorType.js +0 -7
- package/rawsets/RawSetType.d.ts +0 -7
- package/rawsets/RawSetType.js +0 -11
- package/rawsets/Render.d.ts +0 -17
- package/rawsets/Render.js +0 -2
- package/routers/HashRouter.d.ts +0 -9
- package/routers/HashRouter.js +0 -53
- package/routers/PathRouter.d.ts +0 -9
- package/routers/PathRouter.js +0 -52
- package/routers/Router.d.ts +0 -28
- package/routers/Router.js +0 -126
- package/types/Types.d.ts +0 -14
- package/types/Types.js +0 -36
- package/utils/clipboard/ClipBoardUtils.d.ts +0 -6
- package/utils/clipboard/ClipBoardUtils.js +0 -25
- package/utils/dom/DomUtils.d.ts +0 -13
- package/utils/dom/DomUtils.js +0 -47
- package/utils/location/LocationUtils.d.ts +0 -16
- package/utils/location/LocationUtils.js +0 -63
- package/utils/node/NodeUtils.d.ts +0 -10
- package/utils/node/NodeUtils.js +0 -27
- package/utils/random/RandomUtils.d.ts +0 -7
- package/utils/random/RandomUtils.js +0 -47
- package/utils/script/ScriptUtils.d.ts +0 -14
- package/utils/script/ScriptUtils.js +0 -89
- package/utils/storage/StorageUtils.d.ts +0 -16
- package/utils/storage/StorageUtils.js +0 -87
- package/utils/string/StringUtils.d.ts +0 -6
- package/utils/string/StringUtils.js +0 -58
- package/utils/valid/ValidUtils.d.ts +0 -10
- package/utils/valid/ValidUtils.js +0 -78
- package/validators/AllCheckedValidatorArray.d.ts +0 -6
- package/validators/AllCheckedValidatorArray.js +0 -32
- package/validators/AllUnCheckedValidatorArray.d.ts +0 -6
- package/validators/AllUnCheckedValidatorArray.js +0 -32
- package/validators/CheckedValidator.d.ts +0 -5
- package/validators/CheckedValidator.js +0 -32
- package/validators/CountEqualsCheckedValidatorArray.d.ts +0 -7
- package/validators/CountEqualsCheckedValidatorArray.js +0 -34
- package/validators/CountEqualsUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountEqualsUnCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanUnCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanEqualsCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanUnCheckedValidatorArray.js +0 -34
- package/validators/CountUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountUnCheckedValidatorArray.js +0 -34
- package/validators/EmptyValidator.d.ts +0 -5
- package/validators/EmptyValidator.js +0 -33
- package/validators/ExcludeCheckedValidatorArray.d.ts +0 -8
- package/validators/ExcludeCheckedValidatorArray.js +0 -41
- package/validators/FormValidator.d.ts +0 -7
- package/validators/FormValidator.js +0 -37
- package/validators/IncludeCheckedValidatorArray.d.ts +0 -8
- package/validators/IncludeCheckedValidatorArray.js +0 -41
- package/validators/MultipleValidator.d.ts +0 -8
- package/validators/MultipleValidator.js +0 -48
- package/validators/NonPassValidator.d.ts +0 -5
- package/validators/NonPassValidator.js +0 -31
- package/validators/NotEmptyValidator.d.ts +0 -5
- package/validators/NotEmptyValidator.js +0 -34
- package/validators/NotRegExpTestValidator.d.ts +0 -6
- package/validators/NotRegExpTestValidator.js +0 -42
- package/validators/PassValidator.d.ts +0 -5
- package/validators/PassValidator.js +0 -31
- package/validators/RegExpTestValidator.d.ts +0 -6
- package/validators/RegExpTestValidator.js +0 -43
- package/validators/RequiredValidator.d.ts +0 -5
- package/validators/RequiredValidator.js +0 -33
- package/validators/UnCheckedValidator.d.ts +0 -5
- package/validators/UnCheckedValidator.js +0 -32
- package/validators/ValidMultipleValidator.d.ts +0 -9
- package/validators/ValidMultipleValidator.js +0 -34
- package/validators/ValidValidator.d.ts +0 -6
- package/validators/ValidValidator.js +0 -33
- package/validators/ValidValidatorArray.d.ts +0 -7
- package/validators/ValidValidatorArray.js +0 -33
- package/validators/Validator.d.ts +0 -57
- package/validators/Validator.js +0 -242
- package/validators/ValidatorArray.d.ts +0 -17
- package/validators/ValidatorArray.js +0 -99
- package/validators/ValueEqualsValidator.d.ts +0 -6
- package/validators/ValueEqualsValidator.js +0 -33
- package/validators/ValueNotEqualsValidator.d.ts +0 -6
- package/validators/ValueNotEqualsValidator.js +0 -33
package/events/EventManager.d.ts
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
import { Config } from '../configs/Config';
|
2
|
-
export declare class EventManager {
|
3
|
-
static ownerVariablePathAttrName: string;
|
4
|
-
static readonly attrPrefix = "dr-";
|
5
|
-
readonly eventNames: string[];
|
6
|
-
readonly eventParam: string;
|
7
|
-
static readonly onInitAttrName: string;
|
8
|
-
static readonly valueAttrName: string;
|
9
|
-
static readonly valueLinkAttrName: string;
|
10
|
-
static readonly attrAttrName: string;
|
11
|
-
static readonly normalAttrMapAttrName: string;
|
12
|
-
static readonly styleAttrName: string;
|
13
|
-
static readonly classAttrName: string;
|
14
|
-
readonly attrNames: string[];
|
15
|
-
static readonly VALUE_VARNAME = "$value";
|
16
|
-
static readonly SCRIPTS_VARNAME = "$scripts";
|
17
|
-
static readonly FAG_VARNAME = "$fag";
|
18
|
-
static readonly RAWSET_VARNAME = "$rawset";
|
19
|
-
static readonly RANGE_VARNAME = "$range";
|
20
|
-
static readonly ROUTER_VARNAME = "$router";
|
21
|
-
static readonly ELEMENT_VARNAME = "$element";
|
22
|
-
static readonly TARGET_VARNAME = "$target";
|
23
|
-
static readonly EVENT_VARNAME = "$event";
|
24
|
-
static readonly COMPONENT_VARNAME = "$component";
|
25
|
-
static readonly INNERHTML_VARNAME = "$innerHTML";
|
26
|
-
static readonly ATTRIBUTE_VARNAME = "$attribute";
|
27
|
-
static readonly VARNAMES: string[];
|
28
|
-
static readonly WINDOW_EVENT_POPSTATE = "popstate";
|
29
|
-
static readonly WINDOW_EVENT_RESIZE = "resize";
|
30
|
-
static readonly WINDOW_EVENTS: string[];
|
31
|
-
readonly bindScript: string;
|
32
|
-
constructor();
|
33
|
-
findAttrElements(fragment: DocumentFragment | Element, config?: Config): Set<Element>;
|
34
|
-
applyEvent(obj: any, childNodes: Set<ChildNode> | Set<Element>, config?: Config): void;
|
35
|
-
changeVar(obj: any, elements: Set<Element> | Set<ChildNode>, varName?: string, config?: Config): void;
|
36
|
-
addDrEvents(obj: any, eventName: string, elements: Set<Element> | Set<ChildNode>, config?: Config): void;
|
37
|
-
addDrEventPram(obj: any, attr: string, elements: Set<ChildNode> | Set<Element>, config?: Config): void;
|
38
|
-
procAttr<T extends Element = Element>(elements: Set<Element> | Set<ChildNode> | undefined, attrName: string, callBack: (h: T, value: string, attributes: any) => void): void;
|
39
|
-
getValue<T = any>(obj: any, name: string, bindObj?: any): T;
|
40
|
-
setValue(obj: any, name: string, value?: any): void;
|
41
|
-
static isUsingThisVar(raws: string | null | undefined, varName: string | null | undefined): boolean;
|
42
|
-
static setBindProperty(scripts: {
|
43
|
-
[p: string]: any;
|
44
|
-
} | undefined, obj: any): {
|
45
|
-
[p: string]: any;
|
46
|
-
} | undefined;
|
47
|
-
getBindScript(config?: Config): string;
|
48
|
-
}
|
49
|
-
export declare const eventManager: EventManager;
|
package/events/EventManager.js
DELETED
@@ -1,529 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
3
|
-
__assign = Object.assign || function(t) {
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
-
s = arguments[i];
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
-
t[p] = s[p];
|
8
|
-
}
|
9
|
-
return t;
|
10
|
-
};
|
11
|
-
return __assign.apply(this, arguments);
|
12
|
-
};
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
-
exports.eventManager = exports.EventManager = void 0;
|
15
|
-
var ScriptUtils_1 = require("../utils/script/ScriptUtils");
|
16
|
-
var DomUtils_1 = require("../utils/dom/DomUtils");
|
17
|
-
var Range_1 = require("../iterators/Range");
|
18
|
-
var Types_1 = require("../types/Types");
|
19
|
-
var EventManager = /** @class */ (function () {
|
20
|
-
function EventManager() {
|
21
|
-
var _this = this;
|
22
|
-
this.eventNames = [
|
23
|
-
'click', 'mousedown', 'mouseup', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mouseenter', 'mouseleave', 'contextmenu',
|
24
|
-
'keyup', 'keydown', 'keypress',
|
25
|
-
'change', 'input', 'submit', 'resize', 'focus', 'blur'
|
26
|
-
];
|
27
|
-
this.eventParam = EventManager.attrPrefix + 'event';
|
28
|
-
this.attrNames = [
|
29
|
-
EventManager.valueAttrName,
|
30
|
-
EventManager.valueLinkAttrName,
|
31
|
-
EventManager.attrAttrName,
|
32
|
-
EventManager.normalAttrMapAttrName,
|
33
|
-
EventManager.styleAttrName,
|
34
|
-
EventManager.classAttrName,
|
35
|
-
EventManager.attrPrefix + 'window-event-' + EventManager.WINDOW_EVENT_POPSTATE,
|
36
|
-
EventManager.attrPrefix + 'window-event-' + EventManager.WINDOW_EVENT_RESIZE,
|
37
|
-
EventManager.onInitAttrName,
|
38
|
-
this.eventParam
|
39
|
-
];
|
40
|
-
this.bindScript = "\n const " + EventManager.VALUE_VARNAME + " = this.__render.value;\n const " + EventManager.SCRIPTS_VARNAME + " = this.__render.scripts;\n const " + EventManager.RANGE_VARNAME + " = this.__render.range;\n const " + EventManager.ROUTER_VARNAME + " = this.__render.router;\n const " + EventManager.ATTRIBUTE_VARNAME + " = this.__render.attribute;\n const " + EventManager.ELEMENT_VARNAME + " = this.__render.element;\n const " + EventManager.TARGET_VARNAME + " = this.__render.target;\n const " + EventManager.EVENT_VARNAME + " = this.__render.event;\n ";
|
41
|
-
this.eventNames.forEach(function (it) {
|
42
|
-
_this.attrNames.push(EventManager.attrPrefix + 'event-' + it);
|
43
|
-
});
|
44
|
-
if (typeof window !== 'undefined') {
|
45
|
-
EventManager.WINDOW_EVENTS.forEach(function (eventName) {
|
46
|
-
window === null || window === void 0 ? void 0 : window.addEventListener(eventName, function (event) {
|
47
|
-
var targetAttr = "dr-window-event-" + eventName;
|
48
|
-
document.querySelectorAll("[" + targetAttr + "]").forEach(function (it) {
|
49
|
-
var _a;
|
50
|
-
var script = it.getAttribute(targetAttr);
|
51
|
-
if (script) {
|
52
|
-
var obj = it.obj;
|
53
|
-
var config = (_a = obj === null || obj === void 0 ? void 0 : obj._DomRender_proxy) === null || _a === void 0 ? void 0 : _a.config;
|
54
|
-
ScriptUtils_1.ScriptUtils.eval(_this.bindScript + " " + script + " ", Object.assign(obj, {
|
55
|
-
__render: Object.freeze({
|
56
|
-
target: Types_1.DomRenderFinalProxy.final(event.target),
|
57
|
-
element: it,
|
58
|
-
event: event,
|
59
|
-
range: Range_1.Range.range,
|
60
|
-
scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj),
|
61
|
-
// ...EventManager.eventVariables
|
62
|
-
})
|
63
|
-
}));
|
64
|
-
}
|
65
|
-
});
|
66
|
-
});
|
67
|
-
});
|
68
|
-
}
|
69
|
-
}
|
70
|
-
// // 순환참조때문에 우선 여기에 뺴놓는다.
|
71
|
-
// public DomrenderProxyFinal(obj: any) {
|
72
|
-
// (obj as any)._DomRender_isFinal = true;
|
73
|
-
// return obj;
|
74
|
-
// }
|
75
|
-
// 중요 이벤트에 대상이될 Elements를 찾는다.
|
76
|
-
EventManager.prototype.findAttrElements = function (fragment, config) {
|
77
|
-
var _a, _b;
|
78
|
-
// const datas: {name: string, value: string | null, element: Element}[] = [];
|
79
|
-
var elements = new Set();
|
80
|
-
var addAttributes = (_b = (_a = config === null || config === void 0 ? void 0 : config.applyEvents) === null || _a === void 0 ? void 0 : _a.map(function (it) { return it.attrName; })) !== null && _b !== void 0 ? _b : [];
|
81
|
-
addAttributes.concat(this.attrNames).forEach(function (attrName) {
|
82
|
-
fragment === null || fragment === void 0 ? void 0 : fragment.querySelectorAll("[" + attrName + "]").forEach(function (it) {
|
83
|
-
elements.add(it);
|
84
|
-
});
|
85
|
-
});
|
86
|
-
return elements;
|
87
|
-
};
|
88
|
-
// 중요 처음 이벤트 처리
|
89
|
-
// eslint-disable-next-line no-undef
|
90
|
-
EventManager.prototype.applyEvent = function (obj, childNodes, config) {
|
91
|
-
var _this = this;
|
92
|
-
// console.log('eventManager applyEvent==>', obj, childNodes, config)
|
93
|
-
// Node.ELEMENT_NODE = 1
|
94
|
-
// event
|
95
|
-
// childNodes.forEach(it => {
|
96
|
-
// if (it instanceof Element) {
|
97
|
-
// it.setAttribute('dr-thieVariableName', 'this')
|
98
|
-
// }
|
99
|
-
// })
|
100
|
-
this.eventNames.forEach(function (it) {
|
101
|
-
_this.addDrEvents(obj, it, childNodes, config);
|
102
|
-
});
|
103
|
-
this.addDrEventPram(obj, this.eventParam, childNodes, config);
|
104
|
-
// value
|
105
|
-
this.procAttr(childNodes, EventManager.valueAttrName, function (it, attribute) {
|
106
|
-
var script = attribute;
|
107
|
-
if (script) {
|
108
|
-
var data = ScriptUtils_1.ScriptUtils.evalReturn(script, obj);
|
109
|
-
if (it.value !== data) {
|
110
|
-
it.value = data;
|
111
|
-
}
|
112
|
-
}
|
113
|
-
});
|
114
|
-
// normal-attr-map
|
115
|
-
this.procAttr(childNodes, EventManager.normalAttrMapAttrName, function (it, attribute) {
|
116
|
-
var map = new Map(JSON.parse(attribute));
|
117
|
-
map.forEach(function (v, k) {
|
118
|
-
var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.element; return " + v + " ", Object.assign(obj, {
|
119
|
-
__render: Object.freeze({
|
120
|
-
element: it,
|
121
|
-
attribute: DomUtils_1.DomUtils.getAttributeToObject(it)
|
122
|
-
})
|
123
|
-
}));
|
124
|
-
it.setAttribute(k, data);
|
125
|
-
});
|
126
|
-
});
|
127
|
-
// window event
|
128
|
-
EventManager.WINDOW_EVENTS.forEach(function (it) {
|
129
|
-
_this.procAttr(childNodes, EventManager.attrPrefix + 'window-event-' + it, function (it, attribute) {
|
130
|
-
it.obj = obj;
|
131
|
-
});
|
132
|
-
});
|
133
|
-
// value-link event
|
134
|
-
this.procAttr(childNodes, EventManager.valueLinkAttrName, function (it, varName) {
|
135
|
-
if (varName) {
|
136
|
-
var ownerVariablePathName = it.getAttribute(EventManager.ownerVariablePathAttrName);
|
137
|
-
var mapScript_1 = it.getAttribute(EventManager.valueLinkAttrName + ":map");
|
138
|
-
// const inMapScript = it.getAttribute(`${valueLinkAttrName}:in-map`);
|
139
|
-
var bindObj_1 = obj;
|
140
|
-
if (ownerVariablePathName) {
|
141
|
-
bindObj_1 = ScriptUtils_1.ScriptUtils.evalReturn(ownerVariablePathName, obj);
|
142
|
-
}
|
143
|
-
var getValue = _this.getValue(obj, varName, bindObj_1);
|
144
|
-
// TODO: 아래 나중에 리팩토링 필요함
|
145
|
-
if (typeof getValue === 'function' && getValue) {
|
146
|
-
var setValue = it.value;
|
147
|
-
if (mapScript_1) {
|
148
|
-
setValue = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + mapScript_1, Object.assign(bindObj_1, { __render: Object.freeze(__assign({ element: it, target: bindObj_1, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
|
149
|
-
}
|
150
|
-
getValue(setValue);
|
151
|
-
// 여기서 value가 먼저냐 value-link가 먼저냐 선을 정해야되는거네...
|
152
|
-
}
|
153
|
-
else if (getValue) {
|
154
|
-
var setValue = getValue;
|
155
|
-
if (mapScript_1) {
|
156
|
-
setValue = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + mapScript_1, Object.assign(bindObj_1, { __render: Object.freeze(__assign({ element: it, target: bindObj_1, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
|
157
|
-
}
|
158
|
-
it.value = setValue;
|
159
|
-
}
|
160
|
-
it.addEventListener('input', function (event) {
|
161
|
-
var value = it.value;
|
162
|
-
if (mapScript_1) {
|
163
|
-
value = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + mapScript_1, Object.assign(bindObj_1, {
|
164
|
-
__render: Object.freeze(__assign({ event: event, element: it, attribute: DomUtils_1.DomUtils.getAttributeToObject(it), target: event.target, range: Range_1.Range.range, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables))
|
165
|
-
}));
|
166
|
-
}
|
167
|
-
if (typeof _this.getValue(obj, varName, bindObj_1) === 'function') {
|
168
|
-
_this.getValue(obj, varName, bindObj_1)(value, event);
|
169
|
-
}
|
170
|
-
else {
|
171
|
-
_this.setValue(obj, varName, value);
|
172
|
-
}
|
173
|
-
});
|
174
|
-
}
|
175
|
-
});
|
176
|
-
// on-init event
|
177
|
-
this.procAttr(childNodes, EventManager.onInitAttrName, function (it, attribute) {
|
178
|
-
var script = attribute;
|
179
|
-
if (script) {
|
180
|
-
script = 'return ' + script;
|
181
|
-
}
|
182
|
-
if (script) {
|
183
|
-
ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + "; " + script + " ", Object.assign(obj, {
|
184
|
-
__render: Object.freeze(__assign({ element: it, attribute: DomUtils_1.DomUtils.getAttributeToObject(it) }, config === null || config === void 0 ? void 0 : config.eventVariables))
|
185
|
-
}));
|
186
|
-
// console.log('onInit--->', obj, varName, it)
|
187
|
-
// if (typeof this.getValue(obj, varName) === 'function') {
|
188
|
-
// this.getValue(obj, varName)(it);
|
189
|
-
// } else {
|
190
|
-
// this.setValue(obj, varName, it);
|
191
|
-
// }
|
192
|
-
}
|
193
|
-
});
|
194
|
-
this.changeVar(obj, childNodes, undefined, config);
|
195
|
-
// console.log('eventManager-applyEvent-->', config?.applyEvents)
|
196
|
-
var elements = Array.from(childNodes).filter(function (it) { return it.nodeType === 1; }).map(function (it) { return it; });
|
197
|
-
elements.forEach(function (it) {
|
198
|
-
var _a;
|
199
|
-
(_a = config === null || config === void 0 ? void 0 : config.applyEvents) === null || _a === void 0 ? void 0 : _a.filter(function (ta) { return it.getAttribute(ta.attrName) !== null; }).forEach(function (ta) { return ta.callBack(it, it.getAttribute(ta.attrName), obj); });
|
200
|
-
});
|
201
|
-
};
|
202
|
-
// eslint-disable-next-line no-undef
|
203
|
-
EventManager.prototype.changeVar = function (obj, elements, varName, config) {
|
204
|
-
var _this = this;
|
205
|
-
// console.log('-changeVar-->', obj, elements, varName);
|
206
|
-
// forEach elements
|
207
|
-
// value-link event
|
208
|
-
this.procAttr(elements, EventManager.valueLinkAttrName, function (it, attribute) {
|
209
|
-
var ownerVariablePathName = it.getAttribute(EventManager.ownerVariablePathAttrName);
|
210
|
-
var bindObj = obj;
|
211
|
-
if (ownerVariablePathName) {
|
212
|
-
bindObj = ScriptUtils_1.ScriptUtils.evalReturn(ownerVariablePathName, obj);
|
213
|
-
}
|
214
|
-
var mapScript = it.getAttribute(EventManager.valueLinkAttrName + ":map");
|
215
|
-
if (attribute && attribute === varName) {
|
216
|
-
var getValue = _this.getValue(obj, attribute, bindObj);
|
217
|
-
if (typeof getValue === 'function' && getValue) {
|
218
|
-
var setValue = it.value;
|
219
|
-
if (mapScript) {
|
220
|
-
setValue = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + mapScript, Object.assign(bindObj, { __render: Object.freeze(__assign({ element: it, target: bindObj, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
|
221
|
-
}
|
222
|
-
getValue(setValue);
|
223
|
-
}
|
224
|
-
else { // if (getValue !== undefined && getValue !== null)
|
225
|
-
var setValue = getValue;
|
226
|
-
if (mapScript) {
|
227
|
-
setValue = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + mapScript, Object.assign(bindObj, { __render: Object.freeze(__assign({ element: it, target: bindObj, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
|
228
|
-
}
|
229
|
-
it.value = setValue;
|
230
|
-
}
|
231
|
-
}
|
232
|
-
});
|
233
|
-
// attribute
|
234
|
-
this.procAttr(elements, EventManager.attrAttrName, function (it, attribute) {
|
235
|
-
var script = attribute;
|
236
|
-
if (script) {
|
237
|
-
script = 'return ' + script;
|
238
|
-
}
|
239
|
-
if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
|
240
|
-
var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.__render.element; " + script + " ", Object.assign(obj, {
|
241
|
-
__render: Object.freeze({
|
242
|
-
element: it,
|
243
|
-
attribute: DomUtils_1.DomUtils.getAttributeToObject(it)
|
244
|
-
})
|
245
|
-
}));
|
246
|
-
if (typeof data === 'string') {
|
247
|
-
data.split(',').forEach(function (sit) {
|
248
|
-
var _a = sit.split('='), key = _a[0], value = _a[1];
|
249
|
-
var s = value.trim();
|
250
|
-
var k = key.trim();
|
251
|
-
if (s === 'null') {
|
252
|
-
it.removeAttribute(k);
|
253
|
-
}
|
254
|
-
else {
|
255
|
-
it.setAttribute(k, s);
|
256
|
-
}
|
257
|
-
});
|
258
|
-
}
|
259
|
-
else if (Array.isArray(data)) {
|
260
|
-
data.forEach(function (sit) {
|
261
|
-
var _a = sit.split('='), key = _a[0], value = _a[1];
|
262
|
-
var s = value.trim();
|
263
|
-
var k = key.trim();
|
264
|
-
if (s === 'null') {
|
265
|
-
it.removeAttribute(k);
|
266
|
-
}
|
267
|
-
else {
|
268
|
-
it.setAttribute(k, s);
|
269
|
-
}
|
270
|
-
});
|
271
|
-
}
|
272
|
-
else {
|
273
|
-
for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
|
274
|
-
var _b = _a[_i], key = _b[0], value = _b[1];
|
275
|
-
if (value === null) {
|
276
|
-
it.removeAttribute(key);
|
277
|
-
}
|
278
|
-
else {
|
279
|
-
it.setAttribute(key, String(value));
|
280
|
-
}
|
281
|
-
}
|
282
|
-
}
|
283
|
-
}
|
284
|
-
});
|
285
|
-
// style
|
286
|
-
this.procAttr(elements, EventManager.styleAttrName, function (it, attribute) {
|
287
|
-
var script = attribute;
|
288
|
-
if (script) {
|
289
|
-
script = 'return ' + script;
|
290
|
-
}
|
291
|
-
if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
|
292
|
-
var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.__render.element; " + script + " ", Object.assign(obj, {
|
293
|
-
__render: Object.freeze({
|
294
|
-
element: it,
|
295
|
-
attribute: DomUtils_1.DomUtils.getAttributeToObject(it)
|
296
|
-
})
|
297
|
-
}));
|
298
|
-
if (typeof data === 'string') {
|
299
|
-
it.setAttribute('style', data);
|
300
|
-
}
|
301
|
-
else if (Array.isArray(data)) {
|
302
|
-
it.setAttribute('style', data.join(';'));
|
303
|
-
}
|
304
|
-
else {
|
305
|
-
for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
|
306
|
-
var _b = _a[_i], key = _b[0], value = _b[1];
|
307
|
-
if (it instanceof HTMLElement) {
|
308
|
-
it.style[key] = String(value);
|
309
|
-
}
|
310
|
-
}
|
311
|
-
}
|
312
|
-
}
|
313
|
-
});
|
314
|
-
// class
|
315
|
-
this.procAttr(elements, EventManager.classAttrName, function (it, attribute) {
|
316
|
-
var script = attribute;
|
317
|
-
if (script) {
|
318
|
-
script = 'return ' + script;
|
319
|
-
}
|
320
|
-
if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
|
321
|
-
var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.element; " + script + " ", Object.assign(obj, {
|
322
|
-
__render: Object.freeze({
|
323
|
-
element: it,
|
324
|
-
attribute: DomUtils_1.DomUtils.getAttributeToObject(it)
|
325
|
-
})
|
326
|
-
}));
|
327
|
-
if (typeof data === 'string') {
|
328
|
-
it.setAttribute('class', data);
|
329
|
-
}
|
330
|
-
else if (Array.isArray(data)) {
|
331
|
-
it.setAttribute('class', data.join(' '));
|
332
|
-
}
|
333
|
-
else {
|
334
|
-
for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
|
335
|
-
var _b = _a[_i], key = _b[0], value = _b[1];
|
336
|
-
if (it instanceof HTMLElement) {
|
337
|
-
if (value) {
|
338
|
-
it.classList.add(key);
|
339
|
-
}
|
340
|
-
else {
|
341
|
-
it.classList.remove(key);
|
342
|
-
}
|
343
|
-
}
|
344
|
-
}
|
345
|
-
}
|
346
|
-
}
|
347
|
-
});
|
348
|
-
// 중요 변수값 바꼈을때 이벤트 타겟 찾는것 normal-attr-map
|
349
|
-
this.procAttr(elements, EventManager.normalAttrMapAttrName, function (it, attribute) {
|
350
|
-
var map = new Map(JSON.parse(attribute));
|
351
|
-
map.forEach(function (v, k) {
|
352
|
-
// console.log('--->', v, k)
|
353
|
-
var isUsing = EventManager.isUsingThisVar(v, varName);
|
354
|
-
// console.log('---isUsing--> varName:', varName, 'k:', k, 'v:', v, 'isUsing:', isUsing);
|
355
|
-
if (isUsing) {
|
356
|
-
var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.element; return " + v + " ", Object.assign(obj, {
|
357
|
-
__render: Object.freeze({
|
358
|
-
element: it,
|
359
|
-
attribute: DomUtils_1.DomUtils.getAttributeToObject(it)
|
360
|
-
})
|
361
|
-
}));
|
362
|
-
it.setAttribute(k, data);
|
363
|
-
}
|
364
|
-
});
|
365
|
-
});
|
366
|
-
};
|
367
|
-
// eslint-disable-next-line no-undef
|
368
|
-
EventManager.prototype.addDrEvents = function (obj, eventName, elements, config) {
|
369
|
-
var _this = this;
|
370
|
-
// console.log('-------?', config?.router)
|
371
|
-
var attr = EventManager.attrPrefix + 'event-' + eventName;
|
372
|
-
this.procAttr(elements, attr, function (it, attribute) {
|
373
|
-
var script = attribute;
|
374
|
-
it.addEventListener(eventName, function (event) {
|
375
|
-
var filter = true;
|
376
|
-
var filterScript = it.getAttribute(attr + ":filter");
|
377
|
-
var thisTarget = Object.assign(obj, {
|
378
|
-
__render: Object.freeze(__assign({ event: event, element: it, target: event.target, range: Range_1.Range.range, attribute: DomUtils_1.DomUtils.getAttributeToObject(it), router: config === null || config === void 0 ? void 0 : config.router, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables))
|
379
|
-
});
|
380
|
-
if (filterScript) {
|
381
|
-
filter = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + filterScript, thisTarget);
|
382
|
-
}
|
383
|
-
if (filter) {
|
384
|
-
ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " " + script + " ", thisTarget);
|
385
|
-
}
|
386
|
-
});
|
387
|
-
});
|
388
|
-
};
|
389
|
-
// eslint-disable-next-line no-undef
|
390
|
-
EventManager.prototype.addDrEventPram = function (obj, attr, elements, config) {
|
391
|
-
var _this = this;
|
392
|
-
this.procAttr(elements, attr, function (it, attribute, attributes) {
|
393
|
-
var bind = attributes[attr + ':bind'];
|
394
|
-
if (bind) {
|
395
|
-
var script_1 = attribute;
|
396
|
-
var params_1 = {};
|
397
|
-
var prefix_1 = attr + ':';
|
398
|
-
Object.entries(attributes).filter(function (_a) {
|
399
|
-
var k = _a[0], v = _a[1];
|
400
|
-
return k.startsWith(prefix_1);
|
401
|
-
}).forEach(function (_a) {
|
402
|
-
var k = _a[0], v = _a[1];
|
403
|
-
params_1[k.slice(prefix_1.length)] = v;
|
404
|
-
});
|
405
|
-
bind.split(',').forEach(function (eventName) {
|
406
|
-
it.addEventListener(eventName.trim(), function (event) {
|
407
|
-
ScriptUtils_1.ScriptUtils.eval("const $params = this.__render.params; " + _this.getBindScript(config) + " " + script_1 + " ", Object.assign(obj, {
|
408
|
-
__render: Object.freeze(__assign({ event: event, element: it, attribute: DomUtils_1.DomUtils.getAttributeToObject(it), target: event.target, range: Range_1.Range.range, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj), params: params_1 }, config === null || config === void 0 ? void 0 : config.eventVariables))
|
409
|
-
}));
|
410
|
-
});
|
411
|
-
});
|
412
|
-
}
|
413
|
-
});
|
414
|
-
};
|
415
|
-
// eslint-disable-next-line no-undef
|
416
|
-
EventManager.prototype.procAttr = function (elements, attrName, callBack) {
|
417
|
-
if (elements === void 0) { elements = new Set(); }
|
418
|
-
var sets = new Set();
|
419
|
-
elements.forEach(function (it) {
|
420
|
-
// console.log('--->type', it, it.nodeType)
|
421
|
-
if (!it) {
|
422
|
-
return;
|
423
|
-
}
|
424
|
-
// Node.ELEMENT_NODE = 1
|
425
|
-
if (it.nodeType === 1) {
|
426
|
-
var e = it;
|
427
|
-
sets.add(e);
|
428
|
-
e.querySelectorAll("[" + attrName + "]").forEach(function (it) {
|
429
|
-
sets.add(it);
|
430
|
-
});
|
431
|
-
}
|
432
|
-
});
|
433
|
-
sets.forEach(function (it) {
|
434
|
-
var attr = it.getAttribute(attrName);
|
435
|
-
var attrs = DomUtils_1.DomUtils.getAttributeToObject(it);
|
436
|
-
if (attr) {
|
437
|
-
callBack(it, attr, attrs);
|
438
|
-
}
|
439
|
-
});
|
440
|
-
};
|
441
|
-
EventManager.prototype.getValue = function (obj, name, bindObj) {
|
442
|
-
// let r = obj[name];
|
443
|
-
var r = ScriptUtils_1.ScriptUtils.evalReturn(name, obj);
|
444
|
-
if (typeof r === 'function') {
|
445
|
-
r = r.bind(bindObj !== null && bindObj !== void 0 ? bindObj : obj);
|
446
|
-
}
|
447
|
-
return r;
|
448
|
-
};
|
449
|
-
EventManager.prototype.setValue = function (obj, name, value) {
|
450
|
-
name = name.replaceAll('this.', 'this.this.');
|
451
|
-
ScriptUtils_1.ScriptUtils.eval(name + " = this.value;", {
|
452
|
-
this: obj,
|
453
|
-
value: value
|
454
|
-
});
|
455
|
-
};
|
456
|
-
EventManager.isUsingThisVar = function (raws, varName) {
|
457
|
-
// console.log('isUsingV', raws)
|
458
|
-
// console.log('isUsingV', raws, varName, ScriptUtils.getVariablePaths(raws ?? ''))
|
459
|
-
if (varName && raws) {
|
460
|
-
if (varName.startsWith('this.')) {
|
461
|
-
varName = varName.replace(/this\./, '');
|
462
|
-
}
|
463
|
-
EventManager.VARNAMES.forEach(function (it) {
|
464
|
-
// raws = raws!.replace(RegExp(it.replace('$', '\\$'), 'g'), `this?.___${it}`);
|
465
|
-
raws = raws.replace(RegExp(it.replace('$', '\\$'), 'g'), "this.___" + it);
|
466
|
-
});
|
467
|
-
var variablePaths = ScriptUtils_1.ScriptUtils.getVariablePaths(raws !== null && raws !== void 0 ? raws : '');
|
468
|
-
return variablePaths.has(varName);
|
469
|
-
}
|
470
|
-
return false;
|
471
|
-
};
|
472
|
-
EventManager.setBindProperty = function (scripts, obj) {
|
473
|
-
if (scripts) {
|
474
|
-
// const newScripts = Object.assign({}, scripts)
|
475
|
-
var newScripts = Object.assign({}, scripts);
|
476
|
-
for (var _i = 0, _a = Object.entries(newScripts); _i < _a.length; _i++) {
|
477
|
-
var _b = _a[_i], key = _b[0], value = _b[1];
|
478
|
-
if (typeof value === 'function') {
|
479
|
-
newScripts[key] = value.bind(obj);
|
480
|
-
}
|
481
|
-
}
|
482
|
-
return newScripts;
|
483
|
-
}
|
484
|
-
};
|
485
|
-
EventManager.prototype.getBindScript = function (config) {
|
486
|
-
var _this = this;
|
487
|
-
if (config === null || config === void 0 ? void 0 : config.eventVariables) {
|
488
|
-
var bindScript = Object.entries(config.eventVariables).filter(function (_a) {
|
489
|
-
var key = _a[0], value = _a[1];
|
490
|
-
return !_this.bindScript.includes("const " + key);
|
491
|
-
}).map(function (_a) {
|
492
|
-
var key = _a[0], value = _a[1];
|
493
|
-
return "const " + key + " = this.__render." + key + ";";
|
494
|
-
}).join(';');
|
495
|
-
return this.bindScript + '' + bindScript;
|
496
|
-
}
|
497
|
-
else {
|
498
|
-
return this.bindScript;
|
499
|
-
}
|
500
|
-
};
|
501
|
-
EventManager.ownerVariablePathAttrName = 'dr-owner-variable-path';
|
502
|
-
EventManager.attrPrefix = 'dr-';
|
503
|
-
EventManager.onInitAttrName = EventManager.attrPrefix + 'on-init';
|
504
|
-
EventManager.valueAttrName = EventManager.attrPrefix + 'value';
|
505
|
-
EventManager.valueLinkAttrName = EventManager.attrPrefix + 'value-link';
|
506
|
-
EventManager.attrAttrName = EventManager.attrPrefix + 'attr';
|
507
|
-
EventManager.normalAttrMapAttrName = EventManager.attrPrefix + 'normal-attr-map';
|
508
|
-
EventManager.styleAttrName = EventManager.attrPrefix + 'style';
|
509
|
-
EventManager.classAttrName = EventManager.attrPrefix + 'class';
|
510
|
-
EventManager.VALUE_VARNAME = '$value';
|
511
|
-
EventManager.SCRIPTS_VARNAME = '$scripts';
|
512
|
-
EventManager.FAG_VARNAME = '$fag';
|
513
|
-
EventManager.RAWSET_VARNAME = '$rawset';
|
514
|
-
EventManager.RANGE_VARNAME = '$range';
|
515
|
-
EventManager.ROUTER_VARNAME = '$router';
|
516
|
-
EventManager.ELEMENT_VARNAME = '$element';
|
517
|
-
EventManager.TARGET_VARNAME = '$target';
|
518
|
-
EventManager.EVENT_VARNAME = '$event';
|
519
|
-
EventManager.COMPONENT_VARNAME = '$component';
|
520
|
-
EventManager.INNERHTML_VARNAME = '$innerHTML';
|
521
|
-
EventManager.ATTRIBUTE_VARNAME = '$attribute';
|
522
|
-
EventManager.VARNAMES = [EventManager.SCRIPTS_VARNAME, EventManager.FAG_VARNAME, EventManager.RAWSET_VARNAME, EventManager.RANGE_VARNAME, EventManager.ROUTER_VARNAME, EventManager.ELEMENT_VARNAME, EventManager.TARGET_VARNAME, EventManager.EVENT_VARNAME, EventManager.COMPONENT_VARNAME, EventManager.INNERHTML_VARNAME, EventManager.ATTRIBUTE_VARNAME];
|
523
|
-
EventManager.WINDOW_EVENT_POPSTATE = 'popstate';
|
524
|
-
EventManager.WINDOW_EVENT_RESIZE = 'resize';
|
525
|
-
EventManager.WINDOW_EVENTS = [EventManager.WINDOW_EVENT_POPSTATE, EventManager.WINDOW_EVENT_RESIZE];
|
526
|
-
return EventManager;
|
527
|
-
}());
|
528
|
-
exports.EventManager = EventManager;
|
529
|
-
exports.eventManager = new EventManager();
|
package/iterators/Range.d.ts
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
export declare class RangeResult implements IteratorResult<number> {
|
2
|
-
done: boolean;
|
3
|
-
value: number;
|
4
|
-
constructor(value: number | undefined, done: boolean);
|
5
|
-
}
|
6
|
-
export declare class RangeIterator implements Iterator<number> {
|
7
|
-
private _first;
|
8
|
-
private _current;
|
9
|
-
private _last;
|
10
|
-
private _step;
|
11
|
-
constructor(first: number, last: number, step: number);
|
12
|
-
next(value?: any): IteratorResult<number>;
|
13
|
-
}
|
14
|
-
export declare class Range implements Iterable<number> {
|
15
|
-
first: number;
|
16
|
-
last: number;
|
17
|
-
step: number;
|
18
|
-
readonly isRange = true;
|
19
|
-
constructor(first: number, last: number, step?: number);
|
20
|
-
[Symbol.iterator](): Iterator<number>;
|
21
|
-
map<U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[];
|
22
|
-
static range(first: number | string, last?: number, step?: number): Range;
|
23
|
-
}
|