-
Notifications
You must be signed in to change notification settings - Fork 5
/
rect_js.h
28 lines (20 loc) · 822 Bytes
/
rect_js.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2019 The NodeBinding Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include "examples/point_js.h"
#include "examples/rect.h"
#include "napi.h"
class RectJs : public Napi::ObjectWrap<RectJs> {
public:
static void Init(Napi::Env env, Napi::Object exports);
RectJs(const Napi::CallbackInfo& info);
void SetTopLeft(const Napi::CallbackInfo& info, const Napi::Value& v);
void SetBottomRight(const Napi::CallbackInfo& info, const Napi::Value& v);
Napi::Value GetTopLeft(const Napi::CallbackInfo& info);
Napi::Value GetBottomRight(const Napi::CallbackInfo& info);
Napi::Value Area(const Napi::CallbackInfo& info);
private:
static Napi::FunctionReference constructor_;
Rect rect_;
};