提交 e1d3fd44 编写于 作者: D DCloud_LXH

fix(canvas): declared but never used

上级 94f0776e
......@@ -360,7 +360,7 @@ type DefaultState = typeof defaultState
type Callback = (result: any) => void | undefined
type LineCapType = 'butt' | 'round' | 'square'
type LineJoinType = 'bevel' | 'round' | 'miter'
type TextAlignType = 'left' | 'center' | 'right'
// type TextAlignType = 'left' | 'center' | 'right'
type TextBaselineType = 'top' | 'bottom' | 'middle' | 'normal'
export class CanvasContext implements UniApp.CanvasContext {
......
......@@ -879,7 +879,6 @@ function getSameOriginUrl(url) {
}
return urlToFile(url).then(fileToUrl);
}
const API_ON_TAB_BAR_MID_BUTTON_TAP = "onTabBarMidButtonTap";
const canvasEventCallbacks = createCallbacks("canvasEvent");
ServiceJSBridge.subscribe("onCanvasMethodCallback", ({callbackId, data}) => {
const callback = canvasEventCallbacks.pop(callbackId);
......@@ -887,6 +886,7 @@ ServiceJSBridge.subscribe("onCanvasMethodCallback", ({callbackId, data}) => {
callback(data);
}
});
const API_ON_TAB_BAR_MID_BUTTON_TAP = "onTabBarMidButtonTap";
const API_GET_STORAGE = "getStorage";
const GetStorageProtocol = {
key: {
......
......@@ -2088,64 +2088,6 @@ const createMapContext = /* @__PURE__ */ defineSyncApi(API_CREATE_MAP_CONTEXT, (
}
return new MapContext(id2, getCurrentPageVm());
}, CreateMapContextProtocol);
const defaultOptions = {
thresholds: [0],
initialRatio: 0,
observeAll: false
};
const MARGINS = ["top", "right", "bottom", "left"];
let reqComponentObserverId = 1;
function normalizeRootMargin(margins = {}) {
return MARGINS.map((name) => `${Number(margins[name]) || 0}px`).join(" ");
}
class ServiceIntersectionObserver {
constructor(component, options) {
this._pageId = getPageIdByVm(component);
this._component = component;
this._options = extend({}, defaultOptions, options);
}
relativeTo(selector, margins) {
this._options.relativeToSelector = selector;
this._options.rootMargin = normalizeRootMargin(margins);
return this;
}
relativeToViewport(margins) {
this._options.relativeToSelector = void 0;
this._options.rootMargin = normalizeRootMargin(margins);
return this;
}
observe(selector, callback2) {
if (!isFunction(callback2)) {
return;
}
this._options.selector = selector;
this._reqId = reqComponentObserverId++;
addIntersectionObserver({
reqId: this._reqId,
component: this._component,
options: this._options,
callback: callback2
}, this._pageId);
}
disconnect() {
this._reqId && removeIntersectionObserver({reqId: this._reqId, component: this._component}, this._pageId);
}
}
const createIntersectionObserver = /* @__PURE__ */ defineSyncApi("createIntersectionObserver", (context, options) => {
if (context && !getPageIdByVm(context)) {
options = context;
context = null;
}
if (context) {
return new ServiceIntersectionObserver(context, options);
}
return new ServiceIntersectionObserver(getCurrentPageVm(), options);
});
const createSelectorQuery = () => {
};
const API_ON_TAB_BAR_MID_BUTTON_TAP = "onTabBarMidButtonTap";
const onTabBarMidButtonTap = /* @__PURE__ */ defineOnApi(API_ON_TAB_BAR_MID_BUTTON_TAP, () => {
});
function getInt(name, defaultValue) {
return function(value, params) {
if (value) {
......@@ -3053,6 +2995,64 @@ const canvasToTempFilePath = /* @__PURE__ */ defineAsyncApi(API_CANVAS_TO_TEMP_F
callbackId: cId
});
}, CanvasToTempFilePathProtocol, CanvasToTempFilePathOptions);
const defaultOptions = {
thresholds: [0],
initialRatio: 0,
observeAll: false
};
const MARGINS = ["top", "right", "bottom", "left"];
let reqComponentObserverId = 1;
function normalizeRootMargin(margins = {}) {
return MARGINS.map((name) => `${Number(margins[name]) || 0}px`).join(" ");
}
class ServiceIntersectionObserver {
constructor(component, options) {
this._pageId = getPageIdByVm(component);
this._component = component;
this._options = extend({}, defaultOptions, options);
}
relativeTo(selector, margins) {
this._options.relativeToSelector = selector;
this._options.rootMargin = normalizeRootMargin(margins);
return this;
}
relativeToViewport(margins) {
this._options.relativeToSelector = void 0;
this._options.rootMargin = normalizeRootMargin(margins);
return this;
}
observe(selector, callback2) {
if (!isFunction(callback2)) {
return;
}
this._options.selector = selector;
this._reqId = reqComponentObserverId++;
addIntersectionObserver({
reqId: this._reqId,
component: this._component,
options: this._options,
callback: callback2
}, this._pageId);
}
disconnect() {
this._reqId && removeIntersectionObserver({reqId: this._reqId, component: this._component}, this._pageId);
}
}
const createIntersectionObserver = /* @__PURE__ */ defineSyncApi("createIntersectionObserver", (context, options) => {
if (context && !getPageIdByVm(context)) {
options = context;
context = null;
}
if (context) {
return new ServiceIntersectionObserver(context, options);
}
return new ServiceIntersectionObserver(getCurrentPageVm(), options);
});
const createSelectorQuery = () => {
};
const API_ON_TAB_BAR_MID_BUTTON_TAP = "onTabBarMidButtonTap";
const onTabBarMidButtonTap = /* @__PURE__ */ defineOnApi(API_ON_TAB_BAR_MID_BUTTON_TAP, () => {
});
const API_CAN_I_USE = "canIUse";
const CanIUseProtocol = [
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册