// 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);
}
}
// 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);
}
}