Fixes
fix: Add tags to ParsedText (#9237)
fix: Add tags to ParsedText (#9237)
This pull request introduces the concept of "tags" for parsed text segments in the CSpell types, allowing each segment of text to be annotated with a set of named tags. These tags can hold boolean, string, or undefined values, supporting richer metadata for parsers and downstream consumers. The changes affect both the TypeScript source and the type definitions.
The most important changes are:
Tagging Support for Parsed Text
- Added a new optional
tagsproperty to theParsedTextinterface, allowing each parsed text segment to carry a set of tags as metadata. (ParsedTextinparser.ts,index.d.mts,index.d.mts) [1] [2] [3] - Introduced the
ParsedTagtype (boolean | string | undefined) and theParsedTagsinterface (a map of tag names toParsedTagvalues) to define the structure of tags. (parser.ts,index.d.mts,index.d.mts) [1] [2] [3]
Type Exports and API Surface
- Updated exports throughout the codebase to include
ParsedTagandParsedTags, making these types available to consumers. (src/Parser/index.ts,src/index.ts,index.d.mts,index.d.mts) [1] [2] [3] [4] - Changed the export style in
src/Parser/index.mtsfromexport *toexport type *, ensuring only types are exported.
These changes lay the groundwork for parsers and other tools to annotate text with structured metadata, improving extensibility and downstream processing.