#ifndef FXJS_JS_DEFINE_H_
#define FXJS_JS_DEFINE_H_
#include <memory>
#include "core/fxcrt/span.h"
#include "core/fxcrt/unowned_ptr.h"
#include "fxjs/cfxjs_engine.h"
#include "fxjs/cjs_result.h"
#include "fxjs/cjs_runtime.h"
#include "fxjs/js_resources.h"
#include "v8/include/v8-local-handle.h"
class CJS_Object;
double JS_DateParse(v8::Isolate* pIsolate, const WideString& str);
v8::LocalVector<v8::Value> ExpandKeywordParams(
CJS_Runtime* pRuntime,
pdfium::span<v8::Local<v8::Value>> originals,
size_t nKeywords,
...);
bool IsExpandedParamKnown(v8::Local<v8::Value> value);
template <class T>
static void JSConstructor(CFXJS_Engine* pEngine,
v8::Local<v8::Object> obj,
v8::Local<v8::Object> proxy) { … }
void JSDestructor(v8::Local<v8::Object> obj);
template <class C>
UnownedPtr<C> JSGetObject(v8::Isolate* isolate, v8::Local<v8::Object> obj) { … }
template <class C, CJS_Result (C::*M)(CJS_Runtime*)>
void JSPropGetter(const char* prop_name_string,
const char* class_name_string,
v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Value>& info) { … }
template <class C, CJS_Result (C::*M)(CJS_Runtime*, v8::Local<v8::Value>)>
void JSPropSetter(const char* prop_name_string,
const char* class_name_string,
v8::Local<v8::Name> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info) { … }
template <class C,
CJS_Result (C::*M)(CJS_Runtime*, pdfium::span<v8::Local<v8::Value>>)>
void JSMethod(const char* method_name_string,
const char* class_name_string,
const v8::FunctionCallbackInfo<v8::Value>& info) { … }
#define JS_STATIC_PROP(err_name, prop_name, class_name) …
#define JS_STATIC_METHOD(method_name, class_name) …
#endif