@tachybase/schema 0.23.41 → 0.23.48
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/lib/core/effects/index.d.ts +2 -0
- package/lib/core/effects/index.js +23 -0
- package/lib/core/effects/onFieldEffects.d.ts +27 -0
- package/lib/core/effects/onFieldEffects.js +158 -0
- package/lib/core/effects/onFormEffects.d.ts +24 -0
- package/lib/core/effects/onFormEffects.js +117 -0
- package/lib/core/global.d.js +0 -0
- package/lib/core/index.d.ts +4 -0
- package/lib/core/index.js +27 -0
- package/lib/core/models/ArrayField.d.ts +17 -0
- package/lib/core/models/ArrayField.js +145 -0
- package/lib/core/models/BaseField.d.ts +72 -0
- package/lib/core/models/BaseField.js +285 -0
- package/lib/core/models/Field.d.ts +70 -0
- package/lib/core/models/Field.js +426 -0
- package/lib/core/models/Form.d.ts +102 -0
- package/lib/core/models/Form.js +483 -0
- package/lib/core/models/Graph.d.ts +8 -0
- package/lib/core/models/Graph.js +77 -0
- package/lib/core/models/Heart.d.ts +16 -0
- package/lib/core/models/Heart.js +91 -0
- package/lib/core/models/LifeCycle.d.ts +14 -0
- package/lib/core/models/LifeCycle.js +64 -0
- package/lib/core/models/ObjectField.d.ts +12 -0
- package/lib/core/models/ObjectField.js +64 -0
- package/lib/core/models/Query.d.ts +18 -0
- package/lib/core/models/Query.js +105 -0
- package/lib/core/models/VoidField.d.ts +14 -0
- package/lib/core/models/VoidField.js +117 -0
- package/lib/core/models/index.d.ts +9 -0
- package/lib/core/models/index.js +37 -0
- package/lib/core/models/types.d.ts +9 -0
- package/lib/core/models/types.js +15 -0
- package/lib/core/shared/checkers.d.ts +117 -0
- package/lib/core/shared/checkers.js +109 -0
- package/lib/core/shared/constants.d.ts +48 -0
- package/lib/core/shared/constants.js +86 -0
- package/lib/core/shared/effective.d.ts +9 -0
- package/lib/core/shared/effective.js +91 -0
- package/lib/core/shared/externals.d.ts +8 -0
- package/lib/core/shared/externals.js +87 -0
- package/lib/core/shared/internals.d.ts +54 -0
- package/lib/core/shared/internals.js +956 -0
- package/lib/core/types.d.ts +275 -0
- package/lib/core/types.js +76 -0
- package/lib/grid/index.d.ts +67 -0
- package/lib/grid/index.js +378 -0
- package/lib/grid/observer.d.ts +19 -0
- package/lib/grid/observer.js +107 -0
- package/lib/index.d.ts +12 -24
- package/lib/index.js +27 -244
- package/lib/json-schema/compiler.d.ts +8 -0
- package/lib/json-schema/compiler.js +129 -0
- package/lib/json-schema/global.d.js +0 -0
- package/lib/json-schema/index.d.ts +2 -0
- package/lib/json-schema/index.js +23 -0
- package/lib/json-schema/patches.d.ts +5 -0
- package/lib/json-schema/patches.js +68 -0
- package/lib/json-schema/polyfills/SPECIFICATION_1_0.d.ts +2 -0
- package/lib/json-schema/polyfills/SPECIFICATION_1_0.js +132 -0
- package/lib/json-schema/polyfills/index.d.ts +1 -0
- package/lib/json-schema/polyfills/index.js +21 -0
- package/lib/json-schema/schema.d.ts +88 -0
- package/lib/json-schema/schema.js +231 -0
- package/lib/json-schema/shared.d.ts +62 -0
- package/lib/json-schema/shared.js +232 -0
- package/lib/json-schema/transformer.d.ts +4 -0
- package/lib/json-schema/transformer.js +238 -0
- package/lib/json-schema/types.d.ts +119 -0
- package/lib/json-schema/types.js +15 -0
- package/lib/path/contexts.d.ts +10 -0
- package/lib/path/contexts.js +49 -0
- package/lib/path/destructor.d.ts +15 -0
- package/lib/path/destructor.js +151 -0
- package/lib/path/index.d.ts +51 -0
- package/lib/path/index.js +513 -0
- package/lib/path/matcher.d.ts +33 -0
- package/lib/path/matcher.js +197 -0
- package/lib/path/parser.d.ts +33 -0
- package/lib/path/parser.js +379 -0
- package/lib/path/shared.d.ts +13 -0
- package/lib/path/shared.js +121 -0
- package/lib/path/tokenizer.d.ts +27 -0
- package/lib/path/tokenizer.js +269 -0
- package/lib/path/tokens.d.ts +27 -0
- package/lib/path/tokens.js +216 -0
- package/lib/path/types.d.ts +88 -0
- package/lib/path/types.js +63 -0
- package/lib/react/components/ArrayField.d.ts +6 -0
- package/lib/react/components/ArrayField.js +44 -0
- package/lib/react/components/ExpressionScope.d.ts +2 -0
- package/lib/react/components/ExpressionScope.js +35 -0
- package/lib/react/components/Field.d.ts +5 -0
- package/lib/react/components/Field.js +45 -0
- package/lib/react/components/FormConsumer.d.ts +2 -0
- package/lib/react/components/FormConsumer.js +36 -0
- package/lib/react/components/FormProvider.d.ts +2 -0
- package/lib/react/components/FormProvider.js +35 -0
- package/lib/react/components/ObjectField.d.ts +6 -0
- package/lib/react/components/ObjectField.js +39 -0
- package/lib/react/components/ReactiveField.d.ts +11 -0
- package/lib/react/components/ReactiveField.js +115 -0
- package/lib/react/components/RecordScope.d.ts +2 -0
- package/lib/react/components/RecordScope.js +65 -0
- package/lib/react/components/RecordsScope.d.ts +2 -0
- package/lib/react/components/RecordsScope.js +43 -0
- package/lib/react/components/RecursionField.d.ts +2 -0
- package/lib/react/components/RecursionField.js +105 -0
- package/lib/react/components/SchemaField.d.ts +41 -0
- package/lib/react/components/SchemaField.js +154 -0
- package/lib/react/components/VoidField.d.ts +5 -0
- package/lib/react/components/VoidField.js +39 -0
- package/lib/react/components/index.d.ts +11 -0
- package/lib/react/components/index.js +41 -0
- package/lib/react/global.d.js +0 -0
- package/lib/react/hooks/index.d.ts +6 -0
- package/lib/react/hooks/index.js +31 -0
- package/lib/react/hooks/useAttach.d.ts +6 -0
- package/lib/react/hooks/useAttach.js +35 -0
- package/lib/react/hooks/useExpressionScope.d.ts +1 -0
- package/lib/react/hooks/useExpressionScope.js +30 -0
- package/lib/react/hooks/useField.d.ts +2 -0
- package/lib/react/hooks/useField.js +32 -0
- package/lib/react/hooks/useFieldSchema.d.ts +2 -0
- package/lib/react/hooks/useFieldSchema.js +32 -0
- package/lib/react/hooks/useForm.d.ts +2 -0
- package/lib/react/hooks/useForm.js +32 -0
- package/lib/react/hooks/useFormEffects.d.ts +2 -0
- package/lib/react/hooks/useFormEffects.js +42 -0
- package/lib/react/hooks/useParentForm.d.ts +2 -0
- package/lib/react/hooks/useParentForm.js +40 -0
- package/lib/react/index.d.ts +5 -0
- package/lib/react/index.js +29 -0
- package/lib/react/shared/connect.d.ts +9 -0
- package/lib/react/shared/connect.js +118 -0
- package/lib/react/shared/context.d.ts +14 -0
- package/lib/react/shared/context.js +74 -0
- package/lib/react/shared/index.d.ts +2 -0
- package/lib/react/shared/index.js +23 -0
- package/lib/react/shared/render.d.ts +2 -0
- package/lib/react/shared/render.js +69 -0
- package/lib/react/types.d.ts +84 -0
- package/lib/react/types.js +15 -0
- package/lib/reactive/action.d.ts +2 -0
- package/lib/reactive/action.js +48 -0
- package/lib/reactive/annotations/box.d.ts +7 -0
- package/lib/reactive/annotations/box.js +76 -0
- package/lib/reactive/annotations/computed.d.ts +12 -0
- package/lib/reactive/annotations/computed.js +154 -0
- package/lib/reactive/annotations/index.d.ts +5 -0
- package/lib/reactive/annotations/index.js +29 -0
- package/lib/reactive/annotations/observable.d.ts +4 -0
- package/lib/reactive/annotations/observable.js +67 -0
- package/lib/reactive/annotations/ref.d.ts +6 -0
- package/lib/reactive/annotations/ref.js +78 -0
- package/lib/reactive/annotations/shallow.d.ts +2 -0
- package/lib/reactive/annotations/shallow.js +67 -0
- package/lib/reactive/array.d.ts +12 -0
- package/lib/reactive/array.js +83 -0
- package/lib/reactive/autorun.d.ts +7 -0
- package/lib/reactive/autorun.js +155 -0
- package/lib/reactive/batch.d.ts +2 -0
- package/lib/reactive/batch.js +40 -0
- package/lib/reactive/checkers.d.ts +10 -0
- package/lib/reactive/checkers.js +60 -0
- package/lib/reactive/environment.d.ts +28 -0
- package/lib/reactive/environment.js +76 -0
- package/lib/reactive/externals.d.ts +10 -0
- package/lib/reactive/externals.js +156 -0
- package/lib/reactive/global.d.js +0 -0
- package/lib/reactive/handlers.d.ts +4 -0
- package/lib/reactive/handlers.js +246 -0
- package/lib/reactive/index.d.ts +10 -0
- package/lib/reactive/index.js +39 -0
- package/lib/reactive/internals.d.ts +17 -0
- package/lib/reactive/internals.js +139 -0
- package/lib/reactive/model.d.ts +3 -0
- package/lib/reactive/model.js +68 -0
- package/lib/reactive/observable.d.ts +9 -0
- package/lib/reactive/observable.js +50 -0
- package/lib/reactive/observe.d.ts +2 -0
- package/lib/reactive/observe.js +58 -0
- package/lib/reactive/reaction.d.ts +21 -0
- package/lib/reactive/reaction.js +278 -0
- package/lib/reactive/tracker.d.ts +7 -0
- package/lib/reactive/tracker.js +63 -0
- package/lib/reactive/tree.d.ts +25 -0
- package/lib/reactive/tree.js +106 -0
- package/lib/reactive/types.d.ts +79 -0
- package/lib/reactive/types.js +21 -0
- package/lib/reactive/untracked.d.ts +4 -0
- package/lib/reactive/untracked.js +29 -0
- package/lib/reactive-react/hooks/index.d.ts +9 -0
- package/lib/reactive-react/hooks/index.js +48 -0
- package/lib/reactive-react/hooks/useCompatEffect.d.ts +2 -0
- package/lib/reactive-react/hooks/useCompatEffect.js +60 -0
- package/lib/reactive-react/hooks/useCompatFactory.d.ts +3 -0
- package/lib/reactive-react/hooks/useCompatFactory.js +74 -0
- package/lib/reactive-react/hooks/useDidUpdate.d.ts +1 -0
- package/lib/reactive-react/hooks/useDidUpdate.js +38 -0
- package/lib/reactive-react/hooks/useForceUpdate.d.ts +1 -0
- package/lib/reactive-react/hooks/useForceUpdate.js +76 -0
- package/lib/reactive-react/hooks/useLayoutEffect.d.ts +2 -0
- package/lib/reactive-react/hooks/useLayoutEffect.js +28 -0
- package/lib/reactive-react/hooks/useObserver.d.ts +2 -0
- package/lib/reactive-react/hooks/useObserver.js +43 -0
- package/lib/reactive-react/index.d.ts +3 -0
- package/lib/reactive-react/index.js +25 -0
- package/lib/reactive-react/observer.d.ts +8 -0
- package/lib/reactive-react/observer.js +64 -0
- package/lib/reactive-react/shared/gc.d.ts +8 -0
- package/lib/reactive-react/shared/gc.js +59 -0
- package/lib/reactive-react/shared/global.d.ts +1 -0
- package/lib/reactive-react/shared/global.js +50 -0
- package/lib/reactive-react/shared/immediate.d.ts +1 -0
- package/lib/reactive-react/shared/immediate.js +40 -0
- package/lib/reactive-react/shared/index.d.ts +2 -0
- package/lib/reactive-react/shared/index.js +23 -0
- package/lib/reactive-react/types.d.ts +14 -0
- package/lib/reactive-react/types.js +15 -0
- package/lib/shared/array.d.ts +35 -0
- package/lib/shared/array.js +189 -0
- package/lib/shared/case.d.ts +6 -0
- package/lib/shared/case.js +39 -0
- package/lib/shared/checkers.d.ts +21 -0
- package/lib/shared/checkers.js +77 -0
- package/lib/shared/clone.d.ts +2 -0
- package/lib/shared/clone.js +97 -0
- package/lib/shared/compare.d.ts +1 -0
- package/lib/shared/compare.js +129 -0
- package/lib/shared/defaults.d.ts +6 -0
- package/lib/shared/defaults.js +63 -0
- package/lib/shared/deprecate.d.ts +1 -0
- package/lib/shared/deprecate.js +42 -0
- package/lib/shared/global.d.ts +1 -0
- package/lib/shared/global.js +50 -0
- package/lib/shared/index.d.ts +16 -0
- package/lib/shared/index.js +51 -0
- package/lib/shared/instanceof.d.ts +1 -0
- package/lib/shared/instanceof.js +36 -0
- package/lib/shared/isEmpty.d.ts +3 -0
- package/lib/shared/isEmpty.js +94 -0
- package/lib/shared/merge.d.ts +12 -0
- package/lib/shared/merge.js +214 -0
- package/lib/shared/middleware.d.ts +4 -0
- package/lib/shared/middleware.js +41 -0
- package/lib/shared/path.d.ts +3 -0
- package/lib/shared/path.js +27 -0
- package/lib/shared/string.d.ts +1 -0
- package/lib/shared/string.js +38 -0
- package/lib/shared/subscribable.d.ts +11 -0
- package/lib/shared/subscribable.js +74 -0
- package/lib/shared/uid.d.ts +1 -0
- package/lib/shared/uid.js +35 -0
- package/lib/validator/formats.d.ts +16 -0
- package/lib/validator/formats.js +40 -0
- package/lib/validator/index.d.ts +4 -0
- package/lib/validator/index.js +27 -0
- package/lib/validator/locale.d.ts +219 -0
- package/lib/validator/locale.js +240 -0
- package/lib/validator/parser.d.ts +5 -0
- package/lib/validator/parser.js +153 -0
- package/lib/validator/registry.d.ts +15 -0
- package/lib/validator/registry.js +116 -0
- package/lib/validator/rules.d.ts +3 -0
- package/lib/validator/rules.js +154 -0
- package/lib/validator/template.d.ts +2 -0
- package/lib/validator/template.js +42 -0
- package/lib/validator/types.d.ts +62 -0
- package/lib/validator/types.js +28 -0
- package/lib/validator/validator.d.ts +2 -0
- package/lib/validator/validator.js +63 -0
- package/package.json +16 -10
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var destructor_exports = {};
|
|
20
|
+
__export(destructor_exports, {
|
|
21
|
+
deleteInByDestructor: () => deleteInByDestructor,
|
|
22
|
+
existInByDestructor: () => existInByDestructor,
|
|
23
|
+
getDestructor: () => getDestructor,
|
|
24
|
+
getInByDestructor: () => getInByDestructor,
|
|
25
|
+
parseDestructorRules: () => parseDestructorRules,
|
|
26
|
+
setDestructor: () => setDestructor,
|
|
27
|
+
setInByDestructor: () => setInByDestructor
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(destructor_exports);
|
|
30
|
+
var import_shared = require("./shared");
|
|
31
|
+
var import_types = require("./types");
|
|
32
|
+
const DestructorCache = /* @__PURE__ */ new Map();
|
|
33
|
+
const isValid = /* @__PURE__ */ __name((val) => val !== void 0 && val !== null, "isValid");
|
|
34
|
+
const getDestructor = /* @__PURE__ */ __name((source) => {
|
|
35
|
+
return DestructorCache.get(source);
|
|
36
|
+
}, "getDestructor");
|
|
37
|
+
const setDestructor = /* @__PURE__ */ __name((source, rules) => {
|
|
38
|
+
DestructorCache.set(source, rules);
|
|
39
|
+
}, "setDestructor");
|
|
40
|
+
const parseDestructorRules = /* @__PURE__ */ __name((node) => {
|
|
41
|
+
const rules = [];
|
|
42
|
+
if ((0, import_types.isObjectPattern)(node)) {
|
|
43
|
+
let index = 0;
|
|
44
|
+
node.properties.forEach((child) => {
|
|
45
|
+
rules[index] = {
|
|
46
|
+
path: []
|
|
47
|
+
};
|
|
48
|
+
rules[index].key = child.key.value;
|
|
49
|
+
rules[index].path.push(child.key.value);
|
|
50
|
+
if ((0, import_types.isIdentifier)(child.value)) {
|
|
51
|
+
rules[index].key = child.value.value;
|
|
52
|
+
}
|
|
53
|
+
const basePath = rules[index].path;
|
|
54
|
+
const childRules = parseDestructorRules(child.value);
|
|
55
|
+
let k = index;
|
|
56
|
+
childRules.forEach((rule) => {
|
|
57
|
+
if (rules[k]) {
|
|
58
|
+
rules[k].key = rule.key;
|
|
59
|
+
rules[k].path = basePath.concat(rule.path);
|
|
60
|
+
} else {
|
|
61
|
+
rules[k] = {
|
|
62
|
+
key: rule.key,
|
|
63
|
+
path: basePath.concat(rule.path)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
k++;
|
|
67
|
+
});
|
|
68
|
+
if (k > index) {
|
|
69
|
+
index = k;
|
|
70
|
+
} else {
|
|
71
|
+
index++;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return rules;
|
|
75
|
+
} else if ((0, import_types.isArrayPattern)(node)) {
|
|
76
|
+
let index = 0;
|
|
77
|
+
node.elements.forEach((child, key) => {
|
|
78
|
+
rules[index] = {
|
|
79
|
+
path: []
|
|
80
|
+
};
|
|
81
|
+
rules[index].key = key;
|
|
82
|
+
rules[index].path.push(key);
|
|
83
|
+
if ((0, import_types.isIdentifier)(child)) {
|
|
84
|
+
rules[index].key = child.value;
|
|
85
|
+
}
|
|
86
|
+
const basePath = rules[index].path;
|
|
87
|
+
const childRules = parseDestructorRules(child);
|
|
88
|
+
let k = index;
|
|
89
|
+
childRules.forEach((rule) => {
|
|
90
|
+
if (rules[k]) {
|
|
91
|
+
rules[k].key = rule.key;
|
|
92
|
+
rules[k].path = basePath.concat(rule.path);
|
|
93
|
+
} else {
|
|
94
|
+
rules[k] = {
|
|
95
|
+
key: rule.key,
|
|
96
|
+
path: basePath.concat(rule.path)
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
k++;
|
|
100
|
+
});
|
|
101
|
+
if (k > index) {
|
|
102
|
+
index = k;
|
|
103
|
+
} else {
|
|
104
|
+
index++;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return rules;
|
|
108
|
+
}
|
|
109
|
+
if ((0, import_types.isDestructorExpression)(node)) {
|
|
110
|
+
return parseDestructorRules(node.value);
|
|
111
|
+
}
|
|
112
|
+
return rules;
|
|
113
|
+
}, "parseDestructorRules");
|
|
114
|
+
const setInByDestructor = /* @__PURE__ */ __name((source, rules, value, mutators) => {
|
|
115
|
+
rules.forEach(({ key, path }) => {
|
|
116
|
+
mutators.setIn([key], source, mutators.getIn(path, value));
|
|
117
|
+
});
|
|
118
|
+
}, "setInByDestructor");
|
|
119
|
+
const getInByDestructor = /* @__PURE__ */ __name((source, rules, mutators) => {
|
|
120
|
+
let response = {};
|
|
121
|
+
if (rules.length) {
|
|
122
|
+
if ((0, import_shared.isNum)(rules[0].path[0])) {
|
|
123
|
+
response = [];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
source = isValid(source) ? source : {};
|
|
127
|
+
rules.forEach(({ key, path }) => {
|
|
128
|
+
mutators.setIn(path, response, source[key]);
|
|
129
|
+
});
|
|
130
|
+
return response;
|
|
131
|
+
}, "getInByDestructor");
|
|
132
|
+
const deleteInByDestructor = /* @__PURE__ */ __name((source, rules, mutators) => {
|
|
133
|
+
rules.forEach(({ key }) => {
|
|
134
|
+
mutators.deleteIn([key], source);
|
|
135
|
+
});
|
|
136
|
+
}, "deleteInByDestructor");
|
|
137
|
+
const existInByDestructor = /* @__PURE__ */ __name((source, rules, start, mutators) => {
|
|
138
|
+
return rules.every(({ key }) => {
|
|
139
|
+
return mutators.existIn([key], source, start);
|
|
140
|
+
});
|
|
141
|
+
}, "existInByDestructor");
|
|
142
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
143
|
+
0 && (module.exports = {
|
|
144
|
+
deleteInByDestructor,
|
|
145
|
+
existInByDestructor,
|
|
146
|
+
getDestructor,
|
|
147
|
+
getInByDestructor,
|
|
148
|
+
parseDestructorRules,
|
|
149
|
+
setDestructor,
|
|
150
|
+
setInByDestructor
|
|
151
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Node, Pattern, Segments } from './types';
|
|
2
|
+
declare const isMatcher: unique symbol;
|
|
3
|
+
export declare class Path {
|
|
4
|
+
entire: string | RegExp;
|
|
5
|
+
segments: Segments;
|
|
6
|
+
isMatchPattern: boolean;
|
|
7
|
+
isWildMatchPattern: boolean;
|
|
8
|
+
isRegExp: boolean;
|
|
9
|
+
haveRelativePattern: boolean;
|
|
10
|
+
haveExcludePattern: boolean;
|
|
11
|
+
matchScore: number;
|
|
12
|
+
tree: Node;
|
|
13
|
+
private matchCache;
|
|
14
|
+
private includesCache;
|
|
15
|
+
constructor(input: Pattern, base?: Pattern);
|
|
16
|
+
toString(): string;
|
|
17
|
+
toArr(): (string | number)[];
|
|
18
|
+
get length(): number;
|
|
19
|
+
concat: (...args: Pattern[]) => Path;
|
|
20
|
+
slice: (start?: number, end?: number) => Path;
|
|
21
|
+
push: (...items: Pattern[]) => Path;
|
|
22
|
+
pop: () => Path;
|
|
23
|
+
splice: (start: number, deleteCount?: number, ...items: Array<string | number>) => Path;
|
|
24
|
+
forEach: (callback: (key: string | number) => any) => void;
|
|
25
|
+
map: (callback: (key: string | number) => any) => any[];
|
|
26
|
+
reduce: <T>(callback: (buf: T, item: string | number, index: number) => T, initial: T) => T;
|
|
27
|
+
parent: () => Path;
|
|
28
|
+
includes: (pattern: Pattern) => any;
|
|
29
|
+
transform: <T>(regexp: string | RegExp, callback: (...args: string[]) => T) => T | string;
|
|
30
|
+
match: (pattern: Pattern) => boolean;
|
|
31
|
+
matchAliasGroup: (name: Pattern, alias: Pattern) => boolean;
|
|
32
|
+
existIn: (source?: any, start?: number | Path) => any;
|
|
33
|
+
getIn: (source?: any) => any;
|
|
34
|
+
setIn: (source?: any, value?: any) => any;
|
|
35
|
+
deleteIn: (source?: any) => any;
|
|
36
|
+
ensureIn: (source?: any, defaults?: any) => any;
|
|
37
|
+
static match(pattern: Pattern): {
|
|
38
|
+
(target: any): boolean;
|
|
39
|
+
path: Path;
|
|
40
|
+
[isMatcher]: boolean;
|
|
41
|
+
};
|
|
42
|
+
static isPathPattern(target: any): target is Pattern;
|
|
43
|
+
static transform<T>(pattern: Pattern, regexp: string | RegExp, callback: (...args: string[]) => T): any;
|
|
44
|
+
static parse(path?: Pattern, base?: Pattern): Path;
|
|
45
|
+
static getIn: (source: any, pattern: Pattern) => any;
|
|
46
|
+
static setIn: (source: any, pattern: Pattern, value: any) => any;
|
|
47
|
+
static deleteIn: (source: any, pattern: Pattern) => any;
|
|
48
|
+
static existIn: (source: any, pattern: Pattern, start?: number | Path) => any;
|
|
49
|
+
static ensureIn: (source: any, pattern: Pattern, defaultValue?: any) => any;
|
|
50
|
+
}
|
|
51
|
+
export { type Pattern };
|