feat:Remove Image's setImagePixels API
This commit is contained in:
@@ -2316,14 +2316,6 @@ var Image = /** @class */ (function (_super) {
|
||||
Image.prototype.getImagePixels = function (context) {
|
||||
return this.nativeChannel(context, "getImagePixels")();
|
||||
};
|
||||
Image.prototype.setImagePixels = function (context, imagePixels) {
|
||||
if (Environment.platform === 'iOS') {
|
||||
imagePixels.pixels = context.function2Id(function () {
|
||||
return imagePixels.pixels;
|
||||
});
|
||||
}
|
||||
return this.nativeChannel(context, "setImagePixels")(imagePixels);
|
||||
};
|
||||
Image.prototype.toModel = function () {
|
||||
var ret = _super.prototype.toModel.call(this);
|
||||
if (Environment.platform === 'iOS') {
|
||||
|
@@ -1726,14 +1726,6 @@ class Image extends View {
|
||||
getImagePixels(context) {
|
||||
return this.nativeChannel(context, "getImagePixels")();
|
||||
}
|
||||
setImagePixels(context, imagePixels) {
|
||||
if (Environment.platform === 'iOS') {
|
||||
imagePixels.pixels = context.function2Id(() => {
|
||||
return imagePixels.pixels;
|
||||
});
|
||||
}
|
||||
return this.nativeChannel(context, "setImagePixels")(imagePixels);
|
||||
}
|
||||
toModel() {
|
||||
const ret = super.toModel();
|
||||
if (Environment.platform === 'iOS') {
|
||||
|
@@ -3254,14 +3254,6 @@ class Image extends View {
|
||||
getImagePixels(context) {
|
||||
return this.nativeChannel(context, "getImagePixels")();
|
||||
}
|
||||
setImagePixels(context, imagePixels) {
|
||||
if (Environment.platform === 'iOS') {
|
||||
imagePixels.pixels = context.function2Id(() => {
|
||||
return imagePixels.pixels;
|
||||
});
|
||||
}
|
||||
return this.nativeChannel(context, "setImagePixels")(imagePixels);
|
||||
}
|
||||
toModel() {
|
||||
const ret = super.toModel();
|
||||
if (Environment.platform === 'iOS') {
|
||||
|
5
doric-js/index.d.ts
vendored
5
doric-js/index.d.ts
vendored
@@ -714,11 +714,6 @@ declare module 'doric/lib/src/widget/image' {
|
||||
mimeType: string;
|
||||
}>;
|
||||
getImagePixels(context: BridgeContext): Promise<ArrayBuffer>;
|
||||
setImagePixels(context: BridgeContext, imagePixels: {
|
||||
width: number;
|
||||
height: number;
|
||||
pixels: ArrayBuffer;
|
||||
}): Promise<void>;
|
||||
toModel(): NativeViewModel;
|
||||
}
|
||||
export function image(config: Partial<Image>): Image;
|
||||
|
5
doric-js/lib/src/widget/image.d.ts
vendored
5
doric-js/lib/src/widget/image.d.ts
vendored
@@ -95,11 +95,6 @@ export declare class Image extends View {
|
||||
mimeType: string;
|
||||
}>;
|
||||
getImagePixels(context: BridgeContext): Promise<ArrayBuffer>;
|
||||
setImagePixels(context: BridgeContext, imagePixels: {
|
||||
width: number;
|
||||
height: number;
|
||||
pixels: ArrayBuffer;
|
||||
}): Promise<void>;
|
||||
toModel(): NativeViewModel;
|
||||
}
|
||||
export declare function image(config: Partial<Image>): Image;
|
||||
|
@@ -48,14 +48,6 @@ export class Image extends View {
|
||||
getImagePixels(context) {
|
||||
return this.nativeChannel(context, "getImagePixels")();
|
||||
}
|
||||
setImagePixels(context, imagePixels) {
|
||||
if (Environment.platform === 'iOS') {
|
||||
imagePixels.pixels = context.function2Id(() => {
|
||||
return imagePixels.pixels;
|
||||
});
|
||||
}
|
||||
return this.nativeChannel(context, "setImagePixels")(imagePixels);
|
||||
}
|
||||
toModel() {
|
||||
const ret = super.toModel();
|
||||
if (Environment.platform === 'iOS') {
|
||||
|
@@ -150,22 +150,6 @@ export class Image extends View {
|
||||
return this.nativeChannel(context, "getImagePixels")()
|
||||
}
|
||||
|
||||
setImagePixels(
|
||||
context: BridgeContext,
|
||||
imagePixels: {
|
||||
width: number,
|
||||
height: number,
|
||||
pixels: ArrayBuffer
|
||||
}): Promise<void> {
|
||||
if (Environment.platform === 'iOS') {
|
||||
(imagePixels.pixels as unknown as any) = context.function2Id(() => {
|
||||
return imagePixels.pixels
|
||||
})
|
||||
}
|
||||
return this.nativeChannel(context, "setImagePixels")(imagePixels)
|
||||
}
|
||||
|
||||
|
||||
toModel() {
|
||||
const ret = super.toModel()
|
||||
if (Environment.platform === 'iOS') {
|
||||
|
Reference in New Issue
Block a user