#ifndef EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_H__
#define EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_H__
#include <stdint.h>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/values.h"
#include <string_view>
#include "base/types/expected.h"
#include "extensions/common/api/extension_types.h"
namespace extensions {
namespace api {
namespace declarative_net_request {
extern const int GUARANTEED_MINIMUM_STATIC_RULES;
extern const int MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES;
extern const int MAX_NUMBER_OF_DYNAMIC_RULES;
extern const int MAX_NUMBER_OF_UNSAFE_DYNAMIC_RULES;
extern const int MAX_NUMBER_OF_SESSION_RULES;
extern const int MAX_NUMBER_OF_UNSAFE_SESSION_RULES;
extern const int GETMATCHEDRULES_QUOTA_INTERVAL;
extern const int MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL;
extern const int MAX_NUMBER_OF_REGEX_RULES;
extern const int MAX_NUMBER_OF_STATIC_RULESETS;
extern const int MAX_NUMBER_OF_ENABLED_STATIC_RULESETS;
extern const char DYNAMIC_RULESET_ID[];
extern const char SESSION_RULESET_ID[];
enum class ResourceType { … };
const char* ToString(ResourceType as_enum);
ResourceType ParseResourceType(std::string_view as_string);
std::u16string GetResourceTypeParseError(std::string_view as_string);
enum class RequestMethod { … };
const char* ToString(RequestMethod as_enum);
RequestMethod ParseRequestMethod(std::string_view as_string);
std::u16string GetRequestMethodParseError(std::string_view as_string);
enum class DomainType { … };
const char* ToString(DomainType as_enum);
DomainType ParseDomainType(std::string_view as_string);
std::u16string GetDomainTypeParseError(std::string_view as_string);
enum class HeaderOperation { … };
const char* ToString(HeaderOperation as_enum);
HeaderOperation ParseHeaderOperation(std::string_view as_string);
std::u16string GetHeaderOperationParseError(std::string_view as_string);
enum class RuleActionType { … };
const char* ToString(RuleActionType as_enum);
RuleActionType ParseRuleActionType(std::string_view as_string);
std::u16string GetRuleActionTypeParseError(std::string_view as_string);
enum class UnsupportedRegexReason { … };
const char* ToString(UnsupportedRegexReason as_enum);
UnsupportedRegexReason ParseUnsupportedRegexReason(std::string_view as_string);
std::u16string GetUnsupportedRegexReasonParseError(std::string_view as_string);
struct Ruleset { … };
struct QueryKeyValue { … };
struct QueryTransform { … };
struct URLTransform { … };
struct Redirect { … };
struct HeaderInfo { … };
struct RuleCondition { … };
struct HeaderRegexOptions { … };
struct ModifyHeaderInfo { … };
struct RuleAction { … };
struct Rule { … };
struct MatchedRule { … };
struct GetRulesFilter { … };
struct MatchedRuleInfo { … };
struct MatchedRulesFilter { … };
struct RulesMatchedDetails { … };
struct RequestDetails { … };
struct TestMatchRequestDetails { … };
struct MatchedRuleInfoDebug { … };
struct DNRInfo { … };
struct RegexOptions { … };
struct IsRegexSupportedResult { … };
struct TestMatchOutcomeResult { … };
struct UpdateRuleOptions { … };
struct UpdateRulesetOptions { … };
struct UpdateStaticRulesOptions { … };
struct GetDisabledRuleIdsOptions { … };
struct TabActionCountUpdate { … };
struct ExtensionActionOptions { … };
struct ManifestKeys { … };
namespace UpdateDynamicRules {
struct Params { … };
namespace Results {
base::Value::List Create();
}
}
namespace GetDynamicRules {
struct Params { … };
namespace Results {
base::Value::List Create(const std::vector<Rule>& rules);
}
}
namespace UpdateSessionRules {
struct Params { … };
namespace Results {
base::Value::List Create();
}
}
namespace GetSessionRules {
struct Params { … };
namespace Results {
base::Value::List Create(const std::vector<Rule>& rules);
}
}
namespace UpdateEnabledRulesets {
struct Params { … };
namespace Results {
base::Value::List Create();
}
}
namespace GetEnabledRulesets {
namespace Results {
base::Value::List Create(const std::vector<std::string>& ruleset_ids);
}
}
namespace UpdateStaticRules {
struct Params { … };
namespace Results {
base::Value::List Create();
}
}
namespace GetDisabledRuleIds {
struct Params { … };
namespace Results {
base::Value::List Create(const std::vector<int>& disabled_rule_ids);
}
}
namespace GetMatchedRules {
struct Params { … };
namespace Results {
base::Value::List Create(const RulesMatchedDetails& details);
}
}
namespace SetExtensionActionOptions {
struct Params { … };
namespace Results {
base::Value::List Create();
}
}
namespace IsRegexSupported {
struct Params { … };
namespace Results {
base::Value::List Create(const IsRegexSupportedResult& result);
}
}
namespace GetAvailableStaticRuleCount {
namespace Results {
base::Value::List Create(int count);
}
}
namespace TestMatchOutcome {
struct Params { … };
namespace Results {
base::Value::List Create(const TestMatchOutcomeResult& result);
}
}
namespace OnRuleMatchedDebug {
extern const char kEventName[];
base::Value::List Create(const MatchedRuleInfoDebug& info);
}
}
}
}
#endif