UNPKG

1.39 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 * Google as part of the polymer project is also subject to an additional IP
9 * rights grant found at http://polymer.github.io/PATENTS.txt
10 */
11import * as ts from './ts-ast';
12/**
13 * Convert a Closure type expression string to its equivalent TypeScript AST
14 * node.
15 *
16 * Note that function and method parameters should instead use
17 * `closureParamToTypeScript`.
18 */
19export declare function closureTypeToTypeScript(closureType: string | null | undefined, templateTypes?: string[]): ts.Type;
20/**
21 * Convert a Closure function or method parameter type expression string to its
22 * equivalent TypeScript AST node.
23 *
24 * This differs from `closureTypeToTypeScript` in that it always returns a
25 * `ParamType`, and can parse the optional (`foo=`) and rest (`...foo`)
26 * syntaxes, which only apply when parsing an expression in the context of a
27 * parameter.
28 */
29export declare function closureParamToTypeScript(name: string, closureType: string | null | undefined, templateTypes?: string[]): ts.ParamType;