Passing an exported scope to a function (Type 'string' is not assignable to type 'never')

Hello, I have an exported scope that I'm trying to pass to a generic class to be used.

// the class
class SomeClass<TData extends any> {
  // I tried `Type<TData>` here but get this when trying to call `this.schema()` "Type 'unknown' has no call signatures"
  constuctor(public schema: Type) {
  }
}

// the schema
const UserConfigSchema = scope({
    config: {
        windowMeta: "Record<string, windowMeta>",
    },
    windowMeta: {
        position: {
            x: "number",
            y: "number",
        },
    }
}).export();

type UserConfig = typeof UserConfigSchema.config.infer;

class SomeParentClass extends SomeClass<UserConfig> {
  constructor() {
     // ERROR:
     // Type 'string' is not assignable to type 'never'
     super(UserConfigSchema.config);
  }
}


I see that .export() yields type Module, but I couldn't figure out how to use that either.

Appreciate any help
Was this page helpful?