Support static method on class
MangelMaxime opened this issue · comments
Maxime Mangel commented
TypeScript documentation:
export class Class {
static methodA(): void;
static methodB(arg1 : string, arg2: string): void;
}
translates into
[<AllowNullLiteral>]
[<InterfaceAttribute>]
type Class =
static member inline methodA () : unit =
emitJsExpr () $$"""
import { Class } from "module";
Class.methodA()"""
static member inline methodB (arg1 : string, arg2: string) : unit =
emitJsExpr (arg1, arg2) $$"""
import { Class } from "module";
Class.methodB($0, $1)"""
Code tested with this reproduction:
Example of npm package using this features:
Maxime Mangel commented
Currently the code below results in a maximum call stack size exceeded
export class Class {
static extend(props: any): { new (...args: any[]): any } & typeof Class;
}