@predy-js/render-interface 0.1.65-beta.2 → 0.1.65-beta.5

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.65-beta.2
5
+ * Version: v0.1.65-beta.5
6
6
  */
7
7
 
8
8
  // https://github.com/greggman/webgl-memory/blob/main/src/texture-utils.js
@@ -114,11 +114,11 @@ export type TextureSourceCubeData = [
114
114
  ];
115
115
  export type TextureSourceOptions = Texture2DSourceOptions | TextureCubeSourceOptions;
116
116
  export interface Texture2DSourceOptionsNone extends TextureOptionsBase {
117
- sourceType?: TextureSourceType.none;
117
+ sourceType: TextureSourceType.none;
118
118
  target?: GLenum;
119
119
  }
120
120
  export interface Texture2DSourceOptionsImage extends TextureOptionsBase {
121
- sourceType?: TextureSourceType.image;
121
+ sourceType: TextureSourceType.image;
122
122
  image: ImageSource;
123
123
  target?: WebGLRenderingContext['TEXTURE_2D'];
124
124
  generateMipmap?: boolean;
@@ -132,7 +132,7 @@ export interface Texture2DSourceOptionsFrameBuffer extends TextureOptionsBase {
132
132
  target?: WebGLRenderingContext['TEXTURE_2D'];
133
133
  }
134
134
  export interface Texture2DSourceOptionsData extends TextureOptionsBase {
135
- sourceType?: TextureSourceType.data;
135
+ sourceType: TextureSourceType.data;
136
136
  data: {
137
137
  data: TypedArray;
138
138
  width: number;
@@ -141,13 +141,13 @@ export interface Texture2DSourceOptionsData extends TextureOptionsBase {
141
141
  target?: WebGLRenderingContext['TEXTURE_2D'];
142
142
  }
143
143
  export interface Texture2DSourceOptionsVideo extends TextureOptionsBase {
144
- sourceType?: TextureSourceType.video;
144
+ sourceType: TextureSourceType.video;
145
145
  video: HTMLVideoElement;
146
146
  target?: WebGLRenderingContext['TEXTURE_2D'];
147
147
  generateMipmap?: boolean;
148
148
  }
149
149
  export interface Texture2DSourceOptionsImageMipmaps extends TextureOptionsBase {
150
- sourceType?: TextureSourceType.mipmaps;
150
+ sourceType: TextureSourceType.mipmaps;
151
151
  mipmaps: Array<ImageSource | {
152
152
  data: TypedArray;
153
153
  width: number;
@@ -156,7 +156,7 @@ export interface Texture2DSourceOptionsImageMipmaps extends TextureOptionsBase {
156
156
  target?: WebGLRenderingContext['TEXTURE_2D'];
157
157
  }
158
158
  export interface Texture2DSourceOptionsCompressed extends TextureOptionsBase {
159
- sourceType?: TextureSourceType.compressed;
159
+ sourceType: TextureSourceType.compressed;
160
160
  mipmaps: Array<{
161
161
  data: TypedArray;
162
162
  width: number;
@@ -171,7 +171,7 @@ export interface TextureCubeSourceOptionsImage extends TextureOptionsBase {
171
171
  generateMipmap?: boolean;
172
172
  }
173
173
  export interface TextureCubeSourceOptionsImageMipmaps extends TextureOptionsBase {
174
- sourceType?: TextureSourceType.mipmaps;
174
+ sourceType: TextureSourceType.mipmaps;
175
175
  mipmaps: Array<TextureSourceCubeData>;
176
176
  target: WebGLRenderingContext['TEXTURE_CUBE_MAP'];
177
177
  }
@@ -203,7 +203,7 @@ export interface TextureFormatOptions {
203
203
  type?: GLenum;
204
204
  }
205
205
  export interface TextureOptionsBase extends TextureConfigOptions, TextureFormatOptions {
206
- sourceType?: TextureSourceType;
206
+ sourceType: TextureSourceType;
207
207
  }
208
208
  export type TextureCubeSourceOptions = TextureCubeSourceOptionsImage | TextureCubeSourceOptionsImageMipmaps;
209
209
  export type Texture2DSourceOptions = Texture2DSourceOptionsImage | Texture2DSourceOptionsData | Texture2DSourceOptionsVideo | Texture2DSourceOptionsImageMipmaps | Texture2DSourceOptionsCompressed | Texture2DSourceOptionsFrameBuffer;
@@ -3,6 +3,3 @@ export declare abstract class PredyNativeInternal {
3
3
  abstract createImageBitmap(data: ArrayBuffer | string, //图片文件的数据
4
4
  options: ImageBitmapConstructor, callback: ImageBitmapCallback): void;
5
5
  }
6
- declare global {
7
- let predyNative: PredyNativeInternal;
8
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@predy-js/render-interface",
3
- "version": "0.1.65-beta.2",
3
+ "version": "0.1.65-beta.5",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
package/types/Texture.ts CHANGED
@@ -128,12 +128,12 @@ export type TextureSourceCubeData = [
128
128
  export type TextureSourceOptions = Texture2DSourceOptions | TextureCubeSourceOptions;
129
129
 
130
130
  export interface Texture2DSourceOptionsNone extends TextureOptionsBase {
131
- sourceType?: TextureSourceType.none,
131
+ sourceType: TextureSourceType.none,
132
132
  target?: GLenum,
133
133
  }
134
134
 
135
135
  export interface Texture2DSourceOptionsImage extends TextureOptionsBase {
136
- sourceType?: TextureSourceType.image,
136
+ sourceType: TextureSourceType.image,
137
137
  image: ImageSource,
138
138
  target?: WebGLRenderingContext['TEXTURE_2D'],
139
139
  generateMipmap?: boolean,
@@ -146,26 +146,26 @@ export interface Texture2DSourceOptionsFrameBuffer extends TextureOptionsBase {
146
146
  }
147
147
 
148
148
  export interface Texture2DSourceOptionsData extends TextureOptionsBase {
149
- sourceType?: TextureSourceType.data,
149
+ sourceType: TextureSourceType.data,
150
150
  data: { data: TypedArray, width: number, height: number },
151
151
  target?: WebGLRenderingContext['TEXTURE_2D'],
152
152
  }
153
153
 
154
154
  export interface Texture2DSourceOptionsVideo extends TextureOptionsBase {
155
- sourceType?: TextureSourceType.video,
155
+ sourceType: TextureSourceType.video,
156
156
  video: HTMLVideoElement,
157
157
  target?: WebGLRenderingContext['TEXTURE_2D'],
158
158
  generateMipmap?: boolean,
159
159
  }
160
160
 
161
161
  export interface Texture2DSourceOptionsImageMipmaps extends TextureOptionsBase {
162
- sourceType?: TextureSourceType.mipmaps,
162
+ sourceType: TextureSourceType.mipmaps,
163
163
  mipmaps: Array<ImageSource | { data: TypedArray, width: number, height: number }>,
164
164
  target?: WebGLRenderingContext['TEXTURE_2D'],
165
165
  }
166
166
 
167
167
  export interface Texture2DSourceOptionsCompressed extends TextureOptionsBase {
168
- sourceType?: TextureSourceType.compressed,
168
+ sourceType: TextureSourceType.compressed,
169
169
  mipmaps: Array<{ data: TypedArray, width: number, height: number }>,
170
170
  target?: WebGLRenderingContext['TEXTURE_2D'],
171
171
  }
@@ -178,7 +178,7 @@ export interface TextureCubeSourceOptionsImage extends TextureOptionsBase {
178
178
  }
179
179
 
180
180
  export interface TextureCubeSourceOptionsImageMipmaps extends TextureOptionsBase {
181
- sourceType?: TextureSourceType.mipmaps,
181
+ sourceType: TextureSourceType.mipmaps,
182
182
  mipmaps: Array<TextureSourceCubeData>,
183
183
  target: WebGLRenderingContext['TEXTURE_CUBE_MAP'],
184
184
  }
@@ -216,7 +216,7 @@ export interface TextureFormatOptions {
216
216
  }
217
217
 
218
218
  export interface TextureOptionsBase extends TextureConfigOptions, TextureFormatOptions {
219
- sourceType?: TextureSourceType,
219
+ sourceType: TextureSourceType,
220
220
  }
221
221
 
222
222
  export type TextureCubeSourceOptions = TextureCubeSourceOptionsImage | TextureCubeSourceOptionsImageMipmaps;
@@ -4,7 +4,3 @@ export declare abstract class PredyNativeInternal {
4
4
  abstract createImageBitmap (data: ArrayBuffer | string, //图片文件的数据
5
5
  options: ImageBitmapConstructor, callback: ImageBitmapCallback): void;
6
6
  }
7
- // 给全局global 添加 predyNative: PredyNativeInternal
8
- declare global {
9
- let predyNative: PredyNativeInternal;
10
- }
@@ -0,0 +1,5 @@
1
+ // 给全局global 添加 predyNative: PredyNativeInternal
2
+ import { PredyNativeInternal } from './PredyNativeInternal';
3
+ declare global {
4
+ let predyNative: PredyNativeInternal;
5
+ }