Skip to content

Commit c91bb79

Browse files
refactor(types): export the parser tag type as JavascriptParserTag
1 parent 95c7c3b commit c91bb79

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎lib/index.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ const getCli = memoize(() => ({
9696
* @template {import("./module/NormalModule")} [TModule=import("./module/NormalModule")]
9797
* @typedef {import("./module/Parser").ParserState<TModule>} ParserState
9898
*/
99+
/**
100+
* @template [T=import("./javascript/JavascriptParser").TagData]
101+
* @typedef {import("./javascript/JavascriptParser").Tag<T>} JavascriptParserTag
102+
*/
99103
/** @typedef {import("./resolve/ResolverFactory").ResolvePluginInstance} ResolvePluginInstance */
100104
/** @typedef {import("./resolve/ResolverFactory").Resolver} Resolver */
101105
/** @typedef {import("./template/Template").RenderManifestEntry} RenderManifestEntry */

‎types.d.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16048,10 +16048,10 @@ declare class JavascriptParser extends Parser<BuiltJavascriptModule> {
1604816048
>;
1604916049
currentTagData?:
1605016050
| object
16051-
| TopLevelSymbol
1605216051
| ESMSettings
1605316052
| ImportSettings
1605416053
| CommonJsImportSettings
16054+
| TopLevelSymbol
1605516055
| CompatibilitySettings;
1605616056
magicCommentContext: ContextImport;
1605716057

@@ -17948,6 +17948,7 @@ declare interface JavascriptParserOptions {
1794817948
type JavascriptParserState = ParserStateBase<BuiltJavascriptModule> &
1794917949
Record<string, any> &
1795017950
KnownJavascriptParserState;
17951+
type JavascriptParserTag<T = TagData> = symbol & { readonly __tagData?: T };
1795117952

1795217953
/**
1795317954
* what the JavaScript `SourceProcessor` reads its source as, and prints it with
@@ -34169,10 +34170,10 @@ declare const TRANSITIVE_ONLY: unique symbol;
3416934170
type Tag<T = TagData> = symbol & { readonly __tagData?: T };
3417034171
type TagData =
3417134172
| object
34172-
| TopLevelSymbol
3417334173
| ESMSettings
3417434174
| ImportSettings
3417534175
| CommonJsImportSettings
34176+
| TopLevelSymbol
3417634177
| CompatibilitySettings;
3417734178

3417834179
/**
@@ -34182,10 +34183,10 @@ declare interface TagInfo {
3418234183
tag: Tag<TagData>;
3418334184
data?:
3418434185
| object
34185-
| TopLevelSymbol
3418634186
| ESMSettings
3418734187
| ImportSettings
3418834188
| CommonJsImportSettings
34189+
| TopLevelSymbol
3418934190
| CompatibilitySettings;
3419034191
next?: TagInfo;
3419134192
}
@@ -39891,6 +39892,7 @@ declare namespace exports {
3989139892
StatsOptions as MultiStatsOptions,
3989239893
ResolveData,
3989339894
ParserState,
39895+
JavascriptParserTag,
3989439896
ResolvePluginInstance,
3989539897
Resolver,
3989639898
RenderManifestEntry,

0 commit comments

Comments
 (0)