-- /**
--  * Returns a presentation string of your `val` object
--  * @param val any potential JavaScript object
--  * @param options Custom settings
--  */

local function format(val: any, options: OptionsReceived?): string
	if options then
		validateOptions(options)
		if options.plugins then
			local plugin_ = findPlugin((options.plugins :: Plugins), val)
			if plugin_ ~= nil then
				return printPlugin(plugin_, val, getConfig(options), "", 0, {})
			end
		end
	end

	local basicResult = printBasicValue(
		val,
		getOption(options, "printFunctionName"),
		getOption(options, "escapeRegex"),
		getOption(options, "escapeString")
	)
	if basicResult ~= nil then
		return basicResult
	end

	-- ROBLOX deviation: luau doesn't handle optional arguments, explicitly pass nil
	return printComplexValue(val, getConfig(options), "", 0, {}, nil)
end

local plugins = {
	AsymmetricMatcher = AsymmetricMatcher,
	ConvertAnsi = ConvertAnsi,
	ReactElement = ReactElement,
	ReactTestComponent = ReactTestComponent,
	-- ROBLOX deviation: Roblox Instance matchers
	RobloxInstance = RobloxInstance,
}

return {
	format = format,
	default = format,

	plugins = plugins,
	DEFAULT_OPTIONS = DEFAULT_OPTIONS,
}
