UNPKG

@juzi/wechaty

Version:

Wechaty is a RPA SDK for Chatbot Makers.

58 lines 1.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LocationImpl = void 0; const config_js_1 = require("../config.js"); const validation_js_1 = require("../user-mixins/validation.js"); const wechatify_js_1 = require("../user-mixins/wechatify.js"); class LocationMixin extends (0, wechatify_js_1.wechatifyMixinBase)() { payload; /** * * Create * @param poi string A point of interest (POI) is a specific point location that someone may find useful or interesting. * See: https://en.wikipedia.org/wiki/Point_of_interest */ static async create(poi) { config_js_1.log.verbose('Location', 'create(%s)', poi); const payload = { accuracy: 15, address: '北京市北京市海淀区45 Chengfu Rd', latitude: 39.995120999999997, longitude: 116.334154, name: poi, // Huan(202109): FIXME: generate payload by poi }; return new this(payload); } /* * @hideconstructor */ constructor(payload) { super(); this.payload = payload; config_js_1.log.verbose('Location', 'constructor()'); // Huan(202110): it is ok to create a raw one without wechaty instance // guardWechatifyClass.call(this, Location) } toString() { return `Location<${this.payload.name}>`; } address() { return this.payload.address; } latitude() { return this.payload.latitude; } longitude() { return this.payload.longitude; } name() { return this.payload.name; } accuracy() { return this.payload.accuracy; } } class LocationImpl extends (0, validation_js_1.validationMixin)(LocationMixin)() { } exports.LocationImpl = LocationImpl; //# sourceMappingURL=location.js.map