@modelform/react-native 0.3.0 → 0.5.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/{chunk-PU7RRUV4.mjs → chunk-5SGVTAFJ.mjs} +404 -88
- package/dist/{chunk-HZEXKGDS.js → chunk-5UE6Q6CQ.js} +404 -88
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +26 -2
- package/dist/core/index.mjs +25 -1
- package/dist/core/layoutEdit.d.ts +3 -3
- package/dist/core/snippets.d.ts +68 -0
- package/dist/core/templates.d.ts +74 -0
- package/dist/index.js +158 -134
- package/dist/index.mjs +25 -1
- package/package.json +1 -1
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -195,7 +195,6 @@
|
|
|
195
195
|
|
|
196
196
|
|
|
197
197
|
|
|
198
|
-
var _chunkHZEXKGDSjs = require('../chunk-HZEXKGDS.js');
|
|
199
198
|
|
|
200
199
|
|
|
201
200
|
|
|
@@ -208,6 +207,7 @@ var _chunkHZEXKGDSjs = require('../chunk-HZEXKGDS.js');
|
|
|
208
207
|
|
|
209
208
|
|
|
210
209
|
|
|
210
|
+
var _chunk5UE6Q6CQjs = require('../chunk-5UE6Q6CQ.js');
|
|
211
211
|
|
|
212
212
|
|
|
213
213
|
|
|
@@ -393,4 +393,28 @@ var _chunkHZEXKGDSjs = require('../chunk-HZEXKGDS.js');
|
|
|
393
393
|
|
|
394
394
|
|
|
395
395
|
|
|
396
|
-
exports.ALL = _chunkHZEXKGDSjs.ALL; exports.BUNDLE_ACCEPT = _chunkHZEXKGDSjs.BUNDLE_ACCEPT; exports.BUNDLE_TYPE = _chunkHZEXKGDSjs.BUNDLE_TYPE; exports.CANVAS_GAP = _chunkHZEXKGDSjs.CANVAS_GAP; exports.CANVAS_ROW_HEADER = _chunkHZEXKGDSjs.CANVAS_ROW_HEADER; exports.ConfigLoader = _chunkHZEXKGDSjs.ConfigLoader; exports.DASHBOARD_DS = _chunkHZEXKGDSjs.DASHBOARD_DS; exports.DEFAULT_GAZETTEER = _chunkHZEXKGDSjs.DEFAULT_GAZETTEER; exports.EDITABLE_VARIABLE_TYPES = _chunkHZEXKGDSjs.EDITABLE_VARIABLE_TYPES; exports.GRID_COLUMNS = _chunkHZEXKGDSjs.GRID_COLUMNS; exports.GrafanaClient = _chunkHZEXKGDSjs.GrafanaClient; exports.GrafanaDataSource = _chunkHZEXKGDSjs.GrafanaDataSource; exports.GrafanaError = _chunkHZEXKGDSjs.GrafanaError; exports.HttpConfigFiles = _chunkHZEXKGDSjs.HttpConfigFiles; exports.INPUT_OPTION_KEYS = _chunkHZEXKGDSjs.INPUT_OPTION_KEYS; exports.INPUT_TYPES = _chunkHZEXKGDSjs.INPUT_TYPES; exports.LOCAL_DATASOURCE_TYPE = _chunkHZEXKGDSjs.LOCAL_DATASOURCE_TYPE; exports.LocalDataSource = _chunkHZEXKGDSjs.LocalDataSource; exports.MANIFEST_VERSION = _chunkHZEXKGDSjs.MANIFEST_VERSION; exports.MAPPING_TYPES = _chunkHZEXKGDSjs.MAPPING_TYPES; exports.MemoryEntryStore = _chunkHZEXKGDSjs.MemoryEntryStore; exports.NAMED_COLORS = _chunkHZEXKGDSjs.NAMED_COLORS; exports.OPTION_CATEGORIES = _chunkHZEXKGDSjs.OPTION_CATEGORIES; exports.OVERRIDE_MATCHERS = _chunkHZEXKGDSjs.OVERRIDE_MATCHERS; exports.PANEL_TYPES = _chunkHZEXKGDSjs.PANEL_TYPES; exports.REDUCER_LABELS = _chunkHZEXKGDSjs.REDUCER_LABELS; exports.REFRESH_CHOICES = _chunkHZEXKGDSjs.REFRESH_CHOICES; exports.RELATIVE_RANGES = _chunkHZEXKGDSjs.RELATIVE_RANGES; exports.SERIES_PALETTE = _chunkHZEXKGDSjs.SERIES_PALETTE; exports.SPECIAL_MATCHES = _chunkHZEXKGDSjs.SPECIAL_MATCHES; exports.SaveConflictError = _chunkHZEXKGDSjs.SaveConflictError; exports.TIME_PRESETS = _chunkHZEXKGDSjs.TIME_PRESETS; exports.UNIT_CHOICES = _chunkHZEXKGDSjs.UNIT_CHOICES; exports.addTime = _chunkHZEXKGDSjs.addTime; exports.appSchema = _chunkHZEXKGDSjs.appSchema; exports.applyDashboardLink = _chunkHZEXKGDSjs.applyDashboardLink; exports.applyJsonEdits = _chunkHZEXKGDSjs.applyJsonEdits; exports.applyTransformations = _chunkHZEXKGDSjs.applyTransformations; exports.assembleBundle = _chunkHZEXKGDSjs.assembleBundle; exports.assembleFromResponse = _chunkHZEXKGDSjs.assembleFromResponse; exports.buildFrames = _chunkHZEXKGDSjs.buildFrames; exports.bundleFromFiles = _chunkHZEXKGDSjs.bundleFromFiles; exports.bundleRoot = _chunkHZEXKGDSjs.bundleRoot; exports.calculateInterval = _chunkHZEXKGDSjs.calculateInterval; exports.checkFiles = _chunkHZEXKGDSjs.checkFiles; exports.cleanDashboard = _chunkHZEXKGDSjs.cleanDashboard; exports.cleanPanelOptions = _chunkHZEXKGDSjs.cleanPanelOptions; exports.collapseRow = _chunkHZEXKGDSjs.collapseRow; exports.compactGrid = _chunkHZEXKGDSjs.compactGrid; exports.dashboardSchema = _chunkHZEXKGDSjs.dashboardSchema; exports.dashboardSchemaIssues = _chunkHZEXKGDSjs.dashboardSchemaIssues; exports.dashboardSourceIds = _chunkHZEXKGDSjs.dashboardSourceIds; exports.defaultFetchJson = _chunkHZEXKGDSjs.defaultFetchJson; exports.describeRange = _chunkHZEXKGDSjs.describeRange; exports.diffJson = _chunkHZEXKGDSjs.diffJson; exports.documentIdFor = _chunkHZEXKGDSjs.documentIdFor; exports.documentUses = _chunkHZEXKGDSjs.documentUses; exports.dropTarget = _chunkHZEXKGDSjs.dropTarget; exports.duplicatePanel = _chunkHZEXKGDSjs.duplicatePanel; exports.entriesSavedWith = _chunkHZEXKGDSjs.entriesSavedWith; exports.entryToInputValue = _chunkHZEXKGDSjs.entryToInputValue; exports.expandRow = _chunkHZEXKGDSjs.expandRow; exports.fetchBundle = _chunkHZEXKGDSjs.fetchBundle; exports.fetchJsonWithToken = _chunkHZEXKGDSjs.fetchJsonWithToken; exports.fieldDisplayName = _chunkHZEXKGDSjs.fieldDisplayName; exports.fieldMatches = _chunkHZEXKGDSjs.fieldMatches; exports.formatClock = _chunkHZEXKGDSjs.formatClock; exports.formatDisplay = _chunkHZEXKGDSjs.formatDisplay; exports.formatDuration = _chunkHZEXKGDSjs.formatDuration; exports.formatJsonText = _chunkHZEXKGDSjs.formatJsonText; exports.formatLocalDateTime = _chunkHZEXKGDSjs.formatLocalDateTime; exports.formatValue = _chunkHZEXKGDSjs.formatValue; exports.frameLength = _chunkHZEXKGDSjs.frameLength; exports.framesToOptions = _chunkHZEXKGDSjs.framesToOptions; exports.fromWire = _chunkHZEXKGDSjs.fromWire; exports.getPath = _chunkHZEXKGDSjs.getPath; exports.gridOffsetPx = _chunkHZEXKGDSjs.gridOffsetPx; exports.gridUnitsToPx = _chunkHZEXKGDSjs.gridUnitsToPx; exports.httpFetchJson = _chunkHZEXKGDSjs.httpFetchJson; exports.initialVariableValues = _chunkHZEXKGDSjs.initialVariableValues; exports.inputPanels = _chunkHZEXKGDSjs.inputPanels; exports.inputProblem = _chunkHZEXKGDSjs.inputProblem; exports.insertPanel = _chunkHZEXKGDSjs.insertPanel; exports.interpolate = _chunkHZEXKGDSjs.interpolate; exports.interpolateDeep = _chunkHZEXKGDSjs.interpolateDeep; exports.isBundleResponse = _chunkHZEXKGDSjs.isBundleResponse; exports.isEditableVariableType = _chunkHZEXKGDSjs.isEditableVariableType; exports.isInputPanel = _chunkHZEXKGDSjs.isInputPanel; exports.isInputType = _chunkHZEXKGDSjs.isInputType; exports.isLocalDatasource = _chunkHZEXKGDSjs.isLocalDatasource; exports.isReducer = _chunkHZEXKGDSjs.isReducer; exports.isRow = _chunkHZEXKGDSjs.isRow; exports.isSqlDatasource = _chunkHZEXKGDSjs.isSqlDatasource; exports.layoutCanvas = _chunkHZEXKGDSjs.layoutCanvas; exports.layoutDashboard = _chunkHZEXKGDSjs.layoutDashboard; exports.lineColumn = _chunkHZEXKGDSjs.lineColumn; exports.loadGazetteer = _chunkHZEXKGDSjs.loadGazetteer; exports.locate = _chunkHZEXKGDSjs.locate; exports.manifestSchemaIssues = _chunkHZEXKGDSjs.manifestSchemaIssues; exports.mappedResult = _chunkHZEXKGDSjs.mappedResult; exports.mappingProblem = _chunkHZEXKGDSjs.mappingProblem; exports.mappingRow = _chunkHZEXKGDSjs.mappingRow; exports.mappingRows = _chunkHZEXKGDSjs.mappingRows; exports.metricChanges = _chunkHZEXKGDSjs.metricChanges; exports.movePanel = _chunkHZEXKGDSjs.movePanel; exports.newDocument = _chunkHZEXKGDSjs.newDocument; exports.newPanel = _chunkHZEXKGDSjs.newPanel; exports.newVariable = _chunkHZEXKGDSjs.newVariable; exports.nextPanelId = _chunkHZEXKGDSjs.nextPanelId; exports.normalizeRef = _chunkHZEXKGDSjs.normalizeRef; exports.numberFields = _chunkHZEXKGDSjs.numberFields; exports.optionValue = _chunkHZEXKGDSjs.optionValue; exports.overrideProperties = _chunkHZEXKGDSjs.overrideProperties; exports.panelEdits = _chunkHZEXKGDSjs.panelEdits; exports.panelHasQueries = _chunkHZEXKGDSjs.panelHasQueries; exports.panelKey = _chunkHZEXKGDSjs.panelKey; exports.panelOptions = _chunkHZEXKGDSjs.panelOptions; exports.panelOverrides = _chunkHZEXKGDSjs.panelOverrides; exports.panelSize = _chunkHZEXKGDSjs.panelSize; exports.panelSpan = _chunkHZEXKGDSjs.panelSpan; exports.parseClockDigits = _chunkHZEXKGDSjs.parseClockDigits; exports.parseDashboardLink = _chunkHZEXKGDSjs.parseDashboardLink; exports.parseDuration = _chunkHZEXKGDSjs.parseDuration; exports.parseGazetteer = _chunkHZEXKGDSjs.parseGazetteer; exports.parseJsonText = _chunkHZEXKGDSjs.parseJsonText; exports.parseLocalDateTime = _chunkHZEXKGDSjs.parseLocalDateTime; exports.parseRange = _chunkHZEXKGDSjs.parseRange; exports.parseTime = _chunkHZEXKGDSjs.parseTime; exports.placePanel = _chunkHZEXKGDSjs.placePanel; exports.pointerToPath = _chunkHZEXKGDSjs.pointerToPath; exports.prepareDashboard = _chunkHZEXKGDSjs.prepareDashboard; exports.queryPanel = _chunkHZEXKGDSjs.queryPanel; exports.queryParam = _chunkHZEXKGDSjs.queryParam; exports.readConfigFiles = _chunkHZEXKGDSjs.readConfigFiles; exports.readingOrder = _chunkHZEXKGDSjs.readingOrder; exports.reduce = _chunkHZEXKGDSjs.reduce; exports.refineOptions = _chunkHZEXKGDSjs.refineOptions; exports.refreshedVariables = _chunkHZEXKGDSjs.refreshedVariables; exports.removeDocumentFromManifest = _chunkHZEXKGDSjs.removeDocumentFromManifest; exports.removePanel = _chunkHZEXKGDSjs.removePanel; exports.renameDocumentInManifest = _chunkHZEXKGDSjs.renameDocumentInManifest; exports.renameVariableInPanels = _chunkHZEXKGDSjs.renameVariableInPanels; exports.repack = _chunkHZEXKGDSjs.repack; exports.repeatOptions = _chunkHZEXKGDSjs.repeatOptions; exports.resizePanel = _chunkHZEXKGDSjs.resizePanel; exports.resolveColor = _chunkHZEXKGDSjs.resolveColor; exports.resolveFieldConfig = _chunkHZEXKGDSjs.resolveFieldConfig; exports.resolveLinks = _chunkHZEXKGDSjs.resolveLinks; exports.resolveTimezone = _chunkHZEXKGDSjs.resolveTimezone; exports.resolveUrl = _chunkHZEXKGDSjs.resolveUrl; exports.resolveVariables = _chunkHZEXKGDSjs.resolveVariables; exports.revalidateBundle = _chunkHZEXKGDSjs.revalidateBundle; exports.rowsToMappings = _chunkHZEXKGDSjs.rowsToMappings; exports.sampleEntries = _chunkHZEXKGDSjs.sampleEntries; exports.screenDocuments = _chunkHZEXKGDSjs.screenDocuments; exports.screenOfType = _chunkHZEXKGDSjs.screenOfType; exports.selectValue = _chunkHZEXKGDSjs.selectValue; exports.seriesColor = _chunkHZEXKGDSjs.seriesColor; exports.setHiddenOnPhones = _chunkHZEXKGDSjs.setHiddenOnPhones; exports.setJsonValue = _chunkHZEXKGDSjs.setJsonValue; exports.setOption = _chunkHZEXKGDSjs.setOption; exports.setOptionValue = _chunkHZEXKGDSjs.setOptionValue; exports.setOverrides = _chunkHZEXKGDSjs.setOverrides; exports.settleLayout = _chunkHZEXKGDSjs.settleLayout; exports.snapToGrid = _chunkHZEXKGDSjs.snapToGrid; exports.splitPath = _chunkHZEXKGDSjs.splitPath; exports.startOf = _chunkHZEXKGDSjs.startOf; exports.stringifyCompact = _chunkHZEXKGDSjs.stringifyCompact; exports.tabIdFor = _chunkHZEXKGDSjs.tabIdFor; exports.textSuggestions = _chunkHZEXKGDSjs.textSuggestions; exports.thresholdStep = _chunkHZEXKGDSjs.thresholdStep; exports.timeExprError = _chunkHZEXKGDSjs.timeExprError; exports.timeField = _chunkHZEXKGDSjs.timeField; exports.toEntries = _chunkHZEXKGDSjs.toEntries; exports.toMillis = _chunkHZEXKGDSjs.toMillis; exports.toSeries = _chunkHZEXKGDSjs.toSeries; exports.toXYSeries = _chunkHZEXKGDSjs.toXYSeries; exports.uniqueNames = _chunkHZEXKGDSjs.uniqueNames; exports.validateBundle = _chunkHZEXKGDSjs.validateBundle; exports.validateDashboard = _chunkHZEXKGDSjs.validateDashboard; exports.validateManifest = _chunkHZEXKGDSjs.validateManifest; exports.valueColor = _chunkHZEXKGDSjs.valueColor; exports.valueText = _chunkHZEXKGDSjs.valueText; exports.variableDependents = _chunkHZEXKGDSjs.variableDependents; exports.variableInfo = _chunkHZEXKGDSjs.variableInfo; exports.variableNameError = _chunkHZEXKGDSjs.variableNameError; exports.variableOptions = _chunkHZEXKGDSjs.variableOptions; exports.variableOrder = _chunkHZEXKGDSjs.variableOrder; exports.variableReferences = _chunkHZEXKGDSjs.variableReferences; exports.variableUses = _chunkHZEXKGDSjs.variableUses; exports.variableWithCurrent = _chunkHZEXKGDSjs.variableWithCurrent; exports.variableWithFlags = _chunkHZEXKGDSjs.variableWithFlags; exports.variableWithQuery = _chunkHZEXKGDSjs.variableWithQuery; exports.variableWithType = _chunkHZEXKGDSjs.variableWithType; exports.visibleVariables = _chunkHZEXKGDSjs.visibleVariables; exports.zoomRange = _chunkHZEXKGDSjs.zoomRange;
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
exports.ALL = _chunk5UE6Q6CQjs.ALL; exports.BUNDLE_ACCEPT = _chunk5UE6Q6CQjs.BUNDLE_ACCEPT; exports.BUNDLE_TYPE = _chunk5UE6Q6CQjs.BUNDLE_TYPE; exports.CANVAS_GAP = _chunk5UE6Q6CQjs.CANVAS_GAP; exports.CANVAS_ROW_HEADER = _chunk5UE6Q6CQjs.CANVAS_ROW_HEADER; exports.ConfigLoader = _chunk5UE6Q6CQjs.ConfigLoader; exports.DASHBOARD_DS = _chunk5UE6Q6CQjs.DASHBOARD_DS; exports.DEFAULT_GAZETTEER = _chunk5UE6Q6CQjs.DEFAULT_GAZETTEER; exports.EDITABLE_VARIABLE_TYPES = _chunk5UE6Q6CQjs.EDITABLE_VARIABLE_TYPES; exports.GRID_COLUMNS = _chunk5UE6Q6CQjs.GRID_COLUMNS; exports.GrafanaClient = _chunk5UE6Q6CQjs.GrafanaClient; exports.GrafanaDataSource = _chunk5UE6Q6CQjs.GrafanaDataSource; exports.GrafanaError = _chunk5UE6Q6CQjs.GrafanaError; exports.HttpConfigFiles = _chunk5UE6Q6CQjs.HttpConfigFiles; exports.INPUT_OPTION_KEYS = _chunk5UE6Q6CQjs.INPUT_OPTION_KEYS; exports.INPUT_TYPES = _chunk5UE6Q6CQjs.INPUT_TYPES; exports.LOCAL_DATASOURCE_TYPE = _chunk5UE6Q6CQjs.LOCAL_DATASOURCE_TYPE; exports.LocalDataSource = _chunk5UE6Q6CQjs.LocalDataSource; exports.MANIFEST_VERSION = _chunk5UE6Q6CQjs.MANIFEST_VERSION; exports.MAPPING_TYPES = _chunk5UE6Q6CQjs.MAPPING_TYPES; exports.MemoryEntryStore = _chunk5UE6Q6CQjs.MemoryEntryStore; exports.NAMED_COLORS = _chunk5UE6Q6CQjs.NAMED_COLORS; exports.OPTION_CATEGORIES = _chunk5UE6Q6CQjs.OPTION_CATEGORIES; exports.OVERRIDE_MATCHERS = _chunk5UE6Q6CQjs.OVERRIDE_MATCHERS; exports.PANEL_TYPES = _chunk5UE6Q6CQjs.PANEL_TYPES; exports.REDUCER_LABELS = _chunk5UE6Q6CQjs.REDUCER_LABELS; exports.REFRESH_CHOICES = _chunk5UE6Q6CQjs.REFRESH_CHOICES; exports.RELATIVE_RANGES = _chunk5UE6Q6CQjs.RELATIVE_RANGES; exports.SERIES_PALETTE = _chunk5UE6Q6CQjs.SERIES_PALETTE; exports.SNIPPET_VERSION = _chunk5UE6Q6CQjs.SNIPPET_VERSION; exports.SPECIAL_MATCHES = _chunk5UE6Q6CQjs.SPECIAL_MATCHES; exports.SaveConflictError = _chunk5UE6Q6CQjs.SaveConflictError; exports.TEMPLATE_VERSION = _chunk5UE6Q6CQjs.TEMPLATE_VERSION; exports.TIME_PRESETS = _chunk5UE6Q6CQjs.TIME_PRESETS; exports.UNIT_CHOICES = _chunk5UE6Q6CQjs.UNIT_CHOICES; exports.addTime = _chunk5UE6Q6CQjs.addTime; exports.appSchema = _chunk5UE6Q6CQjs.appSchema; exports.applyDashboardLink = _chunk5UE6Q6CQjs.applyDashboardLink; exports.applyJsonEdits = _chunk5UE6Q6CQjs.applyJsonEdits; exports.applyTemplate = _chunk5UE6Q6CQjs.applyTemplate; exports.applyTransformations = _chunk5UE6Q6CQjs.applyTransformations; exports.assembleBundle = _chunk5UE6Q6CQjs.assembleBundle; exports.assembleFromResponse = _chunk5UE6Q6CQjs.assembleFromResponse; exports.buildFrames = _chunk5UE6Q6CQjs.buildFrames; exports.bundleFromFiles = _chunk5UE6Q6CQjs.bundleFromFiles; exports.bundleRoot = _chunk5UE6Q6CQjs.bundleRoot; exports.calculateInterval = _chunk5UE6Q6CQjs.calculateInterval; exports.checkFiles = _chunk5UE6Q6CQjs.checkFiles; exports.cleanDashboard = _chunk5UE6Q6CQjs.cleanDashboard; exports.cleanPanelOptions = _chunk5UE6Q6CQjs.cleanPanelOptions; exports.collapseRow = _chunk5UE6Q6CQjs.collapseRow; exports.compactGrid = _chunk5UE6Q6CQjs.compactGrid; exports.copyPanels = _chunk5UE6Q6CQjs.copyPanels; exports.dashboardSchema = _chunk5UE6Q6CQjs.dashboardSchema; exports.dashboardSchemaIssues = _chunk5UE6Q6CQjs.dashboardSchemaIssues; exports.dashboardSourceIds = _chunk5UE6Q6CQjs.dashboardSourceIds; exports.defaultFetchJson = _chunk5UE6Q6CQjs.defaultFetchJson; exports.describeRange = _chunk5UE6Q6CQjs.describeRange; exports.diffJson = _chunk5UE6Q6CQjs.diffJson; exports.documentIdFor = _chunk5UE6Q6CQjs.documentIdFor; exports.documentUses = _chunk5UE6Q6CQjs.documentUses; exports.dropTarget = _chunk5UE6Q6CQjs.dropTarget; exports.duplicatePanel = _chunk5UE6Q6CQjs.duplicatePanel; exports.entriesSavedWith = _chunk5UE6Q6CQjs.entriesSavedWith; exports.entryToInputValue = _chunk5UE6Q6CQjs.entryToInputValue; exports.expandRow = _chunk5UE6Q6CQjs.expandRow; exports.fetchBundle = _chunk5UE6Q6CQjs.fetchBundle; exports.fetchJsonWithToken = _chunk5UE6Q6CQjs.fetchJsonWithToken; exports.fieldDisplayName = _chunk5UE6Q6CQjs.fieldDisplayName; exports.fieldMatches = _chunk5UE6Q6CQjs.fieldMatches; exports.formatClock = _chunk5UE6Q6CQjs.formatClock; exports.formatDisplay = _chunk5UE6Q6CQjs.formatDisplay; exports.formatDuration = _chunk5UE6Q6CQjs.formatDuration; exports.formatJsonText = _chunk5UE6Q6CQjs.formatJsonText; exports.formatLocalDateTime = _chunk5UE6Q6CQjs.formatLocalDateTime; exports.formatValue = _chunk5UE6Q6CQjs.formatValue; exports.frameLength = _chunk5UE6Q6CQjs.frameLength; exports.framesToOptions = _chunk5UE6Q6CQjs.framesToOptions; exports.fromWire = _chunk5UE6Q6CQjs.fromWire; exports.getPath = _chunk5UE6Q6CQjs.getPath; exports.gridOffsetPx = _chunk5UE6Q6CQjs.gridOffsetPx; exports.gridUnitsToPx = _chunk5UE6Q6CQjs.gridUnitsToPx; exports.httpFetchJson = _chunk5UE6Q6CQjs.httpFetchJson; exports.initialVariableValues = _chunk5UE6Q6CQjs.initialVariableValues; exports.inputPanels = _chunk5UE6Q6CQjs.inputPanels; exports.inputProblem = _chunk5UE6Q6CQjs.inputProblem; exports.insertPanel = _chunk5UE6Q6CQjs.insertPanel; exports.interpolate = _chunk5UE6Q6CQjs.interpolate; exports.interpolateDeep = _chunk5UE6Q6CQjs.interpolateDeep; exports.isBundleResponse = _chunk5UE6Q6CQjs.isBundleResponse; exports.isEditableVariableType = _chunk5UE6Q6CQjs.isEditableVariableType; exports.isInputPanel = _chunk5UE6Q6CQjs.isInputPanel; exports.isInputType = _chunk5UE6Q6CQjs.isInputType; exports.isLocalDatasource = _chunk5UE6Q6CQjs.isLocalDatasource; exports.isReducer = _chunk5UE6Q6CQjs.isReducer; exports.isRow = _chunk5UE6Q6CQjs.isRow; exports.isSqlDatasource = _chunk5UE6Q6CQjs.isSqlDatasource; exports.layoutCanvas = _chunk5UE6Q6CQjs.layoutCanvas; exports.layoutDashboard = _chunk5UE6Q6CQjs.layoutDashboard; exports.lineColumn = _chunk5UE6Q6CQjs.lineColumn; exports.loadGazetteer = _chunk5UE6Q6CQjs.loadGazetteer; exports.locate = _chunk5UE6Q6CQjs.locate; exports.makeTemplate = _chunk5UE6Q6CQjs.makeTemplate; exports.manifestSchemaIssues = _chunk5UE6Q6CQjs.manifestSchemaIssues; exports.mappedResult = _chunk5UE6Q6CQjs.mappedResult; exports.mappingProblem = _chunk5UE6Q6CQjs.mappingProblem; exports.mappingRow = _chunk5UE6Q6CQjs.mappingRow; exports.mappingRows = _chunk5UE6Q6CQjs.mappingRows; exports.metricChanges = _chunk5UE6Q6CQjs.metricChanges; exports.movePanel = _chunk5UE6Q6CQjs.movePanel; exports.newDocument = _chunk5UE6Q6CQjs.newDocument; exports.newPanel = _chunk5UE6Q6CQjs.newPanel; exports.newVariable = _chunk5UE6Q6CQjs.newVariable; exports.nextPanelId = _chunk5UE6Q6CQjs.nextPanelId; exports.normalizeRef = _chunk5UE6Q6CQjs.normalizeRef; exports.numberFields = _chunk5UE6Q6CQjs.numberFields; exports.optionValue = _chunk5UE6Q6CQjs.optionValue; exports.overrideProperties = _chunk5UE6Q6CQjs.overrideProperties; exports.panelEdits = _chunk5UE6Q6CQjs.panelEdits; exports.panelHasQueries = _chunk5UE6Q6CQjs.panelHasQueries; exports.panelKey = _chunk5UE6Q6CQjs.panelKey; exports.panelMetrics = _chunk5UE6Q6CQjs.panelMetrics; exports.panelOptions = _chunk5UE6Q6CQjs.panelOptions; exports.panelOverrides = _chunk5UE6Q6CQjs.panelOverrides; exports.panelSize = _chunk5UE6Q6CQjs.panelSize; exports.panelSpan = _chunk5UE6Q6CQjs.panelSpan; exports.parseClockDigits = _chunk5UE6Q6CQjs.parseClockDigits; exports.parseDashboardLink = _chunk5UE6Q6CQjs.parseDashboardLink; exports.parseDuration = _chunk5UE6Q6CQjs.parseDuration; exports.parseGazetteer = _chunk5UE6Q6CQjs.parseGazetteer; exports.parseJsonText = _chunk5UE6Q6CQjs.parseJsonText; exports.parseLocalDateTime = _chunk5UE6Q6CQjs.parseLocalDateTime; exports.parseRange = _chunk5UE6Q6CQjs.parseRange; exports.parseSnippet = _chunk5UE6Q6CQjs.parseSnippet; exports.parseTemplate = _chunk5UE6Q6CQjs.parseTemplate; exports.parseTime = _chunk5UE6Q6CQjs.parseTime; exports.pasteSnippet = _chunk5UE6Q6CQjs.pasteSnippet; exports.placePanel = _chunk5UE6Q6CQjs.placePanel; exports.pointerToPath = _chunk5UE6Q6CQjs.pointerToPath; exports.prepareDashboard = _chunk5UE6Q6CQjs.prepareDashboard; exports.previewPaste = _chunk5UE6Q6CQjs.previewPaste; exports.queryPanel = _chunk5UE6Q6CQjs.queryPanel; exports.queryParam = _chunk5UE6Q6CQjs.queryParam; exports.readConfigFiles = _chunk5UE6Q6CQjs.readConfigFiles; exports.readingOrder = _chunk5UE6Q6CQjs.readingOrder; exports.reduce = _chunk5UE6Q6CQjs.reduce; exports.refineOptions = _chunk5UE6Q6CQjs.refineOptions; exports.refreshedVariables = _chunk5UE6Q6CQjs.refreshedVariables; exports.removeDocumentFromManifest = _chunk5UE6Q6CQjs.removeDocumentFromManifest; exports.removePanel = _chunk5UE6Q6CQjs.removePanel; exports.renameDocumentInManifest = _chunk5UE6Q6CQjs.renameDocumentInManifest; exports.renameMetrics = _chunk5UE6Q6CQjs.renameMetrics; exports.renameVariableInPanels = _chunk5UE6Q6CQjs.renameVariableInPanels; exports.repack = _chunk5UE6Q6CQjs.repack; exports.repeatOptions = _chunk5UE6Q6CQjs.repeatOptions; exports.resizePanel = _chunk5UE6Q6CQjs.resizePanel; exports.resolveColor = _chunk5UE6Q6CQjs.resolveColor; exports.resolveFieldConfig = _chunk5UE6Q6CQjs.resolveFieldConfig; exports.resolveLinks = _chunk5UE6Q6CQjs.resolveLinks; exports.resolveTimezone = _chunk5UE6Q6CQjs.resolveTimezone; exports.resolveUrl = _chunk5UE6Q6CQjs.resolveUrl; exports.resolveVariables = _chunk5UE6Q6CQjs.resolveVariables; exports.revalidateBundle = _chunk5UE6Q6CQjs.revalidateBundle; exports.rowsToMappings = _chunk5UE6Q6CQjs.rowsToMappings; exports.sampleEntries = _chunk5UE6Q6CQjs.sampleEntries; exports.screenDocuments = _chunk5UE6Q6CQjs.screenDocuments; exports.screenOfType = _chunk5UE6Q6CQjs.screenOfType; exports.selectValue = _chunk5UE6Q6CQjs.selectValue; exports.seriesColor = _chunk5UE6Q6CQjs.seriesColor; exports.setHiddenOnPhones = _chunk5UE6Q6CQjs.setHiddenOnPhones; exports.setJsonValue = _chunk5UE6Q6CQjs.setJsonValue; exports.setOption = _chunk5UE6Q6CQjs.setOption; exports.setOptionValue = _chunk5UE6Q6CQjs.setOptionValue; exports.setOverrides = _chunk5UE6Q6CQjs.setOverrides; exports.settleLayout = _chunk5UE6Q6CQjs.settleLayout; exports.snapToGrid = _chunk5UE6Q6CQjs.snapToGrid; exports.splitPath = _chunk5UE6Q6CQjs.splitPath; exports.startOf = _chunk5UE6Q6CQjs.startOf; exports.stringifyCompact = _chunk5UE6Q6CQjs.stringifyCompact; exports.tabIdFor = _chunk5UE6Q6CQjs.tabIdFor; exports.templateNeeds = _chunk5UE6Q6CQjs.templateNeeds; exports.textSuggestions = _chunk5UE6Q6CQjs.textSuggestions; exports.thresholdStep = _chunk5UE6Q6CQjs.thresholdStep; exports.timeExprError = _chunk5UE6Q6CQjs.timeExprError; exports.timeField = _chunk5UE6Q6CQjs.timeField; exports.toEntries = _chunk5UE6Q6CQjs.toEntries; exports.toMillis = _chunk5UE6Q6CQjs.toMillis; exports.toSeries = _chunk5UE6Q6CQjs.toSeries; exports.toXYSeries = _chunk5UE6Q6CQjs.toXYSeries; exports.uniqueNames = _chunk5UE6Q6CQjs.uniqueNames; exports.validateBundle = _chunk5UE6Q6CQjs.validateBundle; exports.validateDashboard = _chunk5UE6Q6CQjs.validateDashboard; exports.validateManifest = _chunk5UE6Q6CQjs.validateManifest; exports.valueColor = _chunk5UE6Q6CQjs.valueColor; exports.valueText = _chunk5UE6Q6CQjs.valueText; exports.variableDependents = _chunk5UE6Q6CQjs.variableDependents; exports.variableInfo = _chunk5UE6Q6CQjs.variableInfo; exports.variableNameError = _chunk5UE6Q6CQjs.variableNameError; exports.variableOptions = _chunk5UE6Q6CQjs.variableOptions; exports.variableOrder = _chunk5UE6Q6CQjs.variableOrder; exports.variableReferences = _chunk5UE6Q6CQjs.variableReferences; exports.variableUses = _chunk5UE6Q6CQjs.variableUses; exports.variableWithCurrent = _chunk5UE6Q6CQjs.variableWithCurrent; exports.variableWithFlags = _chunk5UE6Q6CQjs.variableWithFlags; exports.variableWithQuery = _chunk5UE6Q6CQjs.variableWithQuery; exports.variableWithType = _chunk5UE6Q6CQjs.variableWithType; exports.visibleVariables = _chunk5UE6Q6CQjs.visibleVariables; exports.zoomRange = _chunk5UE6Q6CQjs.zoomRange;
|
package/dist/core/index.mjs
CHANGED
|
@@ -28,14 +28,17 @@ import {
|
|
|
28
28
|
REFRESH_CHOICES,
|
|
29
29
|
RELATIVE_RANGES,
|
|
30
30
|
SERIES_PALETTE,
|
|
31
|
+
SNIPPET_VERSION,
|
|
31
32
|
SPECIAL_MATCHES,
|
|
32
33
|
SaveConflictError,
|
|
34
|
+
TEMPLATE_VERSION,
|
|
33
35
|
TIME_PRESETS,
|
|
34
36
|
UNIT_CHOICES,
|
|
35
37
|
addTime,
|
|
36
38
|
appSchema,
|
|
37
39
|
applyDashboardLink,
|
|
38
40
|
applyJsonEdits,
|
|
41
|
+
applyTemplate,
|
|
39
42
|
applyTransformations,
|
|
40
43
|
assembleBundle,
|
|
41
44
|
assembleFromResponse,
|
|
@@ -48,6 +51,7 @@ import {
|
|
|
48
51
|
cleanPanelOptions,
|
|
49
52
|
collapseRow,
|
|
50
53
|
compactGrid,
|
|
54
|
+
copyPanels,
|
|
51
55
|
dashboardSchema,
|
|
52
56
|
dashboardSchemaIssues,
|
|
53
57
|
dashboardSourceIds,
|
|
@@ -97,6 +101,7 @@ import {
|
|
|
97
101
|
lineColumn,
|
|
98
102
|
loadGazetteer,
|
|
99
103
|
locate,
|
|
104
|
+
makeTemplate,
|
|
100
105
|
manifestSchemaIssues,
|
|
101
106
|
mappedResult,
|
|
102
107
|
mappingProblem,
|
|
@@ -115,6 +120,7 @@ import {
|
|
|
115
120
|
panelEdits,
|
|
116
121
|
panelHasQueries,
|
|
117
122
|
panelKey,
|
|
123
|
+
panelMetrics,
|
|
118
124
|
panelOptions,
|
|
119
125
|
panelOverrides,
|
|
120
126
|
panelSize,
|
|
@@ -126,10 +132,14 @@ import {
|
|
|
126
132
|
parseJsonText,
|
|
127
133
|
parseLocalDateTime,
|
|
128
134
|
parseRange,
|
|
135
|
+
parseSnippet,
|
|
136
|
+
parseTemplate,
|
|
129
137
|
parseTime,
|
|
138
|
+
pasteSnippet,
|
|
130
139
|
placePanel,
|
|
131
140
|
pointerToPath,
|
|
132
141
|
prepareDashboard,
|
|
142
|
+
previewPaste,
|
|
133
143
|
queryPanel,
|
|
134
144
|
queryParam,
|
|
135
145
|
readConfigFiles,
|
|
@@ -140,6 +150,7 @@ import {
|
|
|
140
150
|
removeDocumentFromManifest,
|
|
141
151
|
removePanel,
|
|
142
152
|
renameDocumentInManifest,
|
|
153
|
+
renameMetrics,
|
|
143
154
|
renameVariableInPanels,
|
|
144
155
|
repack,
|
|
145
156
|
repeatOptions,
|
|
@@ -168,6 +179,7 @@ import {
|
|
|
168
179
|
startOf,
|
|
169
180
|
stringifyCompact,
|
|
170
181
|
tabIdFor,
|
|
182
|
+
templateNeeds,
|
|
171
183
|
textSuggestions,
|
|
172
184
|
thresholdStep,
|
|
173
185
|
timeExprError,
|
|
@@ -195,7 +207,7 @@ import {
|
|
|
195
207
|
variableWithType,
|
|
196
208
|
visibleVariables,
|
|
197
209
|
zoomRange
|
|
198
|
-
} from "../chunk-
|
|
210
|
+
} from "../chunk-5SGVTAFJ.mjs";
|
|
199
211
|
export {
|
|
200
212
|
ALL,
|
|
201
213
|
BUNDLE_ACCEPT,
|
|
@@ -226,14 +238,17 @@ export {
|
|
|
226
238
|
REFRESH_CHOICES,
|
|
227
239
|
RELATIVE_RANGES,
|
|
228
240
|
SERIES_PALETTE,
|
|
241
|
+
SNIPPET_VERSION,
|
|
229
242
|
SPECIAL_MATCHES,
|
|
230
243
|
SaveConflictError,
|
|
244
|
+
TEMPLATE_VERSION,
|
|
231
245
|
TIME_PRESETS,
|
|
232
246
|
UNIT_CHOICES,
|
|
233
247
|
addTime,
|
|
234
248
|
appSchema,
|
|
235
249
|
applyDashboardLink,
|
|
236
250
|
applyJsonEdits,
|
|
251
|
+
applyTemplate,
|
|
237
252
|
applyTransformations,
|
|
238
253
|
assembleBundle,
|
|
239
254
|
assembleFromResponse,
|
|
@@ -246,6 +261,7 @@ export {
|
|
|
246
261
|
cleanPanelOptions,
|
|
247
262
|
collapseRow,
|
|
248
263
|
compactGrid,
|
|
264
|
+
copyPanels,
|
|
249
265
|
dashboardSchema,
|
|
250
266
|
dashboardSchemaIssues,
|
|
251
267
|
dashboardSourceIds,
|
|
@@ -295,6 +311,7 @@ export {
|
|
|
295
311
|
lineColumn,
|
|
296
312
|
loadGazetteer,
|
|
297
313
|
locate,
|
|
314
|
+
makeTemplate,
|
|
298
315
|
manifestSchemaIssues,
|
|
299
316
|
mappedResult,
|
|
300
317
|
mappingProblem,
|
|
@@ -313,6 +330,7 @@ export {
|
|
|
313
330
|
panelEdits,
|
|
314
331
|
panelHasQueries,
|
|
315
332
|
panelKey,
|
|
333
|
+
panelMetrics,
|
|
316
334
|
panelOptions,
|
|
317
335
|
panelOverrides,
|
|
318
336
|
panelSize,
|
|
@@ -324,10 +342,14 @@ export {
|
|
|
324
342
|
parseJsonText,
|
|
325
343
|
parseLocalDateTime,
|
|
326
344
|
parseRange,
|
|
345
|
+
parseSnippet,
|
|
346
|
+
parseTemplate,
|
|
327
347
|
parseTime,
|
|
348
|
+
pasteSnippet,
|
|
328
349
|
placePanel,
|
|
329
350
|
pointerToPath,
|
|
330
351
|
prepareDashboard,
|
|
352
|
+
previewPaste,
|
|
331
353
|
queryPanel,
|
|
332
354
|
queryParam,
|
|
333
355
|
readConfigFiles,
|
|
@@ -338,6 +360,7 @@ export {
|
|
|
338
360
|
removeDocumentFromManifest,
|
|
339
361
|
removePanel,
|
|
340
362
|
renameDocumentInManifest,
|
|
363
|
+
renameMetrics,
|
|
341
364
|
renameVariableInPanels,
|
|
342
365
|
repack,
|
|
343
366
|
repeatOptions,
|
|
@@ -366,6 +389,7 @@ export {
|
|
|
366
389
|
startOf,
|
|
367
390
|
stringifyCompact,
|
|
368
391
|
tabIdFor,
|
|
392
|
+
templateNeeds,
|
|
369
393
|
textSuggestions,
|
|
370
394
|
thresholdStep,
|
|
371
395
|
timeExprError,
|
|
@@ -112,10 +112,10 @@ export declare function collapseRow(panels: Panel[], index: number): {
|
|
|
112
112
|
};
|
|
113
113
|
/**
|
|
114
114
|
* Floats every panel up the way the app shows them, so the file says what the app shows. With
|
|
115
|
-
* `fixed`, that panel
|
|
116
|
-
* first. Panels already in place are left as the same objects.
|
|
115
|
+
* `fixed`, that panel (or those panels, e.g. a pasted block) keeps its place and any it now
|
|
116
|
+
* covers move down first. Panels already in place are left as the same objects.
|
|
117
117
|
*/
|
|
118
|
-
export declare function settleLayout(panels: Panel[], fixed?: number): Panel[];
|
|
118
|
+
export declare function settleLayout(panels: Panel[], fixed?: number | number[]): Panel[];
|
|
119
119
|
/** Puts a panel with its top left at column x, line y; panels in the way move down, then everything floats up. */
|
|
120
120
|
export declare function placePanel(panels: Panel[], index: number, x: number, y: number): Panel[];
|
|
121
121
|
/** The grid cell a panel `w` columns wide would take with its top left at pixel (x, y) on a canvas `width` wide. */
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Dashboard, Panel, TemplateVariable } from './schema';
|
|
2
|
+
export declare const SNIPPET_VERSION = 1;
|
|
3
|
+
export interface PanelSnippet {
|
|
4
|
+
$modelform: 'panels';
|
|
5
|
+
version: number;
|
|
6
|
+
/** "form" when any panel is an input, which only forms can show. */
|
|
7
|
+
kind: 'form' | 'dashboard';
|
|
8
|
+
/** Top-level panels. A row brings its panels: inside it when collapsed, after it when not. */
|
|
9
|
+
panels: Panel[];
|
|
10
|
+
/** The dashboard variables the panels use, and the variables those use. */
|
|
11
|
+
variables: TemplateVariable[];
|
|
12
|
+
/** Every metric the panels record (inputs) or read (local queries). */
|
|
13
|
+
metrics: string[];
|
|
14
|
+
}
|
|
15
|
+
/** The metrics a panel records or reads, leaving out ones taken from a variable ($metric). */
|
|
16
|
+
export declare function panelMetrics(p: Panel): string[];
|
|
17
|
+
/** `panels` (and the panels inside rows) with every recorded or read metric renamed per `map`. */
|
|
18
|
+
export declare function renameMetrics(panels: Panel[], map: Record<string, string>): Panel[];
|
|
19
|
+
/**
|
|
20
|
+
* The top-level panels at `indices` as a snippet. A row brings the panels under it, down to the
|
|
21
|
+
* next row; a collapsed row already holds them. Ids go, positions become relative to the block.
|
|
22
|
+
*/
|
|
23
|
+
export declare function copyPanels(dashboard: Dashboard, indices: number[]): PanelSnippet;
|
|
24
|
+
/**
|
|
25
|
+
* Reads clipboard text as a snippet: a snippet itself, one Grafana panel, an array of panels, or
|
|
26
|
+
* a whole dashboard (its panels and variables). Positions, ids, variables and metrics are worked
|
|
27
|
+
* out again from the panels, so hand-edited or foreign JSON comes out consistent.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseSnippet(text: string): {
|
|
30
|
+
snippet: PanelSnippet;
|
|
31
|
+
} | {
|
|
32
|
+
error: string;
|
|
33
|
+
};
|
|
34
|
+
export interface PasteOptions {
|
|
35
|
+
/** Put the block under this top-level panel; otherwise at the bottom. */
|
|
36
|
+
after?: number | null;
|
|
37
|
+
/** Metrics to rename on the way in, e.g. { weight: 'body-weight' }. */
|
|
38
|
+
metrics?: Record<string, string>;
|
|
39
|
+
/** What's being pasted into. Inputs only go into forms. Defaults to a form if it has inputs. */
|
|
40
|
+
kind?: 'form' | 'dashboard';
|
|
41
|
+
}
|
|
42
|
+
export interface PasteResult {
|
|
43
|
+
panels: Panel[];
|
|
44
|
+
/** The dashboard's variables after the paste. */
|
|
45
|
+
variables: TemplateVariable[];
|
|
46
|
+
/** Index in `panels` of the first pasted panel; the rest follow it. */
|
|
47
|
+
index: number;
|
|
48
|
+
/** How many top-level panels were pasted. */
|
|
49
|
+
count: number;
|
|
50
|
+
/** Variables the dashboard didn't have, by name as added. */
|
|
51
|
+
added: string[];
|
|
52
|
+
/** Variables added under a new name because the dashboard has a different one of the same name. */
|
|
53
|
+
renamed: Record<string, string>;
|
|
54
|
+
/** Titles of panels left out: inputs going into a dashboard. */
|
|
55
|
+
skipped: string[];
|
|
56
|
+
}
|
|
57
|
+
/** What a paste would add and rename, without doing it: for asking first. */
|
|
58
|
+
export declare function previewPaste(dashboard: Dashboard, snippet: PanelSnippet): {
|
|
59
|
+
added: string[];
|
|
60
|
+
renamed: Record<string, string>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Drops a snippet into a dashboard: fresh ids, metrics renamed per `options.metrics`, variables
|
|
64
|
+
* added (or added under a new name where one of the same name differs), and the block placed as
|
|
65
|
+
* a unit under `options.after` or at the bottom, with the panels below moving down. Pasted
|
|
66
|
+
* panels go at the end of the panels array, so the rest of the file stays as it is.
|
|
67
|
+
*/
|
|
68
|
+
export declare function pasteSnippet(dashboard: Dashboard, snippet: PanelSnippet, options?: PasteOptions): PasteResult;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type AppManifest, type Tab } from './manifest';
|
|
2
|
+
import type { Dashboard } from './schema';
|
|
3
|
+
export declare const TEMPLATE_VERSION = 1;
|
|
4
|
+
export interface TemplateDocument {
|
|
5
|
+
kind: 'form' | 'dashboard';
|
|
6
|
+
/** The document's id where the template was made; it gets a new one if the config has it already. */
|
|
7
|
+
id: string;
|
|
8
|
+
dashboard: Dashboard;
|
|
9
|
+
}
|
|
10
|
+
export interface AppTemplate {
|
|
11
|
+
$modelform: 'template';
|
|
12
|
+
version: number;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
documents: TemplateDocument[];
|
|
16
|
+
/** Tabs showing the template's documents, in the manifest's shape. Added only when asked for. */
|
|
17
|
+
tabs: Tab[];
|
|
18
|
+
/** What the forms record and the dashboards read. */
|
|
19
|
+
metrics: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A template of the config's documents `ids` (forms and dashboards by their manifest id), with
|
|
23
|
+
* the tabs that show only those documents.
|
|
24
|
+
*/
|
|
25
|
+
export declare function makeTemplate(manifest: Pick<AppManifest, 'tabs'>, documents: Record<string, Dashboard>, ids: string[], meta: {
|
|
26
|
+
title: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
}): AppTemplate;
|
|
29
|
+
/**
|
|
30
|
+
* Reads a template, or says why it isn't one. Documents that can't render are refused; tabs
|
|
31
|
+
* that show anything outside the template are dropped; metrics are worked out again.
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseTemplate(text: string): {
|
|
34
|
+
template: AppTemplate;
|
|
35
|
+
} | {
|
|
36
|
+
error: string;
|
|
37
|
+
};
|
|
38
|
+
export interface TemplateNeeds {
|
|
39
|
+
/** Metrics the chosen documents read that neither their forms nor the config record: worth asking to map. */
|
|
40
|
+
unknown: string[];
|
|
41
|
+
/** The template's forms whose metrics the config already records (directly or once mapped): ones it could do without. */
|
|
42
|
+
covered: string[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* What using a template would need decided, given the metrics the config's forms record, which
|
|
46
|
+
* of its documents are chosen (all by default), and any mapping so far.
|
|
47
|
+
*/
|
|
48
|
+
export declare function templateNeeds(template: AppTemplate, recorded: Iterable<string>, chosen?: string[], metrics?: Record<string, string>): TemplateNeeds;
|
|
49
|
+
export interface ApplyOptions {
|
|
50
|
+
/** Ids of the template's documents to add. Defaults to all of them. */
|
|
51
|
+
documents?: string[];
|
|
52
|
+
/** Metrics to read and record as ones the config already has, e.g. { weight: 'body-weight' }. */
|
|
53
|
+
metrics?: Record<string, string>;
|
|
54
|
+
/** Ids of the template's tabs to add. Defaults to none. */
|
|
55
|
+
tabs?: string[];
|
|
56
|
+
}
|
|
57
|
+
export interface AppliedTemplate {
|
|
58
|
+
/** The manifest's new text: the documents listed, and any tabs added. */
|
|
59
|
+
manifest: string;
|
|
60
|
+
/** New files by path, e.g. "dashboards/progress.json". */
|
|
61
|
+
files: Record<string, string>;
|
|
62
|
+
/** Each added document's id in the config, by its id in the template. */
|
|
63
|
+
ids: Record<string, string>;
|
|
64
|
+
/** Ids of the tabs added, in order. */
|
|
65
|
+
tabs: string[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Adds a template's documents to a config: a file each under forms/ or dashboards/, listed in
|
|
69
|
+
* the manifest, with ids and paths that clash renamed (`workout-2`) and metrics mapped. Tabs
|
|
70
|
+
* asked for are added at the end, pointing at the new ids; one left showing nothing is skipped.
|
|
71
|
+
* `paths` are the files the config has (saved or not), so a new one never lands on one.
|
|
72
|
+
* Returns the manifest's new text, keeping its formatting, and the new files.
|
|
73
|
+
*/
|
|
74
|
+
export declare function applyTemplate(manifestText: string, paths: Iterable<string>, template: AppTemplate, options?: ApplyOptions): AppliedTemplate;
|