Skip to content

⬅️ Back to Table of Contents

📄 rule-schema-to-typescript-types/src/types

📊 Analysis Summary

Metric Count
📐 Interfaces 7
📑 Type Aliases 2

📚 Table of Contents

🛠️ File Location:

📂 packages/rule-schema-to-typescript-types/src/types.ts

Interfaces

BaseSchemaASTNode

Interface Code
export interface BaseSchemaASTNode {
  readonly commentLines: string[];
}

Properties

Name Type Optional Description
commentLines string[] not shown

ArrayAST

Interface Code
export interface ArrayAST extends BaseSchemaASTNode {
  readonly elementType: SchemaAST;
  readonly type: 'array';
}

Properties

Name Type Optional Description
elementType SchemaAST not shown
type 'array' not shown

LiteralAST

Interface Code
export interface LiteralAST extends BaseSchemaASTNode {
  readonly code: string;
  readonly type: 'literal';
}

Properties

Name Type Optional Description
code string not shown
type 'literal' not shown

ObjectAST

Interface Code
export interface ObjectAST extends BaseSchemaASTNode {
  readonly indexSignature: SchemaAST | null;
  readonly properties: {
    readonly name: string;
    readonly optional: boolean;
    readonly type: SchemaAST;
  }[];
  readonly type: 'object';
}

Properties

Name Type Optional Description
indexSignature SchemaAST \| null not shown
properties { readonly name: string; readonly optional: boolean; readonly type: SchemaAST... not shown
type 'object' not shown

TupleAST

Interface Code
export interface TupleAST extends BaseSchemaASTNode {
  readonly elements: SchemaAST[];
  readonly spreadType: SchemaAST | null;
  readonly type: 'tuple';
}

Properties

Name Type Optional Description
elements SchemaAST[] not shown
spreadType SchemaAST \| null not shown
type 'tuple' not shown

TypeReferenceAST

Interface Code
export interface TypeReferenceAST extends BaseSchemaASTNode {
  readonly type: 'type-reference';
  readonly typeName: string;
}

Properties

Name Type Optional Description
type 'type-reference' not shown
typeName string not shown

UnionAST

Interface Code
export interface UnionAST extends BaseSchemaASTNode {
  readonly elements: SchemaAST[];
  readonly type: 'union';
}

Properties

Name Type Optional Description
elements SchemaAST[] not shown
type 'union' not shown

Type Aliases

RefMap

/* * Maps ref paths to generated type names. /

type RefMap = ReadonlyMap<
  // ref path
  string,
  // type name
  string
>;

SchemaAST

/* * Minimal representation of the nodes in a schema being compiled to types. /

type SchemaAST = ArrayAST | LiteralAST | ObjectAST | TupleAST | TypeReferenceAST | UnionAST;

Generated by Syntax Scribe