Options
All
  • Public
  • Public/Protected
  • All
Menu

dts-element

Index

Enumerations

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

IComment

IDeclaration

IImportExport

IModuleMember

ITopLevelMember

IType

Variables

Const any_type

any_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword),})

Const boolean_type

boolean_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.BooleanKeyword),})

Const code

code: "/// <reference path="some-path" />/// <reference types="some-types" />declare var v_var;declare let v_let;declare const v_const;declare const v_any: any;declare const v_boolean: boolean;declare const v_never: never;declare const v_null: null;declare const v_number: number;declare const v_object: object;declare const v_string: string;declare const v_symbol: symbol;declare const v_this: this;declare const v_undefined: undefined;declare const v_void: void;declare const v_array: any[];declare const v_constructor: new <T>(v: T) => any;declare const v_function: <T>(v: T) => any;declare const v_function_predicate_1: () => this is string;declare const v_function_predicate_2: (v) => v is string;declare const v_general: X.Y.Z<string>;declare const v_intersection: string & number;declare const v_keyof: keyof X;declare const v_literal_true: true;declare const v_literal_false: false;declare const v_literal_number: 123;declare const v_literal_string: 'str';declare const v_mapped: {[T in keyof X]: any;};declare const v_mapped_readonly: {readonly [T in keyof X]: any;};declare const v_mapped_optional: {[T in keyof X]?: any;};declare const v_object: {readonly a?: any;b?<T>(v: T): any;o(v?: string): void;r(...v: string[]): string;r2(...v);r3(...v: string[][]);new (): any;(): any;<T>(v: T): T;new <T>(v: T): any;readonly [index: number]: any;};declare const v_sub_1: X[any]['abc'][123];declare const v_sub_2: A.B.C[X[any]][any];declare const v_tuple: [string, number];declare const v_typeof_1: typeof X;declare const v_typeof_2: typeof X.Y.Z;declare const v_union: string | number;import "path/to/somewhere";import import_default from "path/to/somewhere";import import_default1, * as import_namespace1 from "path/to/somewhere";import * as import_namespace2 from "path/to/somewhere";import import_default2, {im_0 as im_1, im_2} from "path/to/somewhere";import {im_3 as im_4, im_5} from "path/to/somewhere";export default X;export default X.Y.Z;export = A;export = A.B.C;export {ex_0 as ex_1, ex_2};export as namespace NS;export * from "path/to/somewhere";export {ex_3 as ex_4, ex_5} from "path/to/somewhere";export declare class ZXC extends X.Y.Z {}export declare abstract class ABC<T, U> extends XYZ<S, V> {constructor();method?(): void;public method1<T>(v: T): T;protected method2(): void;private method3(): void;public abstract method4(): void;property?: string;public property1: string;protected property2: string;private property3: string;public abstract property4: string;"": string;""(): void;}export enum Kind {A,B = 123,C,}export interface X<T> extends C, D {a: T;"": T;""(): void;}export declare namespace NS {const ns: any;}declare global {interface String {toXYZ(): any;}}declare module "xyz" {const aa: string;}type TP<T> = T | string;type adjust = <T, U>(fn: (v: T) => U, index: number, array: T[]) => (T | U)[];declare function x<T>(v: T): T;import xyz = require('xyz');type X = A[B[C]];type TypeName<T> =T extends string ? "string" :T extends number ? "number" :T extends boolean ? "boolean" :T extends undefined ? "undefined" :T extends Function ? "function" :"object";type ReturnType<T> = T extends (...args: any[]) => infer R ? R : T;type X = {0: 123}" = `/// <reference path="some-path" />/// <reference types="some-types" />declare var v_var;declare let v_let;declare const v_const;declare const v_any: any;declare const v_boolean: boolean;declare const v_never: never;declare const v_null: null;declare const v_number: number;declare const v_object: object;declare const v_string: string;declare const v_symbol: symbol;declare const v_this: this;declare const v_undefined: undefined;declare const v_void: void;declare const v_array: any[];declare const v_constructor: new <T>(v: T) => any;declare const v_function: <T>(v: T) => any;declare const v_function_predicate_1: () => this is string;declare const v_function_predicate_2: (v) => v is string;declare const v_general: X.Y.Z<string>;declare const v_intersection: string & number;declare const v_keyof: keyof X;declare const v_literal_true: true;declare const v_literal_false: false;declare const v_literal_number: 123;declare const v_literal_string: 'str';declare const v_mapped: {[T in keyof X]: any;};declare const v_mapped_readonly: {readonly [T in keyof X]: any;};declare const v_mapped_optional: {[T in keyof X]?: any;};declare const v_object: {readonly a?: any;b?<T>(v: T): any;o(v?: string): void;r(...v: string[]): string;r2(...v);r3(...v: string[][]);new (): any;(): any;<T>(v: T): T;new <T>(v: T): any;readonly [index: number]: any;};declare const v_sub_1: X[any]['abc'][123];declare const v_sub_2: A.B.C[X[any]][any];declare const v_tuple: [string, number];declare const v_typeof_1: typeof X;declare const v_typeof_2: typeof X.Y.Z;declare const v_union: string | number;import "path/to/somewhere";import import_default from "path/to/somewhere";import import_default1, * as import_namespace1 from "path/to/somewhere";import * as import_namespace2 from "path/to/somewhere";import import_default2, {im_0 as im_1, im_2} from "path/to/somewhere";import {im_3 as im_4, im_5} from "path/to/somewhere";export default X;export default X.Y.Z;export = A;export = A.B.C;export {ex_0 as ex_1, ex_2};export as namespace NS;export * from "path/to/somewhere";export {ex_3 as ex_4, ex_5} from "path/to/somewhere";export declare class ZXC extends X.Y.Z {}export declare abstract class ABC<T, U> extends XYZ<S, V> {constructor();method?(): void;public method1<T>(v: T): T;protected method2(): void;private method3(): void;public abstract method4(): void;property?: string;public property1: string;protected property2: string;private property3: string;public abstract property4: string;"": string;""(): void;}export enum Kind {A,B = 123,C,}export interface X<T> extends C, D {a: T;"": T;""(): void;}export declare namespace NS {const ns: any;}declare global {interface String {toXYZ(): any;}}declare module "xyz" {const aa: string;}type TP<T> = T | string;type adjust = <T, U>(fn: (v: T) => U, index: number, array: T[]) => (T | U)[];declare function x<T>(v: T): T;import xyz = require('xyz');type X = A[B[C]];type TypeName<T> =T extends string ? "string" :T extends number ? "number" :T extends boolean ? "boolean" :T extends undefined ? "undefined" :T extends Function ? "function" :"object";type ReturnType<T> = T extends (...args: any[]) => infer R ? R : T;type X = {0: 123}`

Const declare_token

declare_token: Token<DeclareKeyword> = ts.createToken(ts.SyntaxKind.DeclareKeyword)

Const never_type

never_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.NeverKeyword),})

Const null_type

null_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.NullKeyword),})

Const number_type

number_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword),})

Const object_type

object_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.ObjectKeyword),})

Const string_type

string_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),})

Const symbol_type

symbol_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.SymbolKeyword),})

Const this_type

this_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.ThisKeyword),})

Const top_level_element

top_level_element: ITopLevelElement = create_top_level_element({members: [create_multi_line_comment({text: `hello\n\nworld`,align: true,prefix: '~ ',}),create_class_declaration({name: 'AAA',extends: create_general_type({name: 'SomethingElse',}),}),],})

Const undefined_type

undefined_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.UndefinedKeyword),})

Const void_type

void_type: INativeType = create_native_type({type: ts.createKeywordTypeNode(ts.SyntaxKind.VoidKeyword),})

Functions

Const add_declare_modifier_if_need

  • add_declare_modifier_if_need(modifiers: ts.Modifier[] | undefined, path: IElement<any>[]): ts.Modifier[] | undefined
  • Parameters

    • modifiers: ts.Modifier[] | undefined
    • path: IElement<any>[]

    Returns ts.Modifier[] | undefined

Const create_array_type

Const create_class_declaration

Const create_class_member

Const create_conditional_type

Const create_constructor_type

Const create_element

  • create_element<Kind>(kind: Kind): IElement<Kind>

Const create_entity_name

  • create_entity_name(name: string | string[]): ts.EntityName
  • Parameters

    • name: string | string[]

    Returns ts.EntityName

Const create_enum_declaration

Const create_export_default

Const create_export_equal

Const create_export_member

Const create_export_named

Const create_export_namespace

Const create_expression_for_general_type

  • create_expression_for_general_type(element: IGeneralType, path: IElement<any>[]): ExpressionWithTypeArguments

Const create_function_declaration

Const create_function_type

Const create_general_type

Const create_generic_declaration

Const create_global_declaration

Const create_import_equal

Const create_import_member

Const create_import_named

Const create_import_namespace

Const create_index_signature

Const create_infer_type

Const create_interface_declaration

Const create_intersection_type

Const create_jsdoc_comment

Const create_keyof_type

Const create_literal_type

Const create_mapped_type

Const create_module_declaration

Const create_multi_line_comment

Const create_namespace_declaration

Const create_native_type

Const create_object_member

Const create_object_type

Const create_parameter_declaration

Const create_property_access

  • create_property_access(names: string[]): Expression

Const create_qualified_name

  • create_qualified_name(names: string[]): QualifiedName
  • Parameters

    • names: string[]

    Returns QualifiedName

Const create_single_line_comment

Const create_sub_type

Const create_top_level_element

Const create_triple_slash_reference

Const create_tuple_type

Const create_type_declaration

Const create_type_nodes

  • create_type_nodes(types: undefined | IType[], path: IElement<any>[]): TypeNode[]

Const create_type_parameters

Const create_type_predicate

Const create_typeof_type

Const create_union_type

Const create_variable_declaration

Const emit

Const emit_native

  • emit_native(node: Node, options?: ts.PrinterOptions): string
  • Parameters

    • node: Node
    • Optional options: ts.PrinterOptions

    Returns string

Const has_kind

  • has_kind(nodes: ReadonlyArray<Node> | undefined, kind: SyntaxKind): boolean
  • Parameters

    • nodes: ReadonlyArray<Node> | undefined
    • kind: SyntaxKind

    Returns boolean

Const if_defined

  • if_defined<T, U>(value: T | undefined, fn: function): U | undefined
  • Type parameters

    • T

    • U

    Parameters

    • value: T | undefined
    • fn: function
        • (v: T): U
        • Parameters

          • v: T

          Returns U

    Returns U | undefined

Const is_array_type

  • is_array_type(value: any): boolean

Const is_class_declaration

  • is_class_declaration(value: any): boolean

Const is_class_member

  • is_class_member(value: any): boolean

Const is_conditional_type

  • is_conditional_type(value: any): boolean

Const is_constructor_type

  • is_constructor_type(value: any): boolean

Const is_element

  • is_element(value: any): boolean

Const is_enum_declaration

  • is_enum_declaration(value: any): boolean

Const is_export_default

  • is_export_default(value: any): boolean

Const is_export_equal

  • is_export_equal(value: any): boolean

Const is_export_member

  • is_export_member(value: any): boolean

Const is_export_named

  • is_export_named(value: any): boolean

Const is_export_namespace

  • is_export_namespace(value: any): boolean

Const is_function_declaration

  • is_function_declaration(value: any): boolean

Const is_function_type

  • is_function_type(value: any): boolean

Const is_general_type

  • is_general_type(value: any): boolean

Const is_generic_declaration

  • is_generic_declaration(value: any): boolean

Const is_global_declaration

  • is_global_declaration(value: any): boolean

Const is_import_equal

  • is_import_equal(value: any): boolean

Const is_import_member

  • is_import_member(value: any): boolean

Const is_import_named

  • is_import_named(value: any): boolean

Const is_import_namespace

  • is_import_namespace(value: any): boolean

Const is_index_signature

  • is_index_signature(value: any): boolean

Const is_infer_type

  • is_infer_type(value: any): boolean

Const is_interface_declaration

  • is_interface_declaration(value: any): boolean

Const is_intersection_type

  • is_intersection_type(value: any): boolean

Const is_jsdoc_comment

  • is_jsdoc_comment(value: any): boolean

Const is_keyof_type

  • is_keyof_type(value: any): boolean

Const is_literal_type

  • is_literal_type(value: any): boolean

Const is_mapped_type

  • is_mapped_type(value: any): boolean

Const is_module_declaration

  • is_module_declaration(value: any): boolean

Const is_multi_line_comment

  • is_multi_line_comment(value: any): boolean

Const is_namespace_declaration

  • is_namespace_declaration(value: any): boolean

Const is_native_type

  • is_native_type(value: any): boolean

Const is_object_member

  • is_object_member(value: any): boolean

Const is_object_type

  • is_object_type(value: any): boolean

Const is_parameter_declaration

  • is_parameter_declaration(value: any): boolean

Const is_single_line_comment

  • is_single_line_comment(value: any): boolean

Const is_sub_type

  • is_sub_type(value: any): boolean

Const is_top_level_element

  • is_top_level_element(value: any): boolean

Const is_triple_slash_reference

  • is_triple_slash_reference(value: any): boolean

Const is_tuple_type

  • is_tuple_type(value: any): boolean

Const is_type_declaration

  • is_type_declaration(value: any): boolean

Const is_type_predicate

  • is_type_predicate(value: any): boolean

Const is_typeof_type

  • is_typeof_type(value: any): boolean

Const is_union_type

  • is_union_type(value: any): boolean

Const is_valid_identifier

  • is_valid_identifier(name: string): boolean

Const is_variable_declaration

  • is_variable_declaration(value: any): boolean

mutable_array

  • mutable_array<T>(array: ReadonlyArray<T>): T[]
  • mutable_array<T>(array?: ReadonlyArray<T>): undefined | T[]
  • Type parameters

    • T

    Parameters

    • array: ReadonlyArray<T>

    Returns T[]

  • Type parameters

    • T

    Parameters

    • Optional array: ReadonlyArray<T>

    Returns undefined | T[]

Const parse

Const parse_array_type

  • parse_array_type(node: ArrayTypeNode): IArrayType

Const parse_call_signature

  • parse_call_signature(node: CallSignatureDeclaration): IObjectMember

Const parse_class_declaration

Const parse_conditional_type

Const parse_construct_signature

  • parse_construct_signature(node: ConstructSignatureDeclaration): IObjectMember

Const parse_constructor

  • parse_constructor(node: ConstructorDeclaration): IClassMember

Const parse_constructor_type

Const parse_enum_declaration

Const parse_enum_member

Const parse_export_assignment

Const parse_export_declaration

Const parse_export_specifier

Const parse_expression_with_type_arguments

  • parse_expression_with_type_arguments(node: ExpressionWithTypeArguments): IGeneralType

Const parse_function_declaration

Const parse_function_type

Const parse_identifier

  • parse_identifier(node: Identifier): string

Const parse_import_declaration

Const parse_import_equals_declaration

  • parse_import_equals_declaration(node: ImportEqualsDeclaration): IImportEqual

Const parse_import_specifier

Const parse_index_signature

Const parse_indexed_access_type

  • parse_indexed_access_type(node: IndexedAccessTypeNode): ISubType

Const parse_infer_type

  • parse_infer_type(node: InferTypeNode): IInferType

Const parse_interface_declaration

Const parse_intersection_type

Const parse_mapped_type

Const parse_method_declaration

  • parse_method_declaration(node: MethodDeclaration): IClassMember

Const parse_method_signature

Const parse_module_declaration

Const parse_namespace_export_declaration

  • parse_namespace_export_declaration(node: NamespaceExportDeclaration): IExportNamespace

Const parse_native

  • parse_native(node: Node): IElement<any>

Const parse_parameter_declaration

Const parse_parenthesized_type

  • parse_parenthesized_type(node: ParenthesizedTypeNode): IType

Const parse_property_access_expression

  • parse_property_access_expression(node: PropertyAccessExpression): string[]

Const parse_property_declaration

  • parse_property_declaration(node: PropertyDeclaration): IClassMember

Const parse_property_signature

  • parse_property_signature(node: PropertySignature): IObjectMember

Const parse_qualified_name

  • parse_qualified_name(node: QualifiedName): string[]

Const parse_source_file

Const parse_tuple_type

  • parse_tuple_type(node: TupleTypeNode): ITupleType

Const parse_type

  • parse_type(type_string: string): IType

Const parse_type_alias_declaration

Const parse_type_literal

  • parse_type_literal(node: TypeLiteralNode): IObjectType

Const parse_type_operator

  • parse_type_operator(node: TypeOperatorNode): IKeyofType

Const parse_type_parameter

Const parse_type_predicater

Const parse_type_query

Const parse_type_reference

  • parse_type_reference(node: TypeReferenceNode): IGeneralType

Const parse_union_type

  • parse_union_type(node: UnionTypeNode): IUnionType

Const parse_variable_statement

Const transform

Object literals

Const multi_line_options

multi_line_options: object

align

align: boolean = true

prefix

prefix: string = "~ "

Const single_line_options

single_line_options: object

prefix

prefix: string = " "

Generated using TypeDoc