Class definition sharing

Hello,

Currently I work with Postman for automatic documentations creation.
For this purpose, I created some classes like :

// Code in step1
class MyClass {

    displayFake(value){
        console.log("Fake of MyClass " + value);
    }
}

class Child extends MyClass {
    displayFake(value){
        console.log("Fake of Child " + value);
    }
}

When it is used in the step where I defined them, the classes work perfectly. But I would need to use these classes in other steps.
I tried something like this :

var storedClasses = () => {

class MyClass {
    
    displayFake(value){
        console.log("Fake of MyClass " + value);
    }
}

class Child extends MyClass {
    displayFake(value){
        console.log("Fake of Child " + value);
    }
}

};

pm.environment.set(“storedClasses”, storedClasses.toString());

In another step, I get the “storedClasses” object and use the “eval hack” and try to create an object but it fails.

// Code in step2
var storedClasses = pm.environment.get(“storedClasses”);
eval(storedClasses)();
var child = new Child(); // -> “ReferenceError: Child is not defined”

Would there be someone who knows if it is possible to achieve this goal and how if yes ?

Thank you in advance.
Regards,

Jocelyn