@predy-js/render-interface 0.1.65-beta.3 → 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/README.md +4 -0
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -7
- package/dist/index.mjs.map +1 -1
- package/dist/statistic.js +1 -1
- package/dist/types/Texture.d.ts +8 -8
- package/dist/types/native/PredyNativeInternal.d.ts +0 -3
- package/package.json +1 -1
- package/types/Texture.ts +8 -8
- package/types/native/PredyNativeInternal.ts +0 -4
- package/types/native/declare.d.ts +5 -0
package/dist/statistic.js
CHANGED
package/dist/types/Texture.d.ts
CHANGED
@@ -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
|
117
|
+
sourceType: TextureSourceType.none;
|
118
118
|
target?: GLenum;
|
119
119
|
}
|
120
120
|
export interface Texture2DSourceOptionsImage extends TextureOptionsBase {
|
121
|
-
sourceType
|
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
|
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
|
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
|
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
|
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
|
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
|
206
|
+
sourceType: TextureSourceType;
|
207
207
|
}
|
208
208
|
export type TextureCubeSourceOptions = TextureCubeSourceOptionsImage | TextureCubeSourceOptionsImageMipmaps;
|
209
209
|
export type Texture2DSourceOptions = Texture2DSourceOptionsImage | Texture2DSourceOptionsData | Texture2DSourceOptionsVideo | Texture2DSourceOptionsImageMipmaps | Texture2DSourceOptionsCompressed | Texture2DSourceOptionsFrameBuffer;
|
package/package.json
CHANGED
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
|
131
|
+
sourceType: TextureSourceType.none,
|
132
132
|
target?: GLenum,
|
133
133
|
}
|
134
134
|
|
135
135
|
export interface Texture2DSourceOptionsImage extends TextureOptionsBase {
|
136
|
-
sourceType
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
-
}
|