/*
 * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
 */

import { l } from '@atproto/lex'
import * as FeedDefs from '../feed/defs.defs.js'

const $nsid = 'fm.teal.alpha.actor.status'

export { $nsid }

/** This lexicon is in a not officially released state. It is subject to change. | A declaration of the status of the actor. Only one can be shown at a time. If there are multiple, the latest record should be picked and earlier records should be deleted or tombstoned. */
type Main = {
  $type: 'fm.teal.alpha.actor.status'

  /**
   * The RFC 3339 formatted time of when the item was recorded
   */
  time: l.DatetimeString

  /**
   * The RFC 3339 formatted time of the expiry time of the item. If unavailable, default to 10 minutes past the start time.
   */
  expiry?: l.DatetimeString
  item: FeedDefs.PlayView
}

export type { Main }

/** This lexicon is in a not officially released state. It is subject to change. | A declaration of the status of the actor. Only one can be shown at a time. If there are multiple, the latest record should be picked and earlier records should be deleted or tombstoned. */
const main = /*#__PURE__*/ l.record<'literal:self', Main>(
  'literal:self',
  $nsid,
  /*#__PURE__*/ l.object({
    time: /*#__PURE__*/ l.string({ format: 'datetime' }),
    expiry: /*#__PURE__*/ l.optional(
      /*#__PURE__*/ l.string({ format: 'datetime' }),
    ),
    item: /*#__PURE__*/ l.ref<FeedDefs.PlayView>(
      (() => FeedDefs.playView) as any,
    ),
  }),
)

export { main }

export const $type = $nsid
export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main)
export const $build = /*#__PURE__*/ main.build.bind(main)
export const $assert = /*#__PURE__*/ main.assert.bind(main)
export const $check = /*#__PURE__*/ main.check.bind(main)
export const $cast = /*#__PURE__*/ main.cast.bind(main)
export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main)
export const $matches = /*#__PURE__*/ main.matches.bind(main)
export const $parse = /*#__PURE__*/ main.parse.bind(main)
export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main)
export const $validate = /*#__PURE__*/ main.validate.bind(main)
export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main)
