@twin.org/tools-core 0.0.3-next.2 → 0.0.3-next.21
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/README.md +2 -2
- package/dist/es/index.js +20 -11
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/ITypeScriptToSchemaContext.js +2 -0
- package/dist/es/models/ITypeScriptToSchemaContext.js.map +1 -0
- package/dist/es/models/ITypeScriptToSchemaDiagnostics.js +4 -0
- package/dist/es/models/ITypeScriptToSchemaDiagnostics.js.map +1 -0
- package/dist/es/models/ITypeScriptToSchemaOptions.js +4 -0
- package/dist/es/models/ITypeScriptToSchemaOptions.js.map +1 -0
- package/dist/es/utils/constants.js +43 -0
- package/dist/es/utils/constants.js.map +1 -0
- package/dist/es/utils/diagnosticReporter.js +32 -0
- package/dist/es/utils/diagnosticReporter.js.map +1 -0
- package/dist/es/utils/disallowedTypeGuard.js +151 -0
- package/dist/es/utils/disallowedTypeGuard.js.map +1 -0
- package/dist/es/utils/enum.js +152 -0
- package/dist/es/utils/enum.js.map +1 -0
- package/dist/es/utils/fileUtils.js +130 -0
- package/dist/es/utils/fileUtils.js.map +1 -0
- package/dist/es/utils/importTypeQuerySchemaResolver.js +328 -0
- package/dist/es/utils/importTypeQuerySchemaResolver.js.map +1 -0
- package/dist/es/utils/indexSignaturePatternResolver.js +94 -0
- package/dist/es/utils/indexSignaturePatternResolver.js.map +1 -0
- package/dist/es/utils/intersectionSchemaMerger.js +85 -0
- package/dist/es/utils/intersectionSchemaMerger.js.map +1 -0
- package/dist/es/utils/jsDoc.js +120 -0
- package/dist/es/utils/jsDoc.js.map +1 -0
- package/dist/es/utils/jsonSchemaBuilder.js +3373 -0
- package/dist/es/utils/jsonSchemaBuilder.js.map +1 -0
- package/dist/es/utils/mappedTypeSchemaResolver.js +231 -0
- package/dist/es/utils/mappedTypeSchemaResolver.js.map +1 -0
- package/dist/es/utils/objectTransformer.js +162 -0
- package/dist/es/utils/objectTransformer.js.map +1 -0
- package/dist/es/utils/regEx.js +128 -0
- package/dist/es/utils/regEx.js.map +1 -0
- package/dist/es/utils/resolver.js +164 -0
- package/dist/es/utils/resolver.js.map +1 -0
- package/dist/es/utils/templateLiteralPatternBuilder.js +94 -0
- package/dist/es/utils/templateLiteralPatternBuilder.js.map +1 -0
- package/dist/es/utils/typeScriptToSchema.js +112 -0
- package/dist/es/utils/typeScriptToSchema.js.map +1 -0
- package/dist/es/utils/utilityTypeSchemaMapper.js +412 -0
- package/dist/es/utils/utilityTypeSchemaMapper.js.map +1 -0
- package/dist/types/index.d.ts +20 -11
- package/dist/types/models/ITypeScriptToSchemaContext.d.ts +64 -0
- package/dist/types/models/ITypeScriptToSchemaDiagnostics.d.ts +31 -0
- package/dist/types/models/ITypeScriptToSchemaOptions.d.ts +22 -0
- package/dist/types/utils/constants.d.ts +13 -0
- package/dist/types/utils/diagnosticReporter.d.ts +17 -0
- package/dist/types/utils/disallowedTypeGuard.d.ts +16 -0
- package/dist/types/utils/enum.d.ts +42 -0
- package/dist/types/utils/fileUtils.d.ts +66 -0
- package/dist/types/utils/importTypeQuerySchemaResolver.d.ts +52 -0
- package/dist/types/utils/indexSignaturePatternResolver.d.ts +21 -0
- package/dist/types/utils/intersectionSchemaMerger.d.ts +16 -0
- package/dist/types/utils/jsDoc.d.ts +46 -0
- package/dist/types/utils/jsonSchemaBuilder.d.ts +747 -0
- package/dist/types/utils/mappedTypeSchemaResolver.d.ts +46 -0
- package/dist/types/utils/objectTransformer.d.ts +33 -0
- package/dist/types/utils/regEx.d.ts +24 -0
- package/dist/types/utils/resolver.d.ts +16 -0
- package/dist/types/utils/templateLiteralPatternBuilder.d.ts +12 -0
- package/dist/types/utils/typeScriptToSchema.d.ts +31 -0
- package/dist/types/utils/utilityTypeSchemaMapper.d.ts +92 -0
- package/docs/changelog.md +176 -1
- package/docs/examples.md +87 -1
- package/docs/reference/classes/Constants.md +29 -0
- package/docs/reference/classes/DiagnosticReporter.md +49 -0
- package/docs/reference/classes/DisallowedTypeGuard.md +35 -0
- package/docs/reference/classes/Enum.md +93 -0
- package/docs/reference/classes/FileUtils.md +237 -0
- package/docs/reference/classes/ImportTypeQuerySchemaResolver.md +87 -0
- package/docs/reference/classes/IndexSignaturePatternResolver.md +69 -0
- package/docs/reference/classes/IntersectionSchemaMerger.md +48 -0
- package/docs/reference/classes/JsDoc.md +141 -0
- package/docs/reference/classes/JsonSchemaBuilder.md +2870 -0
- package/docs/reference/classes/MappedTypeSchemaResolver.md +211 -0
- package/docs/reference/classes/ObjectTransformer.md +119 -0
- package/docs/reference/classes/RegEx.md +99 -0
- package/docs/reference/classes/Resolver.md +41 -0
- package/docs/reference/classes/TemplateLiteralPatternBuilder.md +35 -0
- package/docs/reference/classes/TypeScriptToSchema.md +91 -0
- package/docs/reference/classes/UtilityTypeSchemaMapper.md +341 -0
- package/docs/reference/index.md +20 -14
- package/docs/reference/interfaces/ITypeScriptToSchemaContext.md +113 -0
- package/docs/reference/interfaces/ITypeScriptToSchemaDiagnostics.md +55 -0
- package/docs/reference/interfaces/ITypeScriptToSchemaOptions.md +44 -0
- package/locales/en.json +32 -1
- package/package.json +4 -3
- package/dist/es/models/IJsonSchema.js +0 -2
- package/dist/es/models/IJsonSchema.js.map +0 -1
- package/dist/es/models/IOpenApi.js +0 -2
- package/dist/es/models/IOpenApi.js.map +0 -1
- package/dist/es/models/IOpenApiExample.js +0 -4
- package/dist/es/models/IOpenApiExample.js.map +0 -1
- package/dist/es/models/IOpenApiHeader.js +0 -4
- package/dist/es/models/IOpenApiHeader.js.map +0 -1
- package/dist/es/models/IOpenApiPathMethod.js +0 -2
- package/dist/es/models/IOpenApiPathMethod.js.map +0 -1
- package/dist/es/models/IOpenApiResponse.js +0 -2
- package/dist/es/models/IOpenApiResponse.js.map +0 -1
- package/dist/es/models/IOpenApiSecurityScheme.js +0 -4
- package/dist/es/models/IOpenApiSecurityScheme.js.map +0 -1
- package/dist/es/models/IPackageJson.js +0 -4
- package/dist/es/models/IPackageJson.js.map +0 -1
- package/dist/es/models/jsonTypeName.js +0 -2
- package/dist/es/models/jsonTypeName.js.map +0 -1
- package/dist/es/utils/jsonSchemaHelper.js +0 -258
- package/dist/es/utils/jsonSchemaHelper.js.map +0 -1
- package/dist/es/utils/openApiHelper.js +0 -12
- package/dist/es/utils/openApiHelper.js.map +0 -1
- package/dist/types/models/IJsonSchema.d.ts +0 -5
- package/dist/types/models/IOpenApi.d.ts +0 -54
- package/dist/types/models/IOpenApiExample.d.ts +0 -13
- package/dist/types/models/IOpenApiHeader.d.ts +0 -19
- package/dist/types/models/IOpenApiPathMethod.d.ts +0 -65
- package/dist/types/models/IOpenApiResponse.d.ts +0 -32
- package/dist/types/models/IOpenApiSecurityScheme.d.ts +0 -25
- package/dist/types/models/IPackageJson.d.ts +0 -15
- package/dist/types/models/jsonTypeName.d.ts +0 -5
- package/dist/types/utils/jsonSchemaHelper.d.ts +0 -78
- package/dist/types/utils/openApiHelper.d.ts +0 -9
- package/docs/reference/classes/JsonSchemaHelper.md +0 -233
- package/docs/reference/classes/OpenApiHelper.md +0 -21
- package/docs/reference/interfaces/IOpenApi.md +0 -103
- package/docs/reference/interfaces/IOpenApiExample.md +0 -19
- package/docs/reference/interfaces/IOpenApiHeader.md +0 -31
- package/docs/reference/interfaces/IOpenApiPathMethod.md +0 -119
- package/docs/reference/interfaces/IOpenApiResponse.md +0 -35
- package/docs/reference/interfaces/IOpenApiSecurityScheme.md +0 -43
- package/docs/reference/interfaces/IPackageJson.md +0 -23
- package/docs/reference/type-aliases/IJsonSchema.md +0 -5
- package/docs/reference/type-aliases/JsonTypeName.md +0 -5
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as ts from "typescript";
|
|
2
|
+
/**
|
|
3
|
+
* Validates whether a type node is allowed for schema generation.
|
|
4
|
+
*/
|
|
5
|
+
export declare class DisallowedTypeGuard {
|
|
6
|
+
/**
|
|
7
|
+
* Type names that are not supported for JSON schema generation.
|
|
8
|
+
*/
|
|
9
|
+
private static readonly _DISALLOWED_TYPE_NAMES;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a disallowed type name from a type node.
|
|
12
|
+
* @param typeNode The type node to inspect.
|
|
13
|
+
* @returns The disallowed type name, if found.
|
|
14
|
+
*/
|
|
15
|
+
static getDisallowedTypeName(typeNode: ts.TypeNode): string | undefined;
|
|
16
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as ts from "typescript";
|
|
2
|
+
/**
|
|
3
|
+
* Utility methods for extracting enum values from TypeScript AST nodes.
|
|
4
|
+
*
|
|
5
|
+
* Handles three distinct patterns used to define enumerable sets of values:
|
|
6
|
+
* - Native enum declarations: `enum Color { Red = "red" }`
|
|
7
|
+
* - Const-object-with-matching-type patterns: `const Foo = { A: "a" } as const` paired with a type alias named identically to the const
|
|
8
|
+
*/
|
|
9
|
+
export declare class Enum {
|
|
10
|
+
/**
|
|
11
|
+
* Extract enum values from a const-and-type pair where a const object and a type alias share the
|
|
12
|
+
* same name. The const object is located first because its members may carry JSDoc descriptions
|
|
13
|
+
* that would be lost if the type alias were processed in isolation.
|
|
14
|
+
* @param name The name to search for.
|
|
15
|
+
* @param sourceFile The source file to search.
|
|
16
|
+
* @returns The extracted enum entries or undefined when the pattern is not present.
|
|
17
|
+
*/
|
|
18
|
+
static extractEnumValuesFromConstAndType(name: string, sourceFile: ts.SourceFile): {
|
|
19
|
+
value: string | number;
|
|
20
|
+
description?: string;
|
|
21
|
+
}[] | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Extract enum entries from a const object literal.
|
|
24
|
+
* Only properties whose initializer is a string or numeric literal are included.
|
|
25
|
+
* @param objLiteral The object literal expression.
|
|
26
|
+
* @returns The extracted enum entries.
|
|
27
|
+
*/
|
|
28
|
+
static extractEnumEntriesFromConstObject(objLiteral: ts.ObjectLiteralExpression): {
|
|
29
|
+
value: string | number;
|
|
30
|
+
description?: string;
|
|
31
|
+
}[];
|
|
32
|
+
/**
|
|
33
|
+
* Extract enum values from a native TypeScript enum declaration.
|
|
34
|
+
* Numeric members without an explicit initializer are auto-incremented from the previous value.
|
|
35
|
+
* @param declaration The enum declaration.
|
|
36
|
+
* @returns The extracted enum entries.
|
|
37
|
+
*/
|
|
38
|
+
static extractEnumValuesFromEnumDeclaration(declaration: ts.EnumDeclaration): {
|
|
39
|
+
value: string | number;
|
|
40
|
+
description?: string;
|
|
41
|
+
}[];
|
|
42
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility helpers for TypeScript file and directory paths.
|
|
3
|
+
*/
|
|
4
|
+
export declare class FileUtils {
|
|
5
|
+
/**
|
|
6
|
+
* Does the file exist.
|
|
7
|
+
* @param filePath The file path.
|
|
8
|
+
* @returns True if the file exists.
|
|
9
|
+
*/
|
|
10
|
+
static fileExists(filePath: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Read the file.
|
|
13
|
+
* @param filePath The file path.
|
|
14
|
+
* @returns The file contents.
|
|
15
|
+
*/
|
|
16
|
+
static readFile(filePath: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Resolve a path.
|
|
19
|
+
* @param filePath The file path.
|
|
20
|
+
* @returns The resolved path.
|
|
21
|
+
*/
|
|
22
|
+
static resolvePath(filePath: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Get the current working directory.
|
|
25
|
+
* @returns The current working directory.
|
|
26
|
+
*/
|
|
27
|
+
static getCurrentWorkingDirectory(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Normalize path separators for consistent comparisons.
|
|
30
|
+
* @param filePath The file path.
|
|
31
|
+
* @returns The normalized file path.
|
|
32
|
+
*/
|
|
33
|
+
static normalizeFilePath(filePath: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Get the directory portion of a file path.
|
|
36
|
+
* @param filePath The file path.
|
|
37
|
+
* @returns The directory path.
|
|
38
|
+
*/
|
|
39
|
+
static getDirectoryPath(filePath: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Resolve a relative path against a base directory.
|
|
42
|
+
* @param baseDirectory The base directory.
|
|
43
|
+
* @param relativePath The relative path.
|
|
44
|
+
* @returns The resolved path.
|
|
45
|
+
*/
|
|
46
|
+
static resolveRelativePath(baseDirectory: string, relativePath: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve a local import specifier to a TypeScript source file path.
|
|
49
|
+
* @param sourceFilePath The importing source file path.
|
|
50
|
+
* @param importPath The import specifier.
|
|
51
|
+
* @returns The resolved source file path.
|
|
52
|
+
*/
|
|
53
|
+
static resolveImportSourceFilePath(sourceFilePath: string, importPath: string): string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Determine if the provided path includes glob pattern tokens.
|
|
56
|
+
* @param sourceFileOrGlob The direct source file path or glob pattern.
|
|
57
|
+
* @returns True if the value is a glob pattern.
|
|
58
|
+
*/
|
|
59
|
+
static isGlobPattern(sourceFileOrGlob: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Resolve source files from a direct path or a glob pattern.
|
|
62
|
+
* @param sourceFileOrGlob The direct source file path or glob pattern.
|
|
63
|
+
* @returns The resolved source file paths.
|
|
64
|
+
*/
|
|
65
|
+
static resolveSourceFiles(sourceFileOrGlob: string): string[];
|
|
66
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { IJsonSchema } from "@twin.org/tools-models";
|
|
2
|
+
import * as ts from "typescript";
|
|
3
|
+
import type { ITypeScriptToSchemaContext } from "../models/ITypeScriptToSchemaContext.js";
|
|
4
|
+
/**
|
|
5
|
+
* Static helpers for import type and type query schema resolution.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ImportTypeQuerySchemaResolver {
|
|
8
|
+
/**
|
|
9
|
+
* Map import type nodes (e.g. import("pkg").Type) to schema references.
|
|
10
|
+
*/
|
|
11
|
+
static mapImportTypeNodeToSchema(context: ITypeScriptToSchemaContext, typeNode: ts.ImportTypeNode): IJsonSchema | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Map a type query node (typeof expr) to schema by resolving the referenced variable.
|
|
14
|
+
*/
|
|
15
|
+
static mapTypeQueryNodeToSchema(context: ITypeScriptToSchemaContext, typeNode: ts.TypeQueryNode): IJsonSchema;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve import-type references to local or external schema ids.
|
|
18
|
+
*/
|
|
19
|
+
static resolveImportTypeReferenceSchemaId(context: ITypeScriptToSchemaContext, moduleSpecifier: string, typeName: string, title: string): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Resolve a property value from a const object declaration in an imported source file.
|
|
22
|
+
*/
|
|
23
|
+
private static resolveConstObjectProperty;
|
|
24
|
+
/**
|
|
25
|
+
* Find a variable declaration by traversing import and export chains.
|
|
26
|
+
*/
|
|
27
|
+
private static findVariableDeclarationInModuleGraph;
|
|
28
|
+
/**
|
|
29
|
+
* Find an imported symbol reference by local identifier name.
|
|
30
|
+
*/
|
|
31
|
+
private static findImportedValueReference;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve an import declaration module specifier to a source file.
|
|
34
|
+
*/
|
|
35
|
+
private static resolveImportDeclarationSourceFile;
|
|
36
|
+
/**
|
|
37
|
+
* Extract a const-object property value from a declaration initializer.
|
|
38
|
+
*/
|
|
39
|
+
private static extractConstObjectPropertyFromDeclarationInitializer;
|
|
40
|
+
/**
|
|
41
|
+
* Extract a const-object property value from a declaration type annotation.
|
|
42
|
+
*/
|
|
43
|
+
private static extractConstObjectPropertyFromDeclarationType;
|
|
44
|
+
/**
|
|
45
|
+
* Extract a literal value from a type node when possible.
|
|
46
|
+
*/
|
|
47
|
+
private static extractLiteralValueFromTypeNode;
|
|
48
|
+
/**
|
|
49
|
+
* Extract a referenced type name from an import type qualifier.
|
|
50
|
+
*/
|
|
51
|
+
private static extractImportTypeName;
|
|
52
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as ts from "typescript";
|
|
2
|
+
import type { ITypeScriptToSchemaContext } from "../models/ITypeScriptToSchemaContext.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves regex patterns for index signature key types.
|
|
5
|
+
*/
|
|
6
|
+
export declare class IndexSignaturePatternResolver {
|
|
7
|
+
/**
|
|
8
|
+
* Determine whether an index signature can be represented as JSON object additionalProperties.
|
|
9
|
+
* @param member The index signature declaration.
|
|
10
|
+
* @returns True if supported.
|
|
11
|
+
*/
|
|
12
|
+
static isSupportedIndexSignature(member: ts.IndexSignatureDeclaration): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Extract a regex pattern for an index signature key type when representable.
|
|
15
|
+
* @param context The generation context.
|
|
16
|
+
* @param member The index signature declaration.
|
|
17
|
+
* @param getTypeParameterBinding Callback for resolving generic bindings.
|
|
18
|
+
* @returns The property-name pattern, if derivable.
|
|
19
|
+
*/
|
|
20
|
+
static extractIndexSignaturePattern(context: ITypeScriptToSchemaContext, member: ts.IndexSignatureDeclaration, getTypeParameterBinding: (context: ITypeScriptToSchemaContext, typeName: string) => ts.TypeNode | null | undefined): string | undefined;
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IJsonSchema } from "@twin.org/tools-models";
|
|
2
|
+
import type { ITypeScriptToSchemaContext } from "../models/ITypeScriptToSchemaContext.js";
|
|
3
|
+
/**
|
|
4
|
+
* Merges compatible object intersections into a single JSON schema object.
|
|
5
|
+
*/
|
|
6
|
+
export declare class IntersectionSchemaMerger {
|
|
7
|
+
/**
|
|
8
|
+
* Merge simple object intersection parts into a single object schema.
|
|
9
|
+
* Supports local/known object refs by expanding them before merge.
|
|
10
|
+
* @param context The generation context.
|
|
11
|
+
* @param schemas The mapped intersection schemas.
|
|
12
|
+
* @param toInlineUtilityObjectSchema Callback for converting referenced schemas to inline forms.
|
|
13
|
+
* @returns The merged schema, or undefined when merge is not safe.
|
|
14
|
+
*/
|
|
15
|
+
static mergeIntersectionObjectSchemas(context: ITypeScriptToSchemaContext, schemas: IJsonSchema[], toInlineUtilityObjectSchema: (schema: IJsonSchema) => IJsonSchema): IJsonSchema | undefined;
|
|
16
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as ts from "typescript";
|
|
2
|
+
/**
|
|
3
|
+
* General-purpose utility methods for working with JsDoc.
|
|
4
|
+
*/
|
|
5
|
+
export declare class JsDoc {
|
|
6
|
+
/**
|
|
7
|
+
* Extract the JSDoc description comment for an AST node.
|
|
8
|
+
* Only top-level JSDoc block comments are considered; inline tags are ignored.
|
|
9
|
+
* @param node The node to inspect.
|
|
10
|
+
* @returns The trimmed description text, or undefined when absent.
|
|
11
|
+
*/
|
|
12
|
+
static getNodeJsDocDescription(node: ts.Node): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Convert a JSDoc tag's comment portion to a plain text string.
|
|
15
|
+
* JSDoc tag comments may be plain strings or arrays of link/text parts.
|
|
16
|
+
* @param jsDocTag The JSDoc tag.
|
|
17
|
+
* @returns The comment text, or undefined when absent.
|
|
18
|
+
*/
|
|
19
|
+
static getJSDocTagCommentText(jsDocTag: ts.JSDocTag): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Read all custom JSDoc tags matching a tag name from a node and convert them to key/value pairs.
|
|
22
|
+
* Each matching tag's comment must be in the form "key: value"; entries that do not follow this
|
|
23
|
+
* convention are silently skipped.
|
|
24
|
+
* @param node The node to inspect.
|
|
25
|
+
* @param tagName The tag name to filter by (e.g., 'json-schema').
|
|
26
|
+
* @returns The extracted key/value pairs.
|
|
27
|
+
*/
|
|
28
|
+
static getNodeTags(node: ts.Node, tagName: string): {
|
|
29
|
+
[id: string]: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Read the plain comment text for the first matching JSDoc tag on a node.
|
|
33
|
+
* @param node The node to inspect.
|
|
34
|
+
* @param tagName The tag name to filter by (e.g., 'default').
|
|
35
|
+
* @returns The trimmed comment text, or undefined when absent.
|
|
36
|
+
*/
|
|
37
|
+
static getNodeTagComment(node: ts.Node, tagName: string): string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Parse a custom JSDoc tag value into JSON-compatible data.
|
|
40
|
+
* Values that begin with a JSON token character ({, [, ", true, false, null) or look like a
|
|
41
|
+
* number are parsed with JSON.parse. All other values are returned as plain strings.
|
|
42
|
+
* @param value The raw value text.
|
|
43
|
+
* @returns The parsed value.
|
|
44
|
+
*/
|
|
45
|
+
static parseTagValue(value: string): unknown;
|
|
46
|
+
}
|