Microsoft MakeCode

How to add functions in a class and set the object automatically?

Posting it here as unsure if its more relevant here.
I want to have all my functions in a class for each main block. Right now what I do is,

namespace ABC{
//% block=“create lcd settings”
//% blockSetVariable=“ABCObjSettings”
//% weight=110
export function createABCObjSettings(): ABCObjSettings{
return new ABCObjSettings();
export class ABC{

//% block="$this example $variablePassed
//% blockId=Example
//% blockNamespace=ABC
//% this.shadow=variables_get
//% this.defl=“ABCObjSettings”
//% weight=90
exampleExposedFunction(variablePassed : number) {





In the blocks on the webpage, I have to first place the “set ABCObjSettings to create lcd settings”, then select my exposed function.
I have to place the “set ABCObjSettings to create lcd settings” at least once to use any exposed

Is there a way to automatically create that Object and use?