Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions dist/datamodel/usage/UsageIndex.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { MaskScope } from '../maskScope.js';
import type { ParsedSlx } from '../parser/SlxParser.js';
import type { NodeUsage } from '../../core/DataModel.js';
/**
* Where a name a block parameter refers to was defined.
Expand Down Expand Up @@ -131,6 +132,29 @@ export interface UsageIndex {
* refusal to its caller.
*/
export declare function summarizeFiles(files: UsageFile[]): FileSummaries;
/**
* The model branch of `summarizeFiles`, over a structure the caller has ALREADY parsed.
*
* A host that shows a model's rows ran `parseModel` on those bytes to build them, and
* `summarizeFiles` runs it again on the same bytes to summarise the same model — a second
* full parse per model open, spent to learn nothing the caller was not holding. This takes
* the parse instead of the bytes; nothing else about the summary changes.
*
* The answer is a whole `FileSummaries` holding just this one model rather than a bare
* `ModelSummary`, so it is exactly what `summarizeFiles([{ srcId, filename, bytes }])`
* returns for a model and `mergeFileSummaries` folds it in beside the dictionaries and
* MAT-files summarised the ordinary way. usageIndex.test.ts pins that equality per fixture,
* because two ways to summarise a model is the shape a drift takes.
*
* `filename` is still required and is still not `srcId`: the model NAME comes off the
* basename (see `modelSummary`), and that is the name a block path and every reference
* record spell.
*
* No per-file `try` here, unlike `summarizeFiles`: there is no file to be unreadable. A
* caller with a parse in hand has already been told whether the bytes were readable, and
* swallowing a throw would hand back an empty answer for a model that HAD been parsed.
*/
export declare function summarizeParsedModel(parsed: ParsedSlx, srcId: string, filename: string): FileSummaries;
/**
* Where the name `name` resolves for a block of `model` sitting at `systemPath`, or null
* if it does not.
Expand Down
2 changes: 1 addition & 1 deletion dist/datamodel/usage/UsageIndex.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 29 additions & 1 deletion dist/datamodel/usage/UsageIndex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/datamodel/usage/UsageIndex.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export { scanModelStructure, type ModelStructure } from './datamodel/parser/Mode
export { DATA_PART, DATA_PART_XML, DATA_PART_KEY, TEXT_PARTS, TEXT_CONTENT } from './datamodel/parser/SlddParts.js';
export { SC_PART, SC_PART_XML, SC_TYPE_TO_CLASSIFICATION, applyScEdits, catalogFromDefinitions, classificationOf, scRenameEdits, scanScJsonText, scanScXml, } from './datamodel/parser/ScCatalog.js';
export type { ScDefinition, ScNameSite, ScTextEdit, SystemComposerCatalog } from './datamodel/parser/ScCatalog.js';
export { buildUsageIndex, buildUsageIndexFromSummaries, mergeFileSummaries, summarizeFiles, resolveName, } from './datamodel/usage/UsageIndex.js';
export { buildUsageIndex, buildUsageIndexFromSummaries, mergeFileSummaries, summarizeFiles, summarizeParsedModel, resolveName, } from './datamodel/usage/UsageIndex.js';
export type { UsageIndex, UsageFile, FileSummaries, ModelSummary, DataSummary, ParamOrigin, OriginKind, } from './datamodel/usage/UsageIndex.js';
export { maskDefining } from './datamodel/maskScope.js';
export type { MaskScope } from './datamodel/maskScope.js';
Expand Down
2 changes: 1 addition & 1 deletion dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading