@predy-js/render-interface 0.1.76-beta.1 → 0.1.76-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/statistic.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Name: @predy-js/render-interface
3
3
  * Description: undefined
4
4
  * Author: undefined
5
- * Version: v0.1.76-beta.1
5
+ * Version: v0.1.76-beta.3
6
6
  */
7
7
 
8
8
  // https://github.com/greggman/webgl-memory/blob/main/src/texture-utils.js
@@ -2,6 +2,7 @@ import type { ImageBitmapCallback, ImageBitmapConstructor } from './ImageBitmapI
2
2
  import type { TypedArray, vec2, vec4 } from '../type';
3
3
  import type { GPUCapability } from '../GPUCapability';
4
4
  import type { StringTemplate } from '@predy-js/specification';
5
+ import type { ImageBitmapInternal } from './ImageBitmapInternal';
5
6
  export interface PredyRequestOptions {
6
7
  url: string;
7
8
  disableCache?: boolean;
@@ -19,20 +20,20 @@ export interface PredyRequestResponse {
19
20
  time: number;
20
21
  }
21
22
  export type PredyRequestCallback = (err: string | undefined, res: PredyRequestResponse) => void;
22
- export declare abstract class PredyNativeInternal {
23
- abstract createImageBitmap(data: TypedArray | string, //图片文件的数据
23
+ export interface PredyNativeInternal {
24
+ webpDisabled?: boolean;
25
+ createImageBitmap(data: TypedArray | string, //图片文件的数据
24
26
  options: ImageBitmapConstructor, callback: ImageBitmapCallback): void;
25
- abstract getDefaultGPUCapability(): GPUCapability;
26
- abstract requestWithCache(options: PredyRequestOptions, callback: PredyRequestCallback): void;
27
+ getDefaultGPUCapability(): GPUCapability;
28
+ requestWithCache(options: PredyRequestOptions, callback: PredyRequestCallback): void;
27
29
  /**
28
30
  * 将图片绘制到画布上,同时替换文案,绘制的顺序如下
29
31
  * 创建template.size尺寸的画布, 接下来的绘制均应用 template.offset
30
32
  * 将images绘制到画布上,images的尺寸由image.frame决定
31
33
  * 将数据模板content绘制到画布上,使用variables替换文案
32
34
  * @param template
33
- * @param variables
34
35
  */
35
- abstract renderImageTemplate(template: PredyResizeTemplate, variables: Record<string, string | number>): ImageBitmap;
36
+ renderImageTemplate(template: PredyResizeTemplate): ImageBitmapInternal;
36
37
  }
37
38
  export interface PredyResizeTemplate {
38
39
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@predy-js/render-interface",
3
- "version": "0.1.76-beta.1",
3
+ "version": "0.1.76-beta.3",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -2,6 +2,7 @@ import type { ImageBitmapCallback, ImageBitmapConstructor } from './ImageBitmapI
2
2
  import type { TypedArray, vec2, vec4 } from '../type';
3
3
  import type { GPUCapability } from '../GPUCapability';
4
4
  import type { StringTemplate } from '@predy-js/specification';
5
+ import type { ImageBitmapInternal } from './ImageBitmapInternal';
5
6
  export interface PredyRequestOptions {
6
7
  url: string,
7
8
  //用于测试缓存,生产中不要使用
@@ -25,13 +26,14 @@ export interface PredyRequestResponse {
25
26
 
26
27
  export type PredyRequestCallback = (err: string | undefined, res: PredyRequestResponse) => void;
27
28
 
28
- export declare abstract class PredyNativeInternal {
29
- abstract createImageBitmap (data: TypedArray | string, //图片文件的数据
30
- options: ImageBitmapConstructor, callback: ImageBitmapCallback): void;
29
+ export interface PredyNativeInternal {
30
+ webpDisabled?: boolean,
31
+ createImageBitmap (data: TypedArray | string, //图片文件的数据
32
+ options: ImageBitmapConstructor, callback: ImageBitmapCallback): void,
31
33
 
32
- abstract getDefaultGPUCapability (): GPUCapability;
34
+ getDefaultGPUCapability (): GPUCapability,
33
35
 
34
- abstract requestWithCache (options: PredyRequestOptions, callback: PredyRequestCallback): void;
36
+ requestWithCache (options: PredyRequestOptions, callback: PredyRequestCallback): void,
35
37
 
36
38
  /**
37
39
  * 将图片绘制到画布上,同时替换文案,绘制的顺序如下
@@ -39,9 +41,8 @@ export declare abstract class PredyNativeInternal {
39
41
  * 将images绘制到画布上,images的尺寸由image.frame决定
40
42
  * 将数据模板content绘制到画布上,使用variables替换文案
41
43
  * @param template
42
- * @param variables
43
44
  */
44
- abstract renderImageTemplate (template: PredyResizeTemplate, variables: Record<string, string | number>): ImageBitmap;
45
+ renderImageTemplate (template: PredyResizeTemplate): ImageBitmapInternal,
45
46
  }
46
47
  export interface PredyResizeTemplate {
47
48
  /**