Use ts-go for building our extensions

Also reverts to use experimental decorators due to stage 3 decorators not being supported yet https://github.com/microsoft/typescript-go/issues/2354

The skipLib check is needed to work around some jsdom types issues
This commit is contained in:
Matt Bierner
2026-02-02 20:02:55 -08:00
parent 424ef28d9b
commit cca17c1b7f
9 changed files with 168 additions and 48 deletions

View File

@@ -47,11 +47,11 @@ function _throttle<T>(fn: Function, key: string): Function {
return trigger;
}
function decorate(decorator: (fn: Function, key: string) => Function): Function {
return function (original: any, context: ClassMethodDecoratorContext) {
if (context.kind !== 'method') {
function decorate(decorator: (fn: Function, key: string) => Function): MethodDecorator {
return (_target: any, key: string | symbol, descriptor: PropertyDescriptor): void => {
if (typeof descriptor.value !== 'function') {
throw new Error('not supported');
}
return decorator(original, context.name.toString());
descriptor.value = decorator(descriptor.value, String(key));
};
}