New View using ProtoUI in TypeScript with Webix Jet

Hi I am trying to create a new view to be used in a Webix Jet TypeScript project.

The following is my code:

interface schematicConfig extends webix.ui.viewConfig { }

interface SchematicApi {
    name:string;
    $init(config:schematicConfig):void;
};

interface Schematic extends webix.ui.view, SchematicApi {}

const api: Schematic = { 
    name:"schematic",
    $init:function(config) {
        /* Some Code */
    }
}

webix.protoUI(api, webix.ui.view);

export default class SchematicView extends JetView{
    config(){
        return { id:"schematic", view:"schematic" };
    }
};

The majority of my code is in the $init function within the api variable.

The error I am getting is TS2322.

TS2322: Type '{ name: string; $init: (config: schematicConfig) => void; }' is not assignable to type 'Schematic'.

Property ‘adjust’ is missing in type '{ name: string; $init: (config: schematicConfig) => void; }'.

I followed the example from: https://docs.webix.com/desktop__typescript.html

I am not sure where I am going wrong here.

Any help would be greatly appreciated.

you do not need to use any type definition with protoUI config and SchematicApi is unnecessary and wrong.
your Schematic definition is related to ui view, not protoUI.

interface schematicConfig extends webix.ui.viewConfig { 
    //config properties    
    testProperty: boolean;
}
interface Schematic extends webix.ui.view{
    //view methods
    testMethod():void;
}
webix.protoUI({
    name: "schematic",
    $init(config: schematicConfig){
        if (config.testProperty) {
            ...
        }
    },
    testMethod() {
        const that = this as Schematic;
        ...
    }
}, webix.ui.view);
const schematicView = webix.ui({
    view: "schematic"
}) as Schematic;