import * as ts from 'typescript'; import * as base from './base'; import { FacadeConverter } from './facade_converter'; import { Transpiler } from './main'; import { MergedMember } from './merge'; export declare function isFunctionLikeProperty(decl: ts.VariableDeclaration | ts.ParameterDeclaration | ts.PropertyDeclaration | ts.PropertySignature, tc: ts.TypeChecker): boolean; export default class DeclarationTranspiler extends base.TranspilerBase { private fc; private enforceUnderscoreConventions; private promoteFunctionLikeMembers; private trustJSTypes; private tc; private extendsClass; private visitPromises; private containsPromises; private promiseMembers; static NUM_FAKE_REST_PARAMETERS: number; setTypeChecker(tc: ts.TypeChecker): void; setFacadeConverter(fc: FacadeConverter): void; getJsPath(node: ts.Node, suppressUnneededPaths: boolean): string; private isAnonymous; maybeEmitJsAnnotation(node: ts.Node, { suppressUnneededPaths }: { suppressUnneededPaths: boolean; }): void; /** * Emit fake constructors to placate the Dart Analyzer for JS Interop classes. */ maybeEmitFakeConstructors(decl: ts.Node): void; private visitName; private notSimpleBagOfProperties; /** * Returns whether all members of the class and all base classes are properties. */ hasOnlyProperties(decl: ts.InterfaceDeclaration, outProperties: ts.PropertyDeclaration[]): boolean; hasOnlyPropertiesHelper(properties: ts.NodeArray, outProperties: ts.Declaration[]): boolean; visitClassBody(decl: base.ClassLike | ts.TypeLiteralNode, name: ts.Identifier): void; /** * Visits an array of class members and merges overloads. * * @returns An updated version of the members array. All overloaded methods are grouped into * MergedMember objects that contain all original declarations, as well as the merged result. * Other non-overloaded members are represented by MergedMembers with only one constituent, * which is the single declaration of the member. */ visitMergingOverloads(members: ts.NodeArray): MergedMember[]; constructor(tr: Transpiler, fc: FacadeConverter, enforceUnderscoreConventions: boolean, promoteFunctionLikeMembers: boolean, trustJSTypes: boolean); visitNode(node: ts.Node): boolean; private visitFunctionLike; /** * Visit a property declaration. * In the special case of property parameters in a constructor, we also allow * a parameter to be emitted as a property. * We have to emit properties as getter setter pairs as Dart does not support * external fields. * In the special case of property parameters in a constructor, we also allow a parameter to be * emitted as a property. */ private visitProperty; private visitClassLike; /** * Helper that generates a Dart class definition. * The definition of the TypeScript structure we are generating a Dart class facade for is broken * down into parts so that we can support all the various ways TypeScript can define a structure * that should generate a Dart class. */ private visitClassLikeHelper; private visitClassLikeName; private visitDeclarationMetadata; /** * Handles a function typedef-like interface, i.e. an interface that only declares a single * call signature, by translating to a Dart `typedef`. */ private visitFunctionTypedefInterface; private emitProperty; private emitCastThisToPrivateClass; private emitMembersAsExtensions; private emitExtensionMethodBody; private emitExtensionGetterBody; private emitExtensionSetterBody; }