// #region Imports
/**
 * The `GridLength` class.
 *
 * @public
 */
export class GridLength {
    // #region Fields
    _value;
    _type;
    // #endregion
    // #region Ctor
    /**
     * Constructs a new instance of the `GridLength` class.
     *
     * @public
     */
    constructor(value, type) {
        this._value = value ?? 1;
        this._type = type ?? 'star';
    }
    // #endregion
    // #region Properties
    get value() {
        return this._value;
    }
    get type() {
        return this._type;
    }
    get isAbsolute() {
        return this._type === 'pixel';
    }
    get isAuto() {
        return this._type === 'auto';
    }
    get isStar() {
        return this._type === 'star';
    }
}
/**
 * @public
 */
export function convertGridLength(value) {
    if (value === 'auto') {
        return new GridLength(1, 'auto');
    }
    if (value.includes('*')) {
        return new GridLength(parseInt(value.replace('*', '') ?? '1'), 'star');
    }
    if (!isNaN(parseInt(value))) {
        return new GridLength(parseInt(value), 'pixel');
    }
    throw new Error(`Cannot parse item spec from string: ${value}`);
}
//# sourceMappingURL=GridLength.js.map