1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { ConstantPool } from './constant_pool';
|
9 | import * as o from './output/output_ast';
|
10 | import { ParseError } from './parse_util';
|
11 | export declare function dashCaseToCamelCase(input: string): string;
|
12 | export declare function splitAtColon(input: string, defaultValues: string[]): string[];
|
13 | export declare function splitAtPeriod(input: string, defaultValues: string[]): string[];
|
14 | export declare function visitValue(value: any, visitor: ValueVisitor, context: any): any;
|
15 | export declare function isDefined(val: any): boolean;
|
16 | export declare function noUndefined<T>(val: T | undefined): T;
|
17 | export interface ValueVisitor {
|
18 | visitArray(arr: any[], context: any): any;
|
19 | visitStringMap(map: {
|
20 | [key: string]: any;
|
21 | }, context: any): any;
|
22 | visitPrimitive(value: any, context: any): any;
|
23 | visitOther(value: any, context: any): any;
|
24 | }
|
25 | export declare class ValueTransformer implements ValueVisitor {
|
26 | visitArray(arr: any[], context: any): any;
|
27 | visitStringMap(map: {
|
28 | [key: string]: any;
|
29 | }, context: any): any;
|
30 | visitPrimitive(value: any, context: any): any;
|
31 | visitOther(value: any, context: any): any;
|
32 | }
|
33 | export declare type SyncAsync<T> = T | Promise<T>;
|
34 | export declare const SyncAsync: {
|
35 | assertSync: <T>(value: SyncAsync<T>) => T;
|
36 | then: <T_1, R>(value: SyncAsync<T_1>, cb: (value: T_1) => R | Promise<R> | Promise<R>) => SyncAsync<R>;
|
37 | all: <T_2>(syncAsyncValues: SyncAsync<T_2>[]) => SyncAsync<T_2[]>;
|
38 | };
|
39 | export declare function error(msg: string): never;
|
40 | export declare function syntaxError(msg: string, parseErrors?: ParseError[]): Error;
|
41 | export declare function isSyntaxError(error: Error): boolean;
|
42 | export declare function getParseErrors(error: Error): ParseError[];
|
43 | export declare function escapeRegExp(s: string): string;
|
44 | export declare function utf8Encode(str: string): string;
|
45 | export interface OutputContext {
|
46 | genFilePath: string;
|
47 | statements: o.Statement[];
|
48 | constantPool: ConstantPool;
|
49 | importExpr(reference: any, typeParams?: o.Type[] | null, useSummaries?: boolean): o.Expression;
|
50 | }
|
51 | export declare function stringify(token: any): string;
|
52 |
|
53 |
|
54 |
|
55 | export declare function resolveForwardRef(type: any): any;
|
56 |
|
57 |
|
58 |
|
59 | export declare function isPromise<T = any>(obj: any): obj is Promise<T>;
|
60 | export declare class Version {
|
61 | full: string;
|
62 | readonly major: string;
|
63 | readonly minor: string;
|
64 | readonly patch: string;
|
65 | constructor(full: string);
|
66 | }
|
67 | export interface Console {
|
68 | log(message: string): void;
|
69 | warn(message: string): void;
|
70 | }
|
71 | declare const _global: {
|
72 | [name: string]: any;
|
73 | };
|
74 | export { _global as global };
|
75 | export declare function newArray<T = any>(size: number): T[];
|
76 | export declare function newArray<T>(size: number, value: T): T[];
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | export declare function partitionArray<T>(arr: T[], conditionFn: <K extends T>(value: K) => boolean): [T[], T[]];
|