import type {} from "@atcute/lexicons";
import * as v from "@atcute/lexicons/validations";
import * as ShTangledActorDefs from "../actor/defs.js";

const _repoViewBasicSchema = /*#__PURE__*/ v.object({
  $type: /*#__PURE__*/ v.optional(
    /*#__PURE__*/ v.literal("sh.tangled.repo.defs#repoViewBasic"),
  ),
  createdAt: /*#__PURE__*/ v.datetimeString(),
  description: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
  did: /*#__PURE__*/ v.didString(),
  isStarred: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.boolean()),
  get owner() {
    return ShTangledActorDefs.profileViewBasicSchema;
  },
  slug: /*#__PURE__*/ v.string(),
  starCount: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()),
  get viewer() {
    return /*#__PURE__*/ v.optional(viewerStateSchema);
  },
});
const _viewerStateSchema = /*#__PURE__*/ v.object({
  $type: /*#__PURE__*/ v.optional(
    /*#__PURE__*/ v.literal("sh.tangled.repo.defs#viewerState"),
  ),
  star: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()),
});

type repoViewBasic$schematype = typeof _repoViewBasicSchema;
type viewerState$schematype = typeof _viewerStateSchema;

export interface repoViewBasicSchema extends repoViewBasic$schematype {}
export interface viewerStateSchema extends viewerState$schematype {}

export const repoViewBasicSchema = _repoViewBasicSchema as repoViewBasicSchema;
export const viewerStateSchema = _viewerStateSchema as viewerStateSchema;

export interface RepoViewBasic extends v.InferInput<
  typeof repoViewBasicSchema
> {}
export interface ViewerState extends v.InferInput<typeof viewerStateSchema> {}
