Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support to extend SidecarBody subclass #36

@binsee

Description

@binsee

In use, I wrote a sidecar subclass for use in a formal environment.

@Sidecar('chatbox')
class Test extends SidecarBody {

  @Call(0x42)
  @RetType('pointer', 'Utf8String')
  testMethod(
    @ParamType('pointer', 'Utf8String') content: string,
    @ParamType('int') n: number
  ): Promise<string> {
    return Ret(content, n)
  }

  @Hook(agentTarget('agentVar'))
  hookMethod(@ParamType('int') n: number) {
    return Ret(n)
  }
}

But in development, I need to extend an additional class for isolation use, which needs to inherit the previous class.

@Sidecar('chatbox')
class Test2 extends Test {

  @Call(exportTarget('exportNameTest', 'moduleNameTest'))
  @RetType('pointer', 'Int')
  anotherCall(@ParamType('pointer', 'Int') i: number): Promise<number> {
    return Ret(i)
  }
}

However, currently sidecar cannot obtain the function information declared in the parent class.
In order to solve the above requirements, this problem needs to be solved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions