export var TypeNames;
(function (TypeNames) {
    TypeNames["string"] = "string";
    TypeNames["number"] = "number";
    TypeNames["integer"] = "integer";
    TypeNames["boolean"] = "boolean";
    TypeNames["object"] = "object";
    TypeNames["any"] = "any";
    TypeNames["text"] = "text";
    TypeNames["media"] = "media";
    TypeNames["document"] = "document";
})(TypeNames || (TypeNames = {}));
export function parseTypeSignature(text) {
    text = text.trim();
    let isArray = false, isNullable = false;
    if (text.endsWith('?')) {
        isNullable = true;
        text = text.substring(0, text.length - 1).trim();
    }
    if (text.endsWith('[]')) {
        isArray = true;
        text = text.substring(0, text.length - 2).trim();
    }
    const name = TypeNames[text];
    if (!name) {
        throw new Error(`Unknown type "${text}"`);
    }
    return { name, isArray, isNullable, isObject: name === TypeNames.object };
}
//# sourceMappingURL=type-signature.js.map