|
| 1 | + export class ClassWithPrivate { |
| 2 | +// definition syntax 1.0.0 src/`ClassWithPrivate.ts`/ |
| 3 | +//documentation ```ts\nmodule "ClassWithPrivate.ts"\n``` |
| 4 | +// ^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate# |
| 5 | +// documentation ```ts\nclass ClassWithPrivate\n``` |
| 6 | + #privateField |
| 7 | +// ^^^^^^^^^^^^^ definition syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateField`. |
| 8 | +// documentation ```ts\n(property) #privateField: any\n``` |
| 9 | + #privateFieldWithInitializer = 42 |
| 10 | +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateFieldWithInitializer`. |
| 11 | +// documentation ```ts\n(property) #privateFieldWithInitializer: number\n``` |
| 12 | + |
| 13 | + #privateMethod() { |
| 14 | +// ^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateMethod`(). |
| 15 | +// documentation ```ts\n(method) #privateMethod(): any\n``` |
| 16 | + this.#privateField = 'private field' |
| 17 | +// ^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateField`. |
| 18 | + return this.#privateField |
| 19 | +// ^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateField`. |
| 20 | + } |
| 21 | + |
| 22 | + static #privateStaticField |
| 23 | +// ^^^^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateStaticField`. |
| 24 | +// documentation ```ts\n(property) #privateStaticField: any\n``` |
| 25 | + static #privateStaticFieldWithInitializer = 42 |
| 26 | +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateStaticFieldWithInitializer`. |
| 27 | +// documentation ```ts\n(property) #privateStaticFieldWithInitializer: number\n``` |
| 28 | + |
| 29 | + static #privateStaticMethod() {} |
| 30 | +// ^^^^^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateStaticMethod`(). |
| 31 | +// documentation ```ts\n(method) #privateStaticMethod(): void\n``` |
| 32 | + public publicMethod(): any[] { |
| 33 | +// ^^^^^^^^^^^^ definition syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#publicMethod(). |
| 34 | +// documentation ```ts\n(method) publicMethod(): any[]\n``` |
| 35 | + return [ |
| 36 | + this.#privateField, |
| 37 | +// ^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateField`. |
| 38 | + this.#privateFieldWithInitializer, |
| 39 | +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateFieldWithInitializer`. |
| 40 | + this.#privateMethod(), |
| 41 | +// ^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateMethod`(). |
| 42 | + ClassWithPrivate.#privateStaticMethod(), |
| 43 | +// ^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate# |
| 44 | +// ^^^^^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateStaticMethod`(). |
| 45 | + ClassWithPrivate.#privateStaticField, |
| 46 | +// ^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate# |
| 47 | +// ^^^^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateStaticField`. |
| 48 | + ClassWithPrivate.#privateStaticFieldWithInitializer, |
| 49 | +// ^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate# |
| 50 | +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`ClassWithPrivate.ts`/ClassWithPrivate#`#privateStaticFieldWithInitializer`. |
| 51 | + ] |
| 52 | + } |
| 53 | + } |
| 54 | + |
0 commit comments