chromium/out/Default/gen/extensions/common/api/extension_types.h

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// GENERATED FROM THE API DEFINITION IN
//   extensions/common/api/extension_types.json
// by tools/json_schema_compiler.
// DO NOT EDIT.

#ifndef EXTENSIONS_COMMON_API_EXTENSION_TYPES_H__
#define EXTENSIONS_COMMON_API_EXTENSION_TYPES_H__

#include <stdint.h>

#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "base/values.h"
#include <string_view>


namespace extensions {
namespace api {
namespace extension_types {

//
// Types
//

// The format of an image.
enum class ImageFormat {};


const char* ToString(ImageFormat as_enum);
ImageFormat ParseImageFormat(std::string_view as_string);
std::u16string GetImageFormatParseError(std::string_view as_string);

// Details about the format and quality of an image.
struct ImageDetails {};

// The soonest that the JavaScript or CSS will be injected into the tab.
enum class RunAt {};


const char* ToString(RunAt as_enum);
RunAt ParseRunAt(std::string_view as_string);
std::u16string GetRunAtParseError(std::string_view as_string);

// The <a
// href="https://www.w3.org/TR/css3-cascade/#cascading-origins">origin</a> of
// injected CSS.
enum class CSSOrigin {};


const char* ToString(CSSOrigin as_enum);
CSSOrigin ParseCSSOrigin(std::string_view as_string);
std::u16string GetCSSOriginParseError(std::string_view as_string);

// Details of the script or CSS to inject. Either the code or the file property
// must be set, but both may not be set at the same time.
struct InjectDetails {};

// Details of the CSS to remove. Either the code or the file property must be
// set, but both may not be set at the same time.
struct DeleteInjectionDetails {};

// The type of frame.
enum class FrameType {};


const char* ToString(FrameType as_enum);
FrameType ParseFrameType(std::string_view as_string);
std::u16string GetFrameTypeParseError(std::string_view as_string);

// The document lifecycle of the frame.
enum class DocumentLifecycle {};


const char* ToString(DocumentLifecycle as_enum);
DocumentLifecycle ParseDocumentLifecycle(std::string_view as_string);
std::u16string GetDocumentLifecycleParseError(std::string_view as_string);

// The JavaScript world for a script to execute within. Can either be an
// isolated world unique to this extension, the main world of the DOM which is
// shared with the page's JavaScript, or a user scripts world that is only
// available for scripts registered with the User Scripts API.
enum class ExecutionWorld {};


const char* ToString(ExecutionWorld as_enum);
ExecutionWorld ParseExecutionWorld(std::string_view as_string);
std::u16string GetExecutionWorldParseError(std::string_view as_string);


}  // namespace extension_types
}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_COMMON_API_EXTENSION_TYPES_H__