MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / createFromJsonMethod

Function createFromJsonMethod

packages/alphatab/scripts/Serializer.fromJson.ts:35–48  ·  view source on GitHub ↗
(
    input: ts.ClassDeclaration,
    serializable: TypeSchema,
    importer: (name: string, module: string) => void
)

Source from the content-addressed store, hash-verified

33}
34
35export function createFromJsonMethod(
36 input: ts.ClassDeclaration,
37 serializable: TypeSchema,
38 importer: (name: string, module: string) => void
39) {
40 const methodDecl = createNodeFromSource<ts.MethodDeclaration>(
41 `public class Serializer {
42 public static fromJson(obj: ${input.name!.text}, m: unknown): void {
43 }
44 }`,
45 ts.SyntaxKind.MethodDeclaration
46 );
47 return setMethodBody(methodDecl, generateFromJsonBody(input, serializable, importer));
48}

Callers 1

Calls 3

createNodeFromSourceFunction · 0.90
setMethodBodyFunction · 0.90
generateFromJsonBodyFunction · 0.85

Tested by

no test coverage detected