Created
December 25, 2025 15:34
-
-
Save pedrovhb/9e1ed4b56d90b60afd7957d6c58a2389 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "http://json-schema.org/draft-07/schema#", | |
| "title": "Deno Doc JSON Output", | |
| "description": "JSON schema for the output of `deno doc --json`", | |
| "type": "object", | |
| "required": ["version", "nodes"], | |
| "properties": { | |
| "version": { | |
| "type": "integer", | |
| "const": 1, | |
| "description": "Schema version" | |
| }, | |
| "nodes": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/DocNode" } | |
| } | |
| }, | |
| "$defs": { | |
| "DocNode": { | |
| "type": "object", | |
| "required": ["name", "location", "declarationKind", "kind"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "isDefault": { "type": "boolean" }, | |
| "location": { "$ref": "#/$defs/Location" }, | |
| "declarationKind": { "$ref": "#/$defs/DeclarationKind" }, | |
| "jsDoc": { "$ref": "#/$defs/JsDoc" }, | |
| "kind": { "$ref": "#/$defs/DocNodeKind" } | |
| }, | |
| "allOf": [ | |
| { | |
| "if": { "properties": { "kind": { "const": "function" } } }, | |
| "then": { | |
| "properties": { "functionDef": { "$ref": "#/$defs/FunctionDef" } }, | |
| "required": ["functionDef"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "variable" } } }, | |
| "then": { | |
| "properties": { "variableDef": { "$ref": "#/$defs/VariableDef" } }, | |
| "required": ["variableDef"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "class" } } }, | |
| "then": { | |
| "properties": { "classDef": { "$ref": "#/$defs/ClassDef" } }, | |
| "required": ["classDef"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "enum" } } }, | |
| "then": { | |
| "properties": { "enumDef": { "$ref": "#/$defs/EnumDef" } }, | |
| "required": ["enumDef"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "interface" } } }, | |
| "then": { | |
| "properties": { | |
| "interfaceDef": { "$ref": "#/$defs/InterfaceDef" } | |
| }, | |
| "required": ["interfaceDef"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "typeAlias" } } }, | |
| "then": { | |
| "properties": { | |
| "typeAliasDef": { "$ref": "#/$defs/TypeAliasDef" } | |
| }, | |
| "required": ["typeAliasDef"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "namespace" } } }, | |
| "then": { | |
| "properties": { | |
| "namespaceDef": { "$ref": "#/$defs/NamespaceDef" } | |
| }, | |
| "required": ["namespaceDef"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "import" } } }, | |
| "then": { | |
| "properties": { "importDef": { "$ref": "#/$defs/ImportDef" } }, | |
| "required": ["importDef"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "reference" } } }, | |
| "then": { | |
| "properties": { | |
| "referenceDef": { "$ref": "#/$defs/ReferenceDef" } | |
| }, | |
| "required": ["referenceDef"] | |
| } | |
| } | |
| ] | |
| }, | |
| "DocNodeKind": { | |
| "type": "string", | |
| "enum": [ | |
| "class", | |
| "enum", | |
| "function", | |
| "import", | |
| "interface", | |
| "moduleDoc", | |
| "namespace", | |
| "reference", | |
| "typeAlias", | |
| "variable" | |
| ] | |
| }, | |
| "DeclarationKind": { | |
| "type": "string", | |
| "enum": ["private", "declare", "export"] | |
| }, | |
| "Location": { | |
| "type": "object", | |
| "required": ["filename", "line", "col"], | |
| "properties": { | |
| "filename": { "type": "string" }, | |
| "line": { "type": "integer", "description": "1-indexed line number" }, | |
| "col": { "type": "integer", "description": "0-indexed column number" }, | |
| "byteIndex": { | |
| "type": "integer", | |
| "description": "0-indexed byte offset", | |
| "default": 0 | |
| } | |
| } | |
| }, | |
| "JsDoc": { | |
| "type": "object", | |
| "properties": { | |
| "doc": { "type": "string", "description": "Main documentation text" }, | |
| "tags": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/JsDocTag" }, | |
| "default": [] | |
| } | |
| } | |
| }, | |
| "JsDocTag": { | |
| "type": "object", | |
| "required": ["kind"], | |
| "properties": { | |
| "kind": { | |
| "type": "string", | |
| "enum": [ | |
| "callback", | |
| "category", | |
| "constructor", | |
| "default", | |
| "deprecated", | |
| "enum", | |
| "example", | |
| "experimental", | |
| "extends", | |
| "ignore", | |
| "internal", | |
| "module", | |
| "param", | |
| "public", | |
| "private", | |
| "property", | |
| "protected", | |
| "readonly", | |
| "return", | |
| "tags", | |
| "template", | |
| "this", | |
| "throws", | |
| "typedef", | |
| "type", | |
| "see", | |
| "since", | |
| "unsupported" | |
| ] | |
| } | |
| }, | |
| "allOf": [ | |
| { | |
| "if": { "properties": { "kind": { "const": "callback" } } }, | |
| "then": { | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| }, | |
| "required": ["name"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "category" } } }, | |
| "then": { | |
| "properties": { "doc": { "type": "string" } }, | |
| "required": ["doc"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "default" } } }, | |
| "then": { | |
| "properties": { | |
| "value": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| }, | |
| "required": ["value"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "deprecated" } } }, | |
| "then": { "properties": { "doc": { "type": "string" } } } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "enum" } } }, | |
| "then": { | |
| "properties": { | |
| "type": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| }, | |
| "required": ["type"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "example" } } }, | |
| "then": { | |
| "properties": { "doc": { "type": "string" } }, | |
| "required": ["doc"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "extends" } } }, | |
| "then": { | |
| "properties": { | |
| "type": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| }, | |
| "required": ["type"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "module" } } }, | |
| "then": { "properties": { "name": { "type": "string" } } } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "param" } } }, | |
| "then": { | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "type": { "type": "string" }, | |
| "optional": { "type": "boolean" }, | |
| "default": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| }, | |
| "required": ["name"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "property" } } }, | |
| "then": { | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "type": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| }, | |
| "required": ["name", "type"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "return" } } }, | |
| "then": { | |
| "properties": { | |
| "type": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| } | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "tags" } } }, | |
| "then": { | |
| "properties": { | |
| "tags": { "type": "array", "items": { "type": "string" } } | |
| }, | |
| "required": ["tags"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "template" } } }, | |
| "then": { | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| }, | |
| "required": ["name"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "this" } } }, | |
| "then": { | |
| "properties": { | |
| "type": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| }, | |
| "required": ["type"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "throws" } } }, | |
| "then": { | |
| "properties": { | |
| "type": { "type": ["string", "null"] }, | |
| "doc": { "type": "string" } | |
| } | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "typedef" } } }, | |
| "then": { | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "type": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| }, | |
| "required": ["name", "type"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "type" } } }, | |
| "then": { | |
| "properties": { | |
| "type": { "type": "string" }, | |
| "doc": { "type": "string" } | |
| }, | |
| "required": ["type"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "see" } } }, | |
| "then": { | |
| "properties": { "doc": { "type": "string" } }, | |
| "required": ["doc"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "since" } } }, | |
| "then": { | |
| "properties": { "doc": { "type": "string" } }, | |
| "required": ["doc"] | |
| } | |
| }, | |
| { | |
| "if": { "properties": { "kind": { "const": "unsupported" } } }, | |
| "then": { | |
| "properties": { "value": { "type": "string" } }, | |
| "required": ["value"] | |
| } | |
| } | |
| ] | |
| }, | |
| "FunctionDef": { | |
| "type": "object", | |
| "required": ["params", "isAsync", "isGenerator", "typeParams"], | |
| "properties": { | |
| "defName": { | |
| "type": "string", | |
| "description": "Set when function is a default export with a name" | |
| }, | |
| "params": { "type": "array", "items": { "$ref": "#/$defs/ParamDef" } }, | |
| "returnType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "hasBody": { "type": "boolean", "default": false }, | |
| "isAsync": { "type": "boolean" }, | |
| "isGenerator": { "type": "boolean" }, | |
| "typeParams": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeParamDef" } | |
| }, | |
| "decorators": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/DecoratorDef" }, | |
| "default": [] | |
| } | |
| } | |
| }, | |
| "VariableDef": { | |
| "type": "object", | |
| "required": ["kind"], | |
| "properties": { | |
| "tsType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "kind": { "type": "string", "enum": ["var", "let", "const"] } | |
| } | |
| }, | |
| "ClassDef": { | |
| "type": "object", | |
| "required": [ | |
| "isAbstract", | |
| "constructors", | |
| "properties", | |
| "indexSignatures", | |
| "methods", | |
| "implements", | |
| "typeParams", | |
| "superTypeParams" | |
| ], | |
| "properties": { | |
| "defName": { "type": "string" }, | |
| "isAbstract": { "type": "boolean" }, | |
| "constructors": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/ClassConstructorDef" } | |
| }, | |
| "properties": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/ClassPropertyDef" } | |
| }, | |
| "indexSignatures": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/IndexSignatureDef" } | |
| }, | |
| "methods": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/ClassMethodDef" } | |
| }, | |
| "extends": { "type": ["string", "null"] }, | |
| "implements": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeDef" } | |
| }, | |
| "typeParams": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeParamDef" } | |
| }, | |
| "superTypeParams": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeDef" } | |
| }, | |
| "decorators": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/DecoratorDef" }, | |
| "default": [] | |
| } | |
| } | |
| }, | |
| "ClassConstructorDef": { | |
| "type": "object", | |
| "required": ["accessibility", "name", "params", "location"], | |
| "properties": { | |
| "jsDoc": { "$ref": "#/$defs/JsDoc" }, | |
| "accessibility": { "$ref": "#/$defs/Accessibility" }, | |
| "isOptional": { "type": "boolean", "default": false }, | |
| "hasBody": { "type": "boolean", "default": false }, | |
| "name": { "type": "string" }, | |
| "params": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/ClassConstructorParamDef" } | |
| }, | |
| "location": { "$ref": "#/$defs/Location" } | |
| } | |
| }, | |
| "ClassConstructorParamDef": { | |
| "type": "object", | |
| "required": ["tsType"], | |
| "allOf": [{ "$ref": "#/$defs/ParamDef" }], | |
| "properties": { | |
| "accessibility": { "$ref": "#/$defs/Accessibility" }, | |
| "isOverride": { "type": "boolean", "default": false }, | |
| "readonly": { "type": "boolean", "default": false } | |
| } | |
| }, | |
| "ClassPropertyDef": { | |
| "type": "object", | |
| "required": [ | |
| "readonly", | |
| "accessibility", | |
| "optional", | |
| "isAbstract", | |
| "isStatic", | |
| "name", | |
| "location" | |
| ], | |
| "properties": { | |
| "jsDoc": { "$ref": "#/$defs/JsDoc" }, | |
| "tsType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "readonly": { "type": "boolean" }, | |
| "accessibility": { "$ref": "#/$defs/Accessibility" }, | |
| "decorators": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/DecoratorDef" }, | |
| "default": [] | |
| }, | |
| "optional": { "type": "boolean" }, | |
| "isAbstract": { "type": "boolean" }, | |
| "isStatic": { "type": "boolean" }, | |
| "isOverride": { "type": "boolean", "default": false }, | |
| "name": { "type": "string" }, | |
| "location": { "$ref": "#/$defs/Location" } | |
| } | |
| }, | |
| "ClassMethodDef": { | |
| "type": "object", | |
| "required": [ | |
| "accessibility", | |
| "optional", | |
| "isAbstract", | |
| "isStatic", | |
| "name", | |
| "kind", | |
| "functionDef", | |
| "location" | |
| ], | |
| "properties": { | |
| "jsDoc": { "$ref": "#/$defs/JsDoc" }, | |
| "accessibility": { "$ref": "#/$defs/Accessibility" }, | |
| "optional": { "type": "boolean" }, | |
| "isAbstract": { "type": "boolean" }, | |
| "isStatic": { "type": "boolean" }, | |
| "isOverride": { "type": "boolean", "default": false }, | |
| "name": { "type": "string" }, | |
| "kind": { "$ref": "#/$defs/MethodKind" }, | |
| "functionDef": { "$ref": "#/$defs/FunctionDef" }, | |
| "location": { "$ref": "#/$defs/Location" } | |
| } | |
| }, | |
| "EnumDef": { | |
| "type": "object", | |
| "required": ["members"], | |
| "properties": { | |
| "members": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/EnumMemberDef" } | |
| } | |
| } | |
| }, | |
| "EnumMemberDef": { | |
| "type": "object", | |
| "required": ["name", "location"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "init": { "$ref": "#/$defs/TsTypeDef" }, | |
| "jsDoc": { "$ref": "#/$defs/JsDoc" }, | |
| "location": { "$ref": "#/$defs/Location" } | |
| } | |
| }, | |
| "InterfaceDef": { | |
| "type": "object", | |
| "required": [ | |
| "extends", | |
| "methods", | |
| "properties", | |
| "callSignatures", | |
| "indexSignatures", | |
| "typeParams" | |
| ], | |
| "properties": { | |
| "defName": { "type": "string" }, | |
| "extends": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeDef" } | |
| }, | |
| "constructors": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/ConstructorDef" }, | |
| "default": [] | |
| }, | |
| "methods": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/MethodDef" } | |
| }, | |
| "properties": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/PropertyDef" } | |
| }, | |
| "callSignatures": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/CallSignatureDef" } | |
| }, | |
| "indexSignatures": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/IndexSignatureDef" } | |
| }, | |
| "typeParams": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeParamDef" } | |
| } | |
| } | |
| }, | |
| "TypeAliasDef": { | |
| "type": "object", | |
| "required": ["tsType", "typeParams"], | |
| "properties": { | |
| "tsType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "typeParams": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeParamDef" } | |
| } | |
| } | |
| }, | |
| "NamespaceDef": { | |
| "type": "object", | |
| "required": ["elements"], | |
| "properties": { | |
| "elements": { "type": "array", "items": { "$ref": "#/$defs/DocNode" } } | |
| } | |
| }, | |
| "ImportDef": { | |
| "type": "object", | |
| "required": ["src"], | |
| "properties": { | |
| "src": { "type": "string" }, | |
| "imported": { "type": "string" } | |
| } | |
| }, | |
| "ReferenceDef": { | |
| "type": "object", | |
| "required": ["target"], | |
| "properties": { | |
| "target": { "$ref": "#/$defs/Location" } | |
| } | |
| }, | |
| "TsTypeDef": { | |
| "type": "object", | |
| "required": ["repr"], | |
| "properties": { | |
| "repr": { "type": "string" }, | |
| "kind": { "$ref": "#/$defs/TsTypeDefKind" }, | |
| "keyword": { "type": "string" }, | |
| "literal": { "$ref": "#/$defs/LiteralDef" }, | |
| "typeRef": { "$ref": "#/$defs/TsTypeRefDef" }, | |
| "union": { | |
| "oneOf": [ | |
| { "type": "array", "items": { "$ref": "#/$defs/TsTypeDef" } }, | |
| { "type": "null" } | |
| ] | |
| }, | |
| "intersection": { | |
| "oneOf": [ | |
| { "type": "array", "items": { "$ref": "#/$defs/TsTypeDef" } }, | |
| { "type": "null" } | |
| ] | |
| }, | |
| "array": { "$ref": "#/$defs/TsTypeDef" }, | |
| "tuple": { | |
| "oneOf": [ | |
| { "type": "array", "items": { "$ref": "#/$defs/TsTypeDef" } }, | |
| { "type": "null" } | |
| ] | |
| }, | |
| "typeOperator": { "$ref": "#/$defs/TsTypeOperatorDef" }, | |
| "parenthesized": { "$ref": "#/$defs/TsTypeDef" }, | |
| "rest": { "$ref": "#/$defs/TsTypeDef" }, | |
| "optional": { "$ref": "#/$defs/TsTypeDef" }, | |
| "typeQuery": { "type": "string" }, | |
| "this": { "type": "boolean" }, | |
| "fnOrConstructor": { "$ref": "#/$defs/TsFnOrConstructorDef" }, | |
| "conditionalType": { "$ref": "#/$defs/TsConditionalDef" }, | |
| "infer": { "$ref": "#/$defs/TsInferDef" }, | |
| "indexedAccess": { "$ref": "#/$defs/TsIndexedAccessDef" }, | |
| "mappedType": { "$ref": "#/$defs/TsMappedTypeDef" }, | |
| "typeLiteral": { "$ref": "#/$defs/TsTypeLiteralDef" }, | |
| "typePredicate": { "$ref": "#/$defs/TsTypePredicateDef" }, | |
| "importType": { "$ref": "#/$defs/TsImportTypeDef" } | |
| } | |
| }, | |
| "TsTypeDefKind": { | |
| "type": "string", | |
| "enum": [ | |
| "keyword", | |
| "literal", | |
| "typeRef", | |
| "union", | |
| "intersection", | |
| "array", | |
| "tuple", | |
| "typeOperator", | |
| "parenthesized", | |
| "rest", | |
| "optional", | |
| "typeQuery", | |
| "this", | |
| "fnOrConstructor", | |
| "conditional", | |
| "infer", | |
| "indexedAccess", | |
| "mapped", | |
| "typeLiteral", | |
| "typePredicate", | |
| "importType" | |
| ] | |
| }, | |
| "TsTypeRefDef": { | |
| "type": "object", | |
| "required": ["typeName"], | |
| "properties": { | |
| "typeParams": { | |
| "oneOf": [ | |
| { "type": "array", "items": { "$ref": "#/$defs/TsTypeDef" } }, | |
| { "type": "null" } | |
| ] | |
| }, | |
| "typeName": { "type": "string" } | |
| } | |
| }, | |
| "LiteralDef": { | |
| "type": "object", | |
| "required": ["kind"], | |
| "properties": { | |
| "kind": { | |
| "type": "string", | |
| "enum": ["number", "string", "template", "boolean", "bigInt"] | |
| }, | |
| "number": { "type": "number" }, | |
| "string": { "type": "string" }, | |
| "tsTypes": { | |
| "oneOf": [ | |
| { "type": "array", "items": { "$ref": "#/$defs/TsTypeDef" } }, | |
| { "type": "null" } | |
| ] | |
| }, | |
| "boolean": { "type": "boolean" } | |
| } | |
| }, | |
| "TsTypeOperatorDef": { | |
| "type": "object", | |
| "required": ["operator", "tsType"], | |
| "properties": { | |
| "operator": { "type": "string" }, | |
| "tsType": { "$ref": "#/$defs/TsTypeDef" } | |
| } | |
| }, | |
| "TsFnOrConstructorDef": { | |
| "type": "object", | |
| "required": ["constructor", "tsType", "params", "typeParams"], | |
| "properties": { | |
| "constructor": { "type": "boolean" }, | |
| "tsType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "params": { "type": "array", "items": { "$ref": "#/$defs/ParamDef" } }, | |
| "typeParams": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeParamDef" } | |
| } | |
| } | |
| }, | |
| "TsConditionalDef": { | |
| "type": "object", | |
| "required": ["checkType", "extendsType", "trueType", "falseType"], | |
| "properties": { | |
| "checkType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "extendsType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "trueType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "falseType": { "$ref": "#/$defs/TsTypeDef" } | |
| } | |
| }, | |
| "TsInferDef": { | |
| "type": "object", | |
| "required": ["typeParam"], | |
| "properties": { | |
| "typeParam": { "$ref": "#/$defs/TsTypeParamDef" } | |
| } | |
| }, | |
| "TsImportTypeDef": { | |
| "type": "object", | |
| "required": ["specifier"], | |
| "properties": { | |
| "specifier": { "type": "string" }, | |
| "qualifier": { "type": "string" }, | |
| "typeParams": { | |
| "oneOf": [ | |
| { "type": "array", "items": { "$ref": "#/$defs/TsTypeDef" } }, | |
| { "type": "null" } | |
| ] | |
| } | |
| } | |
| }, | |
| "TsIndexedAccessDef": { | |
| "type": "object", | |
| "required": ["readonly", "objType", "indexType"], | |
| "properties": { | |
| "readonly": { "type": "boolean" }, | |
| "objType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "indexType": { "$ref": "#/$defs/TsTypeDef" } | |
| } | |
| }, | |
| "TsMappedTypeDef": { | |
| "type": "object", | |
| "required": ["typeParam"], | |
| "properties": { | |
| "readonly": { "$ref": "#/$defs/TruePlusMinus" }, | |
| "typeParam": { "$ref": "#/$defs/TsTypeParamDef" }, | |
| "nameType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "optional": { "$ref": "#/$defs/TruePlusMinus" }, | |
| "tsType": { "$ref": "#/$defs/TsTypeDef" } | |
| } | |
| }, | |
| "TruePlusMinus": { | |
| "oneOf": [ | |
| { "type": "boolean", "const": true }, | |
| { "type": "string", "enum": ["+", "-"] } | |
| ] | |
| }, | |
| "TsTypeLiteralDef": { | |
| "type": "object", | |
| "properties": { | |
| "constructors": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/ConstructorDef" }, | |
| "default": [] | |
| }, | |
| "methods": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/MethodDef" } | |
| }, | |
| "properties": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/PropertyDef" } | |
| }, | |
| "callSignatures": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/CallSignatureDef" } | |
| }, | |
| "indexSignatures": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/IndexSignatureDef" } | |
| } | |
| } | |
| }, | |
| "TsTypePredicateDef": { | |
| "type": "object", | |
| "required": ["asserts", "param"], | |
| "properties": { | |
| "asserts": { "type": "boolean" }, | |
| "param": { "$ref": "#/$defs/ThisOrIdent" }, | |
| "type": { "$ref": "#/$defs/TsTypeDef" } | |
| } | |
| }, | |
| "ThisOrIdent": { | |
| "type": "object", | |
| "required": ["type"], | |
| "properties": { | |
| "type": { "type": "string", "enum": ["this", "identifier"] }, | |
| "name": { | |
| "type": "string", | |
| "description": "Only present when type is 'identifier'" | |
| } | |
| } | |
| }, | |
| "TsTypeParamDef": { | |
| "type": "object", | |
| "required": ["name"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "constraint": { "$ref": "#/$defs/TsTypeDef" }, | |
| "default": { "$ref": "#/$defs/TsTypeDef" } | |
| } | |
| }, | |
| "ParamDef": { | |
| "type": "object", | |
| "required": ["kind"], | |
| "properties": { | |
| "kind": { | |
| "type": "string", | |
| "enum": ["array", "assign", "identifier", "object", "rest"] | |
| }, | |
| "decorators": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/DecoratorDef" }, | |
| "default": [] | |
| }, | |
| "tsType": { | |
| "oneOf": [{ "$ref": "#/$defs/TsTypeDef" }, { "type": "null" }] | |
| }, | |
| "name": { | |
| "type": "string", | |
| "description": "Present for 'identifier' kind" | |
| }, | |
| "optional": { | |
| "type": "boolean", | |
| "description": "Present for 'identifier', 'array', 'object' kinds" | |
| }, | |
| "elements": { | |
| "type": "array", | |
| "items": { | |
| "oneOf": [{ "$ref": "#/$defs/ParamDef" }, { "type": "null" }] | |
| }, | |
| "description": "Present for 'array' kind" | |
| }, | |
| "left": { | |
| "$ref": "#/$defs/ParamDef", | |
| "description": "Present for 'assign' kind" | |
| }, | |
| "right": { | |
| "type": "string", | |
| "description": "Present for 'assign' kind" | |
| }, | |
| "props": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/ObjectPatPropDef" }, | |
| "description": "Present for 'object' kind" | |
| }, | |
| "arg": { | |
| "$ref": "#/$defs/ParamDef", | |
| "description": "Present for 'rest' kind" | |
| } | |
| } | |
| }, | |
| "ObjectPatPropDef": { | |
| "type": "object", | |
| "required": ["kind"], | |
| "properties": { | |
| "kind": { "type": "string", "enum": ["assign", "keyValue", "rest"] }, | |
| "key": { | |
| "type": "string", | |
| "description": "Present for 'assign' and 'keyValue' kinds" | |
| }, | |
| "value": { | |
| "oneOf": [{ "type": "string" }, { "$ref": "#/$defs/ParamDef" }], | |
| "description": "String for 'assign', ParamDef for 'keyValue'" | |
| }, | |
| "arg": { | |
| "$ref": "#/$defs/ParamDef", | |
| "description": "Present for 'rest' kind" | |
| } | |
| } | |
| }, | |
| "DecoratorDef": { | |
| "type": "object", | |
| "required": ["name", "location"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "args": { | |
| "type": "array", | |
| "items": { "type": "string" }, | |
| "default": [] | |
| }, | |
| "location": { "$ref": "#/$defs/Location" } | |
| } | |
| }, | |
| "ConstructorDef": { | |
| "type": "object", | |
| "required": ["params", "typeParams", "location"], | |
| "properties": { | |
| "jsDoc": { "$ref": "#/$defs/JsDoc" }, | |
| "params": { "type": "array", "items": { "$ref": "#/$defs/ParamDef" } }, | |
| "returnType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "typeParams": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeParamDef" } | |
| }, | |
| "location": { "$ref": "#/$defs/Location" } | |
| } | |
| }, | |
| "MethodDef": { | |
| "type": "object", | |
| "required": ["name", "kind", "params", "optional", "typeParams"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "jsDoc": { "$ref": "#/$defs/JsDoc" }, | |
| "kind": { "$ref": "#/$defs/MethodKind" }, | |
| "location": { "$ref": "#/$defs/Location" }, | |
| "params": { "type": "array", "items": { "$ref": "#/$defs/ParamDef" } }, | |
| "computed": { "type": "boolean", "default": false }, | |
| "optional": { "type": "boolean" }, | |
| "returnType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "typeParams": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeParamDef" } | |
| } | |
| } | |
| }, | |
| "PropertyDef": { | |
| "type": "object", | |
| "required": ["name", "computed", "optional"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "jsDoc": { "$ref": "#/$defs/JsDoc" }, | |
| "location": { "$ref": "#/$defs/Location" }, | |
| "params": { "type": "array", "items": { "$ref": "#/$defs/ParamDef" } }, | |
| "readonly": { "type": "boolean", "default": false }, | |
| "computed": { "type": "boolean" }, | |
| "optional": { "type": "boolean" }, | |
| "tsType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "typeParams": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeParamDef" } | |
| } | |
| } | |
| }, | |
| "CallSignatureDef": { | |
| "type": "object", | |
| "required": ["params", "typeParams"], | |
| "properties": { | |
| "jsDoc": { "$ref": "#/$defs/JsDoc" }, | |
| "location": { "$ref": "#/$defs/Location" }, | |
| "params": { "type": "array", "items": { "$ref": "#/$defs/ParamDef" } }, | |
| "tsType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "typeParams": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/TsTypeParamDef" } | |
| } | |
| } | |
| }, | |
| "IndexSignatureDef": { | |
| "type": "object", | |
| "required": ["readonly", "params"], | |
| "properties": { | |
| "jsDoc": { "$ref": "#/$defs/JsDoc" }, | |
| "readonly": { "type": "boolean" }, | |
| "params": { "type": "array", "items": { "$ref": "#/$defs/ParamDef" } }, | |
| "tsType": { "$ref": "#/$defs/TsTypeDef" }, | |
| "location": { "$ref": "#/$defs/Location" } | |
| } | |
| }, | |
| "Accessibility": { | |
| "type": ["string", "null"], | |
| "enum": ["public", "protected", "private", null] | |
| }, | |
| "MethodKind": { | |
| "type": "string", | |
| "enum": ["method", "getter", "setter"] | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment