1 export declare abstract class _CodeOrName {
2 abstract readonly str: string;
3 abstract readonly names: UsedNames;
4 abstract toString(): string;
5 abstract emptyStr(): boolean;
7 export declare const IDENTIFIER: RegExp;
8 export declare class Name extends _CodeOrName {
10 constructor(s: string);
13 get names(): UsedNames;
15 export declare class _Code extends _CodeOrName {
16 readonly _items: readonly CodeItem[];
19 constructor(code: string | readonly CodeItem[]);
23 get names(): UsedNames;
25 export declare type CodeItem = Name | string | number | boolean | null;
26 export declare type UsedNames = Record<string, number | undefined>;
27 export declare type Code = _Code | Name;
28 export declare type SafeExpr = Code | number | boolean | null;
29 export declare const nil: _Code;
30 declare type CodeArg = SafeExpr | string | undefined;
31 export declare function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code;
32 export declare function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code;
33 export declare function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void;
34 export declare function strConcat(c1: Code, c2: Code): Code;
35 export declare function stringify(x: unknown): Code;
36 export declare function safeStringify(x: unknown): string;
37 export declare function getProperty(key: Code | string | number): Code;
38 export declare function regexpCode(rx: RegExp): Code;