1 | import * as ts from 'typescript';
|
2 | import { Component, AbstractComponent } from '../utils/component';
|
3 | import { Reflection } from '../models/reflections/abstract';
|
4 | import { Type } from '../models/types/abstract';
|
5 | import { Context } from './context';
|
6 | import { Converter } from './converter';
|
7 | export { Component };
|
8 | export declare abstract class ConverterComponent extends AbstractComponent<Converter> {
|
9 | }
|
10 | export declare abstract class ConverterNodeComponent<T extends ts.Node> extends ConverterComponent {
|
11 | abstract supports: ts.SyntaxKind[];
|
12 | abstract convert(context: Context, node: T): Reflection | undefined;
|
13 | }
|
14 | export declare abstract class ConverterTypeComponent extends ConverterComponent {
|
15 | priority: number;
|
16 | }
|
17 | export interface TypeConverter<T extends ts.Type, N extends ts.Node> extends ConverterTypeComponent, TypeTypeConverter<T>, TypeNodeConverter<T, N> {
|
18 | }
|
19 | export interface TypeTypeConverter<T extends ts.Type> extends ConverterTypeComponent {
|
20 | supportsType(context: Context, type: T): boolean;
|
21 | convertType(context: Context, type: T): Type | undefined;
|
22 | }
|
23 | export interface TypeNodeConverter<T extends ts.Type, N extends ts.Node> extends ConverterTypeComponent {
|
24 | supportsNode(context: Context, node: N, type: T | undefined): boolean;
|
25 | convertNode(context: Context, node: N, type: T | undefined): Type | undefined;
|
26 | }
|