import React from 'react';
import { registerWidget, Value } from '../Value';
import { renderTypeParameters } from '../widgetUtils';
registerWidget('primitive', function (_a) {
    var value = _a.value;
    return (React.createElement("span", { className: "token primitive" }, value.value));
});
registerWidget('boolean', function (_a) {
    var value = _a.value;
    return (React.createElement("span", { className: "token primitive" }, String(value.value)));
});
registerWidget('string', function (_a) {
    var value = _a.value;
    return (React.createElement("span", { className: "token string" },
        "'",
        value.value,
        "'"));
});
registerWidget('number', function (_a) {
    var value = _a.value;
    return (React.createElement("span", { className: "token number" }, value.value));
});
registerWidget('generic', function (_a) {
    var value = _a.value;
    return (React.createElement("span", { className: "token symbol" }, value.name));
});
registerWidget('type', function (_a) {
    var value = _a.value, doc = _a.doc;
    return (React.createElement(React.Fragment, null,
        (doc === null || doc === void 0 ? void 0 : doc.name) && (React.createElement(React.Fragment, null,
            React.createElement("span", { className: "token keyword" }, "type"),
            ' ',
            React.createElement("span", { className: "token symbol" }, (doc === null || doc === void 0 ? void 0 : doc.name) || 'unknown'),
            renderTypeParameters(value.typeParameters),
            " ",
            React.createElement("span", { className: "token operator" }, "="),
            ' ')),
        React.createElement(Value, { value: value.value })));
});
registerWidget('infer', function (_a) {
    var value = _a.value;
    return (React.createElement(React.Fragment, null,
        React.createElement("span", { className: "token keyword" }, "infer"),
        " ",
        React.createElement(Value, { value: value.value })));
});
registerWidget('keyof', function (_a) {
    var value = _a.value;
    return (React.createElement(React.Fragment, null,
        React.createElement("span", { className: "token keyword" }, "keyof"),
        " ",
        React.createElement(Value, { value: value.name })));
});
