const Cuid2 = String.pipe(pattern(/^[a-z][a-z0-9]*$/, { identifier: "Cuid2" }))
const ChatId = Cuid2.pipe(brand("ChatId"))
// Generated type: Schema.brand<Schema.filter<Schema.Schema<string, string, never>>, "ChatId">
export class Chat extends Class<Chat>("Chat")({
id: ChatId,
message: String,
}) {}
type Entity = Schema.Class<any, { id: Schema.Schema<string> }, any, any, any, any, any>
const processEntity = (entity: Entity) => entity.fields.id
processEntity(Chat)
const Cuid2 = String.pipe(pattern(/^[a-z][a-z0-9]*$/, { identifier: "Cuid2" }))
const ChatId = Cuid2.pipe(brand("ChatId"))
// Generated type: Schema.brand<Schema.filter<Schema.Schema<string, string, never>>, "ChatId">
export class Chat extends Class<Chat>("Chat")({
id: ChatId,
message: String,
}) {}
type Entity = Schema.Class<any, { id: Schema.Schema<string> }, any, any, any, any, any>
const processEntity = (entity: Entity) => entity.fields.id
processEntity(Chat)