lint: apply pretty import

This commit is contained in:
pa
2025-10-15 09:08:38 +09:00
committed by Natsumi
parent bed76e0ad8
commit afbb6dfa47
203 changed files with 3502 additions and 1441 deletions

View File

@@ -1,33 +1,41 @@
class InteropApi {
constructor() {
return new Proxy(this, {
get(target, prop) {
if (WINDOWS) {
return undefined;
}
// If the property is not a method of InteropApi,
// treat it as a .NET class name
if (typeof prop === 'string' && !target[prop]) {
return new Proxy({}, {
get(_, methodName) {
// Return a method that calls the .NET method dynamically
return async (...args) => {
return await target.callMethod(prop, methodName, ...args);
};
}
});
}
return target[prop];
}
});
return new Proxy(this, {
get(target, prop) {
if (WINDOWS) {
return undefined;
}
// If the property is not a method of InteropApi,
// treat it as a .NET class name
if (typeof prop === 'string' && !target[prop]) {
return new Proxy(
{},
{
get(_, methodName) {
// Return a method that calls the .NET method dynamically
return async (...args) => {
return await target.callMethod(
prop,
methodName,
...args
);
};
}
}
);
}
return target[prop];
}
});
}
async callMethod(className, methodName, ...args) {
return window.interopApi.callDotNetMethod(className, methodName, args)
.then(result => {
return result;
});
return window.interopApi
.callDotNetMethod(className, methodName, args)
.then((result) => {
return result;
});
}
}
export default new InteropApi();
export default new InteropApi();