Skip to content

Commit 48428d8

Browse files
committed
docs: improve sync and async options docs
Signed-off-by: Markus <28785953+MarkusJx@users.noreply.github.com>
1 parent ff31c57 commit 48428d8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

crates/java-bridge/src/node/java_config.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ impl JavaConfig {
8282
/// Pass `null` or an empty string to disable the suffix.
8383
/// This must not be the same as the {@link asyncSuffix}.
8484
///
85-
/// # Example
85+
/// This option does not affect standard methods of java classes
86+
/// like `toString`, `toStringSync`, `toStringAsync` and `newInstanceAsync`.
87+
///
88+
/// ## Example
8689
/// ```ts
8790
/// import { config, clearClassProxies } from 'java-bridge';
8891
///
@@ -137,6 +140,9 @@ impl JavaConfig {
137140
/// Pass `null` or an empty string to disable the suffix.
138141
/// This must not be the same as the {@link syncSuffix}.
139142
///
143+
/// This option does not affect standard methods of java classes
144+
/// like `toString`, `toStringSync`, `toStringAsync` and `newInstanceAsync`.
145+
///
140146
/// @see syncSuffix
141147
/// @since 2.4.0
142148
/// @param value the suffix to use for asynchronous methods

ts-src/definitions.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ export declare class JavaClass extends JavaObject {
150150
* Does not overwrite any existing instanceof operator.
151151
* This uses the native java instanceof operator.
152152
*
153+
* This method's name is not affected by the {@link JavaConfig#syncSuffix}
154+
* and {@link JavaConfig#asyncSuffix} options.
155+
*
153156
* ## Example
154157
* ```ts
155158
* import { importClass } from 'java-bridge';
@@ -190,6 +193,9 @@ export declare class JavaClass extends JavaObject {
190193
* Java default toString method.
191194
* Sync call.
192195
*
196+
* This method's name is not affected by the {@link JavaConfig#syncSuffix}
197+
* and {@link JavaConfig#asyncSuffix} options.
198+
*
193199
* @returns this as a string
194200
*/
195201
public toString(): string;
@@ -198,6 +204,9 @@ export declare class JavaClass extends JavaObject {
198204
* Java default toString method.
199205
* Sync call.
200206
*
207+
* This method's name is not affected by the {@link JavaConfig#syncSuffix}
208+
* and {@link JavaConfig#asyncSuffix} options.
209+
*
201210
* @deprecated use {@link toString} instead
202211
* @returns this as a string
203212
*/
@@ -207,6 +216,9 @@ export declare class JavaClass extends JavaObject {
207216
* Java default toString method.
208217
* Async call.
209218
*
219+
* This method's name is not affected by the {@link JavaConfig#syncSuffix}
220+
* and {@link JavaConfig#asyncSuffix} options.
221+
*
210222
* @since 2.4.0
211223
* @returns this as a string
212224
*/
@@ -251,6 +263,9 @@ export declare class UnknownJavaClass extends JavaClass {
251263
* Create a new java class instance.
252264
* Async version.
253265
*
266+
* This method's name is not affected by the {@link JavaConfig#syncSuffix}
267+
* and {@link JavaConfig#asyncSuffix} options.
268+
*
254269
* @template T the type of this class as a new instance of this class will be returned
255270
* @param args the arguments to create the instance
256271
* @return the java_instance_proxy instance

0 commit comments

Comments
 (0)