@mnaoumov/obsidian-lib 2.0.0 → 3.0.0
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/dist/lib/cjs/dataview.cjs +1 -1
- package/dist/lib/cjs/dataview.d.cts +9 -3
- package/dist/lib/cjs/generated-during-build.cjs +1 -1
- package/dist/lib/esm/dataview.d.mts +9 -3
- package/dist/lib/esm/dataview.mjs +1 -1
- package/dist/lib/esm/generated-during-build.mjs +1 -1
- package/package.json +4 -135
- package/@types/dataview/api/data-array/package.json +0 -4
- package/@types/dataview/api/extensions/package.json +0 -4
- package/@types/dataview/api/inline-api/package.json +0 -4
- package/@types/dataview/api/plugin-api/package.json +0 -4
- package/@types/dataview/api/result/package.json +0 -4
- package/@types/dataview/data-import/common/package.json +0 -4
- package/@types/dataview/data-import/csv/package.json +0 -4
- package/@types/dataview/data-import/inline-field/package.json +0 -4
- package/@types/dataview/data-import/markdown-file/package.json +0 -4
- package/@types/dataview/data-import/persister/package.json +0 -4
- package/@types/dataview/data-import/web-worker/import-entry/package.json +0 -4
- package/@types/dataview/data-import/web-worker/import-impl/package.json +0 -4
- package/@types/dataview/data-import/web-worker/import-manager/package.json +0 -4
- package/@types/dataview/data-index/index/package.json +0 -4
- package/@types/dataview/data-index/package.json +0 -4
- package/@types/dataview/data-index/resolver/package.json +0 -4
- package/@types/dataview/data-index/source/package.json +0 -4
- package/@types/dataview/data-model/markdown/package.json +0 -4
- package/@types/dataview/data-model/serialized/markdown/package.json +0 -4
- package/@types/dataview/data-model/transferable/package.json +0 -4
- package/@types/dataview/data-model/value/package.json +0 -4
- package/@types/dataview/expression/binaryop/package.json +0 -4
- package/@types/dataview/expression/context/package.json +0 -4
- package/@types/dataview/expression/field/package.json +0 -4
- package/@types/dataview/expression/functions/package.json +0 -4
- package/@types/dataview/expression/parse/package.json +0 -4
- package/@types/dataview/index/package.json +0 -4
- package/@types/dataview/main/package.json +0 -4
- package/@types/dataview/package.json +0 -4
- package/@types/dataview/query/engine/package.json +0 -4
- package/@types/dataview/query/parse/package.json +0 -4
- package/@types/dataview/query/query/package.json +0 -4
- package/@types/dataview/settings/package.json +0 -4
- package/@types/dataview/typings/obsidian-ex/package.json +0 -4
- package/@types/dataview/typings/workers/package.json +0 -4
- package/@types/dataview/ui/export/markdown/package.json +0 -4
- package/@types/dataview/ui/lp-render/package.json +0 -4
- package/@types/dataview/ui/markdown/package.json +0 -4
- package/@types/dataview/ui/refreshable-view/package.json +0 -4
- package/@types/dataview/ui/render/package.json +0 -4
- package/@types/dataview/ui/views/calendar-view/package.json +0 -4
- package/@types/dataview/ui/views/inline-field-live-preview/package.json +0 -4
- package/@types/dataview/ui/views/inline-view/package.json +0 -4
- package/@types/dataview/ui/views/js-view/package.json +0 -4
- package/@types/dataview/ui/views/list-view/package.json +0 -4
- package/@types/dataview/ui/views/table-view/package.json +0 -4
- package/@types/dataview/ui/views/task-view/package.json +0 -4
- package/@types/dataview/util/hash/package.json +0 -4
- package/@types/dataview/util/locale/package.json +0 -4
- package/@types/dataview/util/media/package.json +0 -4
- package/@types/dataview/util/normalize/package.json +0 -4
- package/dist/lib/cjs/@types/dataview/api/data-array.d.cts +0 -137
- package/dist/lib/cjs/@types/dataview/api/extensions.d.cts +0 -16
- package/dist/lib/cjs/@types/dataview/api/inline-api.d.cts +0 -187
- package/dist/lib/cjs/@types/dataview/api/plugin-api.d.cts +0 -210
- package/dist/lib/cjs/@types/dataview/api/result.d.cts +0 -39
- package/dist/lib/cjs/@types/dataview/data-import/common.d.cts +0 -4
- package/dist/lib/cjs/@types/dataview/data-import/csv.d.cts +0 -4
- package/dist/lib/cjs/@types/dataview/data-import/inline-field.d.cts +0 -43
- package/dist/lib/cjs/@types/dataview/data-import/markdown-file.d.cts +0 -53
- package/dist/lib/cjs/@types/dataview/data-import/persister.d.cts +0 -33
- package/dist/lib/cjs/@types/dataview/data-import/web-worker/import-entry.d.cts +0 -2
- package/dist/lib/cjs/@types/dataview/data-import/web-worker/import-impl.d.cts +0 -7
- package/dist/lib/cjs/@types/dataview/data-import/web-worker/import-manager.d.cts +0 -38
- package/dist/lib/cjs/@types/dataview/data-index/index.d.cts +0 -187
- package/dist/lib/cjs/@types/dataview/data-index/resolver.d.cts +0 -24
- package/dist/lib/cjs/@types/dataview/data-index/source.d.cts +0 -72
- package/dist/lib/cjs/@types/dataview/data-model/markdown.d.cts +0 -116
- package/dist/lib/cjs/@types/dataview/data-model/serialized/markdown.d.cts +0 -107
- package/dist/lib/cjs/@types/dataview/data-model/transferable.d.cts +0 -8
- package/dist/lib/cjs/@types/dataview/data-model/value.d.cts +0 -176
- package/dist/lib/cjs/@types/dataview/expression/binaryop.d.cts +0 -44
- package/dist/lib/cjs/@types/dataview/expression/context.d.cts +0 -50
- package/dist/lib/cjs/@types/dataview/expression/field.d.cts +0 -83
- package/dist/lib/cjs/@types/dataview/expression/functions.d.cts +0 -150
- package/dist/lib/cjs/@types/dataview/expression/parse.d.cts +0 -164
- package/dist/lib/cjs/@types/dataview/index.d.cts +0 -56
- package/dist/lib/cjs/@types/dataview/main.d.cts +0 -53
- package/dist/lib/cjs/@types/dataview/query/engine.d.cts +0 -104
- package/dist/lib/cjs/@types/dataview/query/parse.d.cts +0 -45
- package/dist/lib/cjs/@types/dataview/query/query.d.cts +0 -96
- package/dist/lib/cjs/@types/dataview/settings.d.cts +0 -61
- package/dist/lib/cjs/@types/dataview/typings/obsidian-ex.d.cts +0 -29
- package/dist/lib/cjs/@types/dataview/typings/workers.d.cts +0 -5
- package/dist/lib/cjs/@types/dataview/ui/export/markdown.d.cts +0 -16
- package/dist/lib/cjs/@types/dataview/ui/lp-render.d.cts +0 -38
- package/dist/lib/cjs/@types/dataview/ui/markdown.d.cts +0 -87
- package/dist/lib/cjs/@types/dataview/ui/refreshable-view.d.cts +0 -19
- package/dist/lib/cjs/@types/dataview/ui/render.d.cts +0 -34
- package/dist/lib/cjs/@types/dataview/ui/views/calendar-view.d.cts +0 -18
- package/dist/lib/cjs/@types/dataview/ui/views/inline-field-live-preview.d.cts +0 -43
- package/dist/lib/cjs/@types/dataview/ui/views/inline-view.d.cts +0 -29
- package/dist/lib/cjs/@types/dataview/ui/views/js-view.d.cts +0 -24
- package/dist/lib/cjs/@types/dataview/ui/views/list-view.d.cts +0 -26
- package/dist/lib/cjs/@types/dataview/ui/views/table-view.d.cts +0 -29
- package/dist/lib/cjs/@types/dataview/ui/views/task-view.d.cts +0 -52
- package/dist/lib/cjs/@types/dataview/util/hash.d.cts +0 -2
- package/dist/lib/cjs/@types/dataview/util/locale.d.cts +0 -3
- package/dist/lib/cjs/@types/dataview/util/media.d.cts +0 -7
- package/dist/lib/cjs/@types/dataview/util/normalize.d.cts +0 -45
- package/dist/lib/esm/@types/dataview/api/data-array.d.mts +0 -137
- package/dist/lib/esm/@types/dataview/api/extensions.d.mts +0 -16
- package/dist/lib/esm/@types/dataview/api/inline-api.d.mts +0 -187
- package/dist/lib/esm/@types/dataview/api/plugin-api.d.mts +0 -210
- package/dist/lib/esm/@types/dataview/api/result.d.mts +0 -39
- package/dist/lib/esm/@types/dataview/data-import/common.d.mts +0 -4
- package/dist/lib/esm/@types/dataview/data-import/csv.d.mts +0 -4
- package/dist/lib/esm/@types/dataview/data-import/inline-field.d.mts +0 -43
- package/dist/lib/esm/@types/dataview/data-import/markdown-file.d.mts +0 -53
- package/dist/lib/esm/@types/dataview/data-import/persister.d.mts +0 -33
- package/dist/lib/esm/@types/dataview/data-import/web-worker/import-entry.d.mts +0 -2
- package/dist/lib/esm/@types/dataview/data-import/web-worker/import-impl.d.mts +0 -7
- package/dist/lib/esm/@types/dataview/data-import/web-worker/import-manager.d.mts +0 -38
- package/dist/lib/esm/@types/dataview/data-index/index.d.mts +0 -187
- package/dist/lib/esm/@types/dataview/data-index/resolver.d.mts +0 -24
- package/dist/lib/esm/@types/dataview/data-index/source.d.mts +0 -72
- package/dist/lib/esm/@types/dataview/data-model/markdown.d.mts +0 -116
- package/dist/lib/esm/@types/dataview/data-model/serialized/markdown.d.mts +0 -107
- package/dist/lib/esm/@types/dataview/data-model/transferable.d.mts +0 -8
- package/dist/lib/esm/@types/dataview/data-model/value.d.mts +0 -176
- package/dist/lib/esm/@types/dataview/expression/binaryop.d.mts +0 -44
- package/dist/lib/esm/@types/dataview/expression/context.d.mts +0 -50
- package/dist/lib/esm/@types/dataview/expression/field.d.mts +0 -83
- package/dist/lib/esm/@types/dataview/expression/functions.d.mts +0 -150
- package/dist/lib/esm/@types/dataview/expression/parse.d.mts +0 -164
- package/dist/lib/esm/@types/dataview/index.d.mts +0 -56
- package/dist/lib/esm/@types/dataview/main.d.mts +0 -53
- package/dist/lib/esm/@types/dataview/query/engine.d.mts +0 -104
- package/dist/lib/esm/@types/dataview/query/parse.d.mts +0 -45
- package/dist/lib/esm/@types/dataview/query/query.d.mts +0 -96
- package/dist/lib/esm/@types/dataview/settings.d.mts +0 -61
- package/dist/lib/esm/@types/dataview/typings/obsidian-ex.d.mts +0 -29
- package/dist/lib/esm/@types/dataview/typings/workers.d.mts +0 -5
- package/dist/lib/esm/@types/dataview/ui/export/markdown.d.mts +0 -16
- package/dist/lib/esm/@types/dataview/ui/lp-render.d.mts +0 -38
- package/dist/lib/esm/@types/dataview/ui/markdown.d.mts +0 -87
- package/dist/lib/esm/@types/dataview/ui/refreshable-view.d.mts +0 -19
- package/dist/lib/esm/@types/dataview/ui/render.d.mts +0 -34
- package/dist/lib/esm/@types/dataview/ui/views/calendar-view.d.mts +0 -18
- package/dist/lib/esm/@types/dataview/ui/views/inline-field-live-preview.d.mts +0 -43
- package/dist/lib/esm/@types/dataview/ui/views/inline-view.d.mts +0 -29
- package/dist/lib/esm/@types/dataview/ui/views/js-view.d.mts +0 -24
- package/dist/lib/esm/@types/dataview/ui/views/list-view.d.mts +0 -26
- package/dist/lib/esm/@types/dataview/ui/views/table-view.d.mts +0 -29
- package/dist/lib/esm/@types/dataview/ui/views/task-view.d.mts +0 -52
- package/dist/lib/esm/@types/dataview/util/hash.d.mts +0 -2
- package/dist/lib/esm/@types/dataview/util/locale.d.mts +0 -3
- package/dist/lib/esm/@types/dataview/util/media.d.mts +0 -7
- package/dist/lib/esm/@types/dataview/util/normalize.d.mts +0 -45
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mnaoumov/obsidian-lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Runtime library for Obsidian plugin development: plugin base classes, components, settings, modals, vault and metadata helpers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"obsidian",
|
|
@@ -46,134 +46,6 @@
|
|
|
46
46
|
"types": "./dist/lib/cjs/@types/*.d.cts"
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
"./@types/dataview": {
|
|
50
|
-
"import": {
|
|
51
|
-
"types": "./dist/lib/esm/@types/dataview/index.d.mts"
|
|
52
|
-
},
|
|
53
|
-
"require": {
|
|
54
|
-
"types": "./dist/lib/cjs/@types/dataview/index.d.cts"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"./@types/dataview/*": {
|
|
58
|
-
"import": {
|
|
59
|
-
"types": "./dist/lib/esm/@types/dataview/*.d.mts"
|
|
60
|
-
},
|
|
61
|
-
"require": {
|
|
62
|
-
"types": "./dist/lib/cjs/@types/dataview/*.d.cts"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"./@types/dataview/api/*": {
|
|
66
|
-
"import": {
|
|
67
|
-
"types": "./dist/lib/esm/@types/dataview/api/*.d.mts"
|
|
68
|
-
},
|
|
69
|
-
"require": {
|
|
70
|
-
"types": "./dist/lib/cjs/@types/dataview/api/*.d.cts"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"./@types/dataview/data-import/*": {
|
|
74
|
-
"import": {
|
|
75
|
-
"types": "./dist/lib/esm/@types/dataview/data-import/*.d.mts"
|
|
76
|
-
},
|
|
77
|
-
"require": {
|
|
78
|
-
"types": "./dist/lib/cjs/@types/dataview/data-import/*.d.cts"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"./@types/dataview/data-import/web-worker/*": {
|
|
82
|
-
"import": {
|
|
83
|
-
"types": "./dist/lib/esm/@types/dataview/data-import/web-worker/*.d.mts"
|
|
84
|
-
},
|
|
85
|
-
"require": {
|
|
86
|
-
"types": "./dist/lib/cjs/@types/dataview/data-import/web-worker/*.d.cts"
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
"./@types/dataview/data-index": {
|
|
90
|
-
"import": {
|
|
91
|
-
"types": "./dist/lib/esm/@types/dataview/data-index/index.d.mts"
|
|
92
|
-
},
|
|
93
|
-
"require": {
|
|
94
|
-
"types": "./dist/lib/cjs/@types/dataview/data-index/index.d.cts"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
"./@types/dataview/data-index/*": {
|
|
98
|
-
"import": {
|
|
99
|
-
"types": "./dist/lib/esm/@types/dataview/data-index/*.d.mts"
|
|
100
|
-
},
|
|
101
|
-
"require": {
|
|
102
|
-
"types": "./dist/lib/cjs/@types/dataview/data-index/*.d.cts"
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"./@types/dataview/data-model/*": {
|
|
106
|
-
"import": {
|
|
107
|
-
"types": "./dist/lib/esm/@types/dataview/data-model/*.d.mts"
|
|
108
|
-
},
|
|
109
|
-
"require": {
|
|
110
|
-
"types": "./dist/lib/cjs/@types/dataview/data-model/*.d.cts"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"./@types/dataview/data-model/serialized/*": {
|
|
114
|
-
"import": {
|
|
115
|
-
"types": "./dist/lib/esm/@types/dataview/data-model/serialized/*.d.mts"
|
|
116
|
-
},
|
|
117
|
-
"require": {
|
|
118
|
-
"types": "./dist/lib/cjs/@types/dataview/data-model/serialized/*.d.cts"
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"./@types/dataview/expression/*": {
|
|
122
|
-
"import": {
|
|
123
|
-
"types": "./dist/lib/esm/@types/dataview/expression/*.d.mts"
|
|
124
|
-
},
|
|
125
|
-
"require": {
|
|
126
|
-
"types": "./dist/lib/cjs/@types/dataview/expression/*.d.cts"
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
"./@types/dataview/query/*": {
|
|
130
|
-
"import": {
|
|
131
|
-
"types": "./dist/lib/esm/@types/dataview/query/*.d.mts"
|
|
132
|
-
},
|
|
133
|
-
"require": {
|
|
134
|
-
"types": "./dist/lib/cjs/@types/dataview/query/*.d.cts"
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
"./@types/dataview/typings/*": {
|
|
138
|
-
"import": {
|
|
139
|
-
"types": "./dist/lib/esm/@types/dataview/typings/*.d.mts"
|
|
140
|
-
},
|
|
141
|
-
"require": {
|
|
142
|
-
"types": "./dist/lib/cjs/@types/dataview/typings/*.d.cts"
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
"./@types/dataview/ui/*": {
|
|
146
|
-
"import": {
|
|
147
|
-
"types": "./dist/lib/esm/@types/dataview/ui/*.d.mts"
|
|
148
|
-
},
|
|
149
|
-
"require": {
|
|
150
|
-
"types": "./dist/lib/cjs/@types/dataview/ui/*.d.cts"
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
"./@types/dataview/ui/export/*": {
|
|
154
|
-
"import": {
|
|
155
|
-
"types": "./dist/lib/esm/@types/dataview/ui/export/*.d.mts"
|
|
156
|
-
},
|
|
157
|
-
"require": {
|
|
158
|
-
"types": "./dist/lib/cjs/@types/dataview/ui/export/*.d.cts"
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
"./@types/dataview/ui/views/*": {
|
|
162
|
-
"import": {
|
|
163
|
-
"types": "./dist/lib/esm/@types/dataview/ui/views/*.d.mts"
|
|
164
|
-
},
|
|
165
|
-
"require": {
|
|
166
|
-
"types": "./dist/lib/cjs/@types/dataview/ui/views/*.d.cts"
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
"./@types/dataview/util/*": {
|
|
170
|
-
"import": {
|
|
171
|
-
"types": "./dist/lib/esm/@types/dataview/util/*.d.mts"
|
|
172
|
-
},
|
|
173
|
-
"require": {
|
|
174
|
-
"types": "./dist/lib/cjs/@types/dataview/util/*.d.cts"
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
49
|
"./codemirror": {
|
|
178
50
|
"import": {
|
|
179
51
|
"types": "./dist/lib/esm/codemirror/index.d.mts",
|
|
@@ -458,18 +330,15 @@
|
|
|
458
330
|
"@codemirror/state": "6.7.6",
|
|
459
331
|
"@codemirror/view": "6.43.13",
|
|
460
332
|
"@lezer/common": "1.5.2",
|
|
333
|
+
"@mnaoumov/obsidian-dataview": "^1.0.0",
|
|
461
334
|
"@mnaoumov/typescript-lib": "^1.0.0",
|
|
462
335
|
"@obsidian-typings/obsidian-public-latest": "^6.37.0",
|
|
463
336
|
"@standard-schema/spec": "^1.1.0",
|
|
464
|
-
"@types/luxon": "^3.7.5",
|
|
465
|
-
"@types/parsimmon": "^1.10.9",
|
|
466
337
|
"@types/react": "^19.3.0",
|
|
467
338
|
"compare-versions": "^6.1.1",
|
|
468
339
|
"i18next": "^26.4.2",
|
|
469
|
-
"localforage": "^1.10.0",
|
|
470
340
|
"monkey-around": "^3.0.0",
|
|
471
341
|
"obsidian": "^1.14.4",
|
|
472
|
-
"preact": "^10.29.8",
|
|
473
342
|
"react": "^19.3.0",
|
|
474
343
|
"remark": "^15.0.1",
|
|
475
344
|
"remark-parse": "^11.0.0",
|
|
@@ -498,6 +367,7 @@
|
|
|
498
367
|
"esbuild": "^0.28.2",
|
|
499
368
|
"eslint": "^10.11.0",
|
|
500
369
|
"eslint-plugin-jsdoc": "^64.5.4",
|
|
370
|
+
"eslint-plugin-obsidianmd": "^0.4.2",
|
|
501
371
|
"eslint-plugin-tsdoc": "^0.5.3",
|
|
502
372
|
"fflate": "^0.8.3",
|
|
503
373
|
"husky": "^9.1.7",
|
|
@@ -511,8 +381,7 @@
|
|
|
511
381
|
"sass": "^1.104.1",
|
|
512
382
|
"tslib": "^2.8.1",
|
|
513
383
|
"typescript": "6.0.3",
|
|
514
|
-
"vitest": "^5.0.1"
|
|
515
|
-
"eslint-plugin-obsidianmd": "^0.4.2"
|
|
384
|
+
"vitest": "^5.0.1"
|
|
516
385
|
},
|
|
517
386
|
"engines": {
|
|
518
387
|
"node": ">=22.0.0"
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../library.d.cts" />
|
|
2
|
-
import type { QuerySettings } from '../settings.d.cjs';
|
|
3
|
-
/** A function which maps an array element to some value. */
|
|
4
|
-
export type ArrayFunc<T, O> = (elem: T, index: number, arr: T[]) => O;
|
|
5
|
-
/** A function which compares two types. */
|
|
6
|
-
export type ArrayComparator<T> = (a: T, b: T) => number;
|
|
7
|
-
/** Finds the value of the lowest value type in a grouping. */
|
|
8
|
-
export type LowestKey<T> = T extends {
|
|
9
|
-
key: any;
|
|
10
|
-
rows: any;
|
|
11
|
-
} ? LowestKey<T['rows'][0]>
|
|
12
|
-
: T;
|
|
13
|
-
/** A ridiculous type which properly types the result of the 'groupIn' command. */
|
|
14
|
-
export type Ingrouped<U, T> = T extends {
|
|
15
|
-
key: any;
|
|
16
|
-
rows: any;
|
|
17
|
-
} ? {
|
|
18
|
-
key: T['key'];
|
|
19
|
-
rows: Ingrouped<U, T['rows'][0]>;
|
|
20
|
-
}
|
|
21
|
-
: {
|
|
22
|
-
key: U;
|
|
23
|
-
rows: T[];
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Proxied interface which allows manipulating array-based data. All functions on a data array produce a NEW array
|
|
27
|
-
* (i.e., the arrays are immutable).
|
|
28
|
-
*/
|
|
29
|
-
export interface DataArray<T> {
|
|
30
|
-
/** The total number of elements in the array. */
|
|
31
|
-
length: number;
|
|
32
|
-
/** Filter the data array down to just elements which match the given predicate. */
|
|
33
|
-
where(predicate: ArrayFunc<T, boolean>): DataArray<T>;
|
|
34
|
-
/** Alias for 'where' for people who want array semantics. */
|
|
35
|
-
filter(predicate: ArrayFunc<T, boolean>): DataArray<T>;
|
|
36
|
-
/** Map elements in the data array by applying a function to each. */
|
|
37
|
-
map<U>(f: ArrayFunc<T, U>): DataArray<U>;
|
|
38
|
-
/** Map elements in the data array by applying a function to each, then flatten the results to produce a new array. */
|
|
39
|
-
flatMap<U>(f: ArrayFunc<T, U[]>): DataArray<U>;
|
|
40
|
-
/** Mutably change each value in the array, returning the same array which you can further chain off of. */
|
|
41
|
-
mutate(f: ArrayFunc<T, void>): DataArray<T>;
|
|
42
|
-
/** Limit the total number of entries in the array to the given value. */
|
|
43
|
-
limit(count: number): DataArray<T>;
|
|
44
|
-
/**
|
|
45
|
-
* Take a slice of the array. If `start` is undefined, it is assumed to be 0; if `end` is undefined, it is assumed
|
|
46
|
-
* to be the end of the array.
|
|
47
|
-
*/
|
|
48
|
-
slice(start?: number, end?: number): DataArray<T>;
|
|
49
|
-
/** Concatenate the values in this data array with those of another iterable / data array / array. */
|
|
50
|
-
concat(other: Iterable<T>): DataArray<T>;
|
|
51
|
-
/** Return the first index of the given (optionally starting the search) */
|
|
52
|
-
indexOf(element: T, fromIndex?: number): number;
|
|
53
|
-
/** Return the first element that satisfies the given predicate. */
|
|
54
|
-
find(pred: ArrayFunc<T, boolean>): T | undefined;
|
|
55
|
-
/** Find the index of the first element that satisfies the given predicate. Returns -1 if nothing was found. */
|
|
56
|
-
findIndex(pred: ArrayFunc<T, boolean>, fromIndex?: number): number;
|
|
57
|
-
/** Returns true if the array contains the given element, and false otherwise. */
|
|
58
|
-
includes(element: T): boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Return a string obtained by converting each element in the array to a string, and joining it with the
|
|
61
|
-
* given separator (which defaults to ', ').
|
|
62
|
-
*/
|
|
63
|
-
join(sep?: string): string;
|
|
64
|
-
/**
|
|
65
|
-
* Return a sorted array sorted by the given key; an optional comparator can be provided, which will
|
|
66
|
-
* be used to compare the keys in lieu of the default dataview comparator.
|
|
67
|
-
*/
|
|
68
|
-
sort<U>(key: ArrayFunc<T, U>, direction?: 'asc' | 'desc', comparator?: ArrayComparator<U>): DataArray<T>;
|
|
69
|
-
/**
|
|
70
|
-
* Mutably modify the current array with an in place sort; this is less flexible than a regular sort in exchange
|
|
71
|
-
* for being a little more performant. Only use this is performance is a serious consideration.
|
|
72
|
-
*/
|
|
73
|
-
sortInPlace<U>(key: (v: T) => U, direction?: 'asc' | 'desc', comparator?: ArrayComparator<U>): DataArray<T>;
|
|
74
|
-
/**
|
|
75
|
-
* Return an array where elements are grouped by the given key; the resulting array will have objects of the form
|
|
76
|
-
* { key: <key value>, rows: DataArray }.
|
|
77
|
-
*/
|
|
78
|
-
groupBy<U>(key: ArrayFunc<T, U>, comparator?: ArrayComparator<U>): DataArray<{
|
|
79
|
-
key: U;
|
|
80
|
-
rows: DataArray<T>;
|
|
81
|
-
}>;
|
|
82
|
-
/**
|
|
83
|
-
* If the array is not grouped, groups it as `groupBy` does; otherwise, groups the elements inside each current
|
|
84
|
-
* group. This allows for top-down recursive grouping which may be easier than bottom-up grouping.
|
|
85
|
-
*/
|
|
86
|
-
groupIn<U>(key: ArrayFunc<LowestKey<T>, U>, comparator?: ArrayComparator<U>): DataArray<Ingrouped<U, T>>;
|
|
87
|
-
/**
|
|
88
|
-
* Return distinct entries. If a key is provided, then rows with distinct keys are returned.
|
|
89
|
-
*/
|
|
90
|
-
distinct<U>(key?: ArrayFunc<T, U>, comparator?: ArrayComparator<U>): DataArray<T>;
|
|
91
|
-
/** Return true if the predicate is true for all values. */
|
|
92
|
-
every(f: ArrayFunc<T, boolean>): boolean;
|
|
93
|
-
/** Return true if the predicate is true for at least one value. */
|
|
94
|
-
some(f: ArrayFunc<T, boolean>): boolean;
|
|
95
|
-
/** Return true if the predicate is FALSE for all values. */
|
|
96
|
-
none(f: ArrayFunc<T, boolean>): boolean;
|
|
97
|
-
/** Return the first element in the data array. Returns undefined if the array is empty. */
|
|
98
|
-
first(): T;
|
|
99
|
-
/** Return the last element in the data array. Returns undefined if the array is empty. */
|
|
100
|
-
last(): T;
|
|
101
|
-
/** Map every element in this data array to the given key, and then flatten it.*/
|
|
102
|
-
to(key: string): DataArray<any>;
|
|
103
|
-
/** Map every element in this data array to the given key; unlike to(), does not flatten the result. */
|
|
104
|
-
into(key: string): DataArray<any>;
|
|
105
|
-
/**
|
|
106
|
-
* Recursively expand the given key, flattening a tree structure based on the key into a flat array. Useful for handling
|
|
107
|
-
* hierarchical data like tasks with 'subtasks'.
|
|
108
|
-
*/
|
|
109
|
-
expand(key: string): DataArray<any>;
|
|
110
|
-
/** Run a lambda on each element in the array. */
|
|
111
|
-
forEach(f: ArrayFunc<T, void>): void;
|
|
112
|
-
/** Calculate the sum of the elements in the array. */
|
|
113
|
-
sum(): number;
|
|
114
|
-
/** Calculate the average of the elements in the array. */
|
|
115
|
-
avg(): number;
|
|
116
|
-
/** Calculate the minimum of the elements in the array. */
|
|
117
|
-
min(): number;
|
|
118
|
-
/** Calculate the maximum of the elements in the array. */
|
|
119
|
-
max(): number;
|
|
120
|
-
/** Convert this to a plain javascript array. */
|
|
121
|
-
array(): T[];
|
|
122
|
-
/** Allow iterating directly over the array. */
|
|
123
|
-
[Symbol.iterator](): Iterator<T>;
|
|
124
|
-
/** Map indexes to values. */
|
|
125
|
-
[index: number]: any;
|
|
126
|
-
/** Automatic flattening of fields. Equivalent to implicitly calling `array.to("field")` */
|
|
127
|
-
[field: string]: any;
|
|
128
|
-
}
|
|
129
|
-
/** Provides utility functions for generating data arrays. */
|
|
130
|
-
export declare namespace DataArray {
|
|
131
|
-
/** Create a new Dataview data array. */
|
|
132
|
-
function wrap<T>(raw: T[] | DataArray<T>, settings: QuerySettings): DataArray<T>;
|
|
133
|
-
/** Create a new DataArray from an iterable object. */
|
|
134
|
-
function from<T>(raw: Iterable<T>, settings: QuerySettings): DataArray<T>;
|
|
135
|
-
/** Return true if the given object is a data array. */
|
|
136
|
-
function isDataArray(obj: any): obj is DataArray<any>;
|
|
137
|
-
}
|