UNPKG

1.12 kBTypeScriptView Raw
1/**
2 * Helpers for validating various text string formats.
3 */
4export declare class SyntaxHelpers {
5 /**
6 * Tests whether the input string is safe to use as an ECMAScript identifier without quotes.
7 *
8 * @remarks
9 * For example:
10 *
11 * ```ts
12 * class X {
13 * public okay: number = 1;
14 * public "not okay!": number = 2;
15 * }
16 * ```
17 *
18 * A precise check is extremely complicated and highly dependent on the ECMAScript standard version
19 * and how faithfully the interpreter implements it. To keep things simple, `isSafeUnquotedMemberIdentifier()`
20 * conservatively accepts any identifier that would be valid with ECMAScript 5, and returns false otherwise.
21 */
22 static isSafeUnquotedMemberIdentifier(identifier: string): boolean;
23 /**
24 * Given an arbitrary input string, return a regular TypeScript identifier name.
25 *
26 * @remarks
27 * Example input: "api-extractor-lib1-test"
28 * Example output: "apiExtractorLib1Test"
29 */
30 static makeCamelCaseIdentifier(input: string): string;
31}
32//# sourceMappingURL=SyntaxHelpers.d.ts.map
\No newline at end of file