export type DomainPropertyType =
  | 'string'
  | 'number'
  // | 'nil'
  | 'boolean'
  | 'date'
  | 'datetime'
  | 'time'
  // | 'any'
  | 'binary'

export const DomainPropertyTypes: DomainPropertyType[] = [
  'string',
  'number',
  // 'nil',
  'boolean',
  /**
   * full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21
   *
   * @see {@link https://tools.ietf.org/html/rfc3339#section-5.6}
   */
  'date',
  /**
   * the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z
   *
   * @see {@link https://tools.ietf.org/html/rfc3339#section-5.6}
   */
  'datetime',
  'time',
  // 'any',
  'binary',
]

export enum DomainPropertyList {
  string = 'string',
  number = 'number',
  // nil = 'nil',
  boolean = 'boolean',
  date = 'date',
  datetime = 'datetime',
  time = 'time',
  // any = 'any',
  file = 'binary',
}

/**
 * The data property "attributes".
 */
export type DomainPropertyAttribute =
  | 'required'
  | 'multiple'
  | 'primary'
  | 'index'
  | 'readOnly'
  | 'writeOnly'
  | 'deprecated'

export const DomainPropertyAttributes: DomainPropertyAttribute[] = [
  'required',
  'multiple',
  'primary',
  'index',
  'readOnly',
  'writeOnly',
  'deprecated',
]

/**
 * The data attribute "attributes".
 */
export type DomainAttributeAttribute = 'required' | 'multiple'

export const DomainAttributeAttributes: DomainAttributeAttribute[] = ['required', 'multiple']

/**
 * Note, OAS supports the `integer` data type and not format.
 * We need to account for that.
 *
 * - `float` - 32-bit floating point numbers
 * - `double` - 64-bit floating point numbers
 * - `int32` - Signed 32 bit number
 * - `int64` - Signed 64 bit number (OAS `long`)
 */
export type NumberFormat = 'float' | 'double' | 'int32' | 'int64'

export const NumberFormats: NumberFormat[] = ['float', 'double', 'int32', 'int64']

/**
 * - `hex` - Hex-encoded binary data
 * - `base64` - Base64-encoded binary data
 */
export type BinaryFormat = 'hex' | 'base64'

export const BinaryFormats: BinaryFormat[] = ['hex', 'base64']

export type DomainPropertyFormat = NumberFormat | BinaryFormat
