Error updating Custom (Save) Tool from older version of Bokeh

I’m working on updating some old code (from Bokeh 1.0.3/Python 3.6) I inherited that creates a custom save tool on a webpage using Bokeh server. I want it to work with Bokeh 2.4.3/Python 3.10.

I’ve made some progress but I get this error “TS2339: Property ‘save’ does not exist on type ‘PlotView’” when I run the code through the (new) Bokeh server and the code failed to compile.

There aren’t many examples online but I’m following a Typescript example I found.

Code snippet (customsave.ts):

import {ActionTool, ActionToolView} from "models/tools/actions/action_tool"
import * as p from "core/properties"

export class CustomSaveToolView extends ActionToolView {
  model: CustomSaveTool

  doit(): void {
    if (this.model.callback != null)
      this.model.callback.execute(this.model)
    this.save(this.model.save_name)

  }
}

export namespace CustomSaveTool {
  export type Attrs = p.AttrsOf<Props>

  export type Props = ActionTool.Props & {
    save_name: p.Property<any>
    base_name: p.Property<any>
    callback: p.Property< any | null>
  }
}

export interface CustomSaveTool extends CustomSaveTool.Attrs {}

export class CustomSaveTool extends ActionTool {
  properties: CustomSaveTool.Props

  constructor(attrs?: Partial<CustomSaveTool.Attrs>) {
    super(attrs)
  }

  static initClass(): void {
    this.prototype.type = "CustomSaveTool";
    this.prototype.default_view = CustomSaveToolView;

    this.define<CustomSaveTool.Props>({
      save_name:    [p.Any      ],
      base_name:    [p.Any      ],
      callback:     [p.Any      ],
    })
  }

  tool_name = "Save"
  icon = "bk-tool-icon-save"
}
CustomSaveTool.initClass()

CustomSaveTool takes a string (base_name) and a callback and should open up a Save file dialog using save_name, a string modified by the callback. It acts like the View no longer has a save method/function even though the few examples I’ve found online are written the same way.

Any help in figuring this out would be great.