export function Base (
TableName: string,
fields: Struct.Fields
) {
return class Base<
TableName extends string = typeof TableName
>
extends Schema.TaggedClass<Base>()( TableName, {
id: Schema.String.pipe( Schema.brand( TableName + 'Id' ) ),
...fields
}
) {
public readonly ID: TypeID<TableName> = TypeID.fromString<TableName>( this.id )
public get UUID () {
return this.ID.toUUID()
}
public get idType () {
return this.ID.getType()
}
}
}
export function Base (
TableName: string,
fields: Struct.Fields
) {
return class Base<
TableName extends string = typeof TableName
>
extends Schema.TaggedClass<Base>()( TableName, {
id: Schema.String.pipe( Schema.brand( TableName + 'Id' ) ),
...fields
}
) {
public readonly ID: TypeID<TableName> = TypeID.fromString<TableName>( this.id )
public get UUID () {
return this.ID.toUUID()
}
public get idType () {
return this.ID.getType()
}
}
}