export const DataPropertyTypes = [
    '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 var DataPropertyList;
(function (DataPropertyList) {
    DataPropertyList["string"] = "string";
    DataPropertyList["number"] = "number";
    // nil = 'nil',
    DataPropertyList["boolean"] = "boolean";
    DataPropertyList["date"] = "date";
    DataPropertyList["datetime"] = "datetime";
    DataPropertyList["time"] = "time";
    // any = 'any',
    DataPropertyList["file"] = "binary";
})(DataPropertyList || (DataPropertyList = {}));
export const DataPropertyAttributes = [
    'required',
    'multiple',
    'primary',
    'index',
    'readOnly',
    'writeOnly',
    'deprecated',
];
export const DataAttributeAttributes = ['required', 'multiple'];
export const NumberFormats = ['float', 'double', 'int32', 'int64'];
export const BinaryFormats = ['hex', 'base64'];
export function getFormatInfo(format) {
    if (format === 'float') {
        return { label: 'Float', help: '32-bit number with decimals' };
    }
    if (format === 'double') {
        return { label: 'Double', help: '64-bit number with decimals' };
    }
    if (format === 'int32') {
        return { label: 'Integer (32-bit)', help: '-2,147,483,648…+2,147,483,647' };
    }
    if (format === 'int64') {
        return { label: 'Integer (64-bit)', help: 'Negative or positive 64-bit integer' };
    }
    if (format === 'hex') {
        return { label: 'Hex', help: 'Hex-encoded binary data' };
    }
    if (format === 'base64') {
        return { label: 'Base64', help: 'Base64-encoded binary data' };
    }
    return { label: 'Unknown', help: 'An error occured...' };
}
/**
 * Gathers information about the HTML input's requirements for the given DataProperty.
 *
 * @param model The data property model to gather HTML input's configuration for.
 * @returns Input attributes to set.
 */
export function getPropertyInputOptions(model) {
    const result = { type: 'text' };
    const wb = model.getWebBinding();
    if (!wb) {
        return result;
    }
    const format = wb.format;
    // if (format === 'no-tz') {
    //   result.pattern = '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}$'
    //   result.help = 'yyyy-mm-ddThh:mm:ss.sss'
    // } else if (format === 'utc') {
    //   result.pattern = '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$'
    //   result.help = 'yyyy-mm-ddThh:mm:ss.sssZ'
    // } else if (format === 'offset') {
    //   result.pattern = '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}[+-]\\d{2}$'
    //   result.help = 'yyyy-mm-ddThh:mm:ss.sss±hh'
    // } else if (format === 'time-offset') {
    //   result.pattern = '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}[+-]\\d{2}:\\d{2}$'
    //   result.help = 'yyyy-mm-ddThh:mm:ss.sss±hh:mm'
    // } else if (format === 'timestamp') {
    //   result.type = 'number'
    //   result.min = 0
    //   result.step = 1
    //   result.help = `Example: ${Date.now()}`
    // } else if (format === 'integer') {
    //   result.type = 'number'
    //   result.step = 1
    //   result.help = 'Arbitrary-size integer numbers'
    // } else if (format === 'decimal') {
    //   result.type = 'number'
    //   result.step = 0.01
    //   result.help = 'Arbitrary-precision decimal numbers'
    // } else if (format === 'double') {
    // else if (format === 'byte') {
    //   result.type = 'number'
    //   result.step = 1
    //   result.help = '-128…+127 (8 bit)'
    //   result.min = -128
    //   result.max = 127
    // } else if (format === 'short') {
    //   result.type = 'number'
    //   result.step = 1
    //   result.help = '-32,768…+32,767 (16 bit)'
    //   result.min = -32768
    //   result.max = 32767
    // }
    // else if (format === 'long') {
    //   result.type = 'number'
    //   result.step = 1
    //   result.help = 'Signed 64 bit number'
    // } else if (format === 'unsignedByte') {
    //   result.type = 'number'
    //   result.step = 1
    //   result.help = '0…255 (8 bit)'
    //   result.min = 0
    //   result.max = 255
    // } else if (format === 'unsignedShort') {
    //   result.type = 'number'
    //   result.step = 1
    //   result.help = '0…65,535 (16 bit)'
    //   result.min = 0
    //   result.max = 65535
    // } else if (format === 'unsignedInt') {
    //   result.type = 'number'
    //   result.step = 1
    //   result.help = '0…4,294,967,295 (32 bit)'
    //   result.min = 0
    //   result.max = 4294967295
    // } else if (format === 'unsignedLong') {
    //   result.type = 'number'
    //   result.step = 1
    //   result.help = 'Unsigned 64 bit number'
    // }
    if (format === 'float') {
        result.type = 'number';
        result.step = 0.000001;
        result.help = '32-bit number with decimals';
        return result;
    }
    if (format === 'double') {
        result.type = 'number';
        result.step = 0.000001;
        result.help = '64-bit number with decimals';
        return result;
    }
    else if (format === 'int32') {
        result.type = 'number';
        result.step = 1;
        result.help = '-2,147,483,648…+2,147,483,647 (32 bit)';
        result.min = -2147483648;
        result.max = 2147483647;
        return result;
    }
    else if (format === 'int64') {
        result.type = 'number';
        result.step = 1;
        result.help = 'Negative or positive 64-bit integer';
        return result;
    }
    return result;
}
//# sourceMappingURL=DataFormat.js.map