-- local serialize: Function --[[ ROBLOX TODO: Unhandled node for type: TSIndexedAccessType ]] --[[ NewPlugin['serialize'] ]]

local function serialize(
	object: ReactTestObject,
	config: Config,
	indentation: string,
	depth: number,
	refs: Refs,
	printer: Printer
)
	depth += 1
	return if depth > config.maxDepth
		then printElementAsLeaf(object.type, config)
		else printElement(
			object.type,
			if object.props ~= nil
				then printProps(
					getPropKeys(object),
					object.props,
					config,
					indentation .. config.indent,
					depth,
					refs,
					printer
				)
				else "",
			if object.children ~= nil
				then printChildren(object.children, config, indentation .. config.indent, depth, refs, printer)
				else "",
			config,
			indentation
		)
end
exports.serialize = serialize
