@galacean/effects-specification 0.0.1
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 +28 -0
- package/dist/fallback/camera.d.ts +2 -0
- package/dist/fallback/filter.d.ts +2 -0
- package/dist/fallback/index.d.ts +12 -0
- package/dist/fallback/interact.d.ts +2 -0
- package/dist/fallback/migration.d.ts +5 -0
- package/dist/fallback/particle.d.ts +2 -0
- package/dist/fallback/sprite.d.ts +3 -0
- package/dist/fallback/utils.d.ts +29 -0
- package/dist/fallback.js +1664 -0
- package/dist/fallback.js.map +1 -0
- package/dist/fallback.mjs +1639 -0
- package/dist/fallback.mjs.map +1 -0
- package/dist/index.js +689 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +674 -0
- package/dist/index.mjs.map +1 -0
- package/dist/src/binary.d.ts +60 -0
- package/dist/src/composition.d.ts +111 -0
- package/dist/src/constants.d.ts +11 -0
- package/dist/src/image.d.ts +123 -0
- package/dist/src/index.d.ts +22 -0
- package/dist/src/item/base-item.d.ts +110 -0
- package/dist/src/item/camera-item.d.ts +69 -0
- package/dist/src/item/composition-item.d.ts +56 -0
- package/dist/src/item/filter-item.d.ts +99 -0
- package/dist/src/item/interact-item.d.ts +85 -0
- package/dist/src/item/model/binary.d.ts +85 -0
- package/dist/src/item/model/camera.d.ts +33 -0
- package/dist/src/item/model/index.d.ts +35 -0
- package/dist/src/item/model/light.d.ts +72 -0
- package/dist/src/item/model/material.d.ts +84 -0
- package/dist/src/item/model/mesh.d.ts +69 -0
- package/dist/src/item/model/render.d.ts +41 -0
- package/dist/src/item/model/skybox.d.ts +50 -0
- package/dist/src/item/model/tree.d.ts +65 -0
- package/dist/src/item/null-item.d.ts +46 -0
- package/dist/src/item/particle-item.d.ts +412 -0
- package/dist/src/item/particle-shape.d.ts +212 -0
- package/dist/src/item/plugin-item.d.ts +46 -0
- package/dist/src/item/spine-item.d.ts +93 -0
- package/dist/src/item/sprite-item.d.ts +71 -0
- package/dist/src/item/text-item.d.ts +172 -0
- package/dist/src/item.d.ts +17 -0
- package/dist/src/numberExpression.d.ts +279 -0
- package/dist/src/scene.d.ts +92 -0
- package/dist/src/text.d.ts +183 -0
- package/dist/src/type.d.ts +643 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Galacean Effects JSON definition
|
|
2
|
+
|
|
3
|
+
## 环境准备
|
|
4
|
+
|
|
5
|
+
- Node.js `>= 10.0.0`
|
|
6
|
+
|
|
7
|
+
## 本地开发
|
|
8
|
+
|
|
9
|
+
``` bash
|
|
10
|
+
# 1. 安装依赖(首次)
|
|
11
|
+
npm install
|
|
12
|
+
# 2. 编译
|
|
13
|
+
npm run build
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 测试
|
|
17
|
+
|
|
18
|
+
``` bash
|
|
19
|
+
npm run test
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
> 浏览器打开:http://localhost:9003/test/
|
|
23
|
+
|
|
24
|
+
## 发布
|
|
25
|
+
|
|
26
|
+
``` bash
|
|
27
|
+
tnpm publish
|
|
28
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BaseItem, Composition, CompressedImage, Image, JSONScene, ParticleItem, RenderLevel, SpriteItem, TemplateImage, VideoImage, FilterItem } from '../src';
|
|
2
|
+
export * from './utils';
|
|
3
|
+
export declare function getStandardJSON(json: any): JSONScene;
|
|
4
|
+
export declare function getStandardImage(image: any, index: number, imageTags: RenderLevel[]): TemplateImage | Image | CompressedImage | VideoImage;
|
|
5
|
+
export declare function getStandardComposition(composition: any, opt?: {
|
|
6
|
+
plugins?: string[];
|
|
7
|
+
requires?: string[];
|
|
8
|
+
}): Composition;
|
|
9
|
+
export declare function getStandardItem(item: any, opt?: {
|
|
10
|
+
plugins?: string[];
|
|
11
|
+
requires?: string[];
|
|
12
|
+
}): SpriteItem | ParticleItem | BaseItem | FilterItem;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BaseItemTransform, NullContent, SpriteContent } from '../src';
|
|
2
|
+
export declare function getStandardNullContent(sprite: any, transform: BaseItemTransform): NullContent;
|
|
3
|
+
export declare function getStandardSpriteContent(sprite: any, transform: BaseItemTransform): SpriteContent;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FixedNumberExpression, RGBAColorValue, ColorExpression, NumberExpression, GradientColor, FixedVec3Expression, vec4, vec3 } from '../src';
|
|
2
|
+
export declare function arrAdd<T>(arr: T[], item: T): boolean | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated 请直接使用 Array.prototype.forEach 或 for...of
|
|
5
|
+
* @param object
|
|
6
|
+
* @param callback
|
|
7
|
+
* @returns the mutated input object
|
|
8
|
+
*/
|
|
9
|
+
export declare function forEach<T>(object: null | undefined | {
|
|
10
|
+
[key: string]: T | Record<any, T>;
|
|
11
|
+
}, callback: (val: T, key: string) => void, thisObj?: any): {
|
|
12
|
+
[key: string]: T | Record<any, T>;
|
|
13
|
+
} | null | undefined;
|
|
14
|
+
export declare function ensureFixedNumber(a: any): FixedNumberExpression | undefined;
|
|
15
|
+
export declare function ensureFixedNumberWithRandom(a: any, p: number): FixedNumberExpression | undefined;
|
|
16
|
+
export declare function ensureRGBAValue(a: any): RGBAColorValue;
|
|
17
|
+
export declare function ensureColorExpression(a: any, normalized?: boolean): ColorExpression | undefined;
|
|
18
|
+
export declare function ensureNumberExpression(a: any): NumberExpression | undefined;
|
|
19
|
+
export declare function ensureValueGetter(a: any): NumberExpression | any;
|
|
20
|
+
export declare function ensureGradient(a: any, normalized?: boolean): GradientColor | undefined;
|
|
21
|
+
export declare function colorToArr(hex: string | number[], normalized?: boolean): vec4;
|
|
22
|
+
export declare function normalizeColor(a: number[]): number[] | undefined;
|
|
23
|
+
export declare function parsePercent(c: string): number;
|
|
24
|
+
export declare function getGradientColor(color: string | Array<string | number[]>, normalized?: boolean): GradientColor | undefined;
|
|
25
|
+
export declare function ensureFixedVec3(a: any): FixedVec3Expression | undefined;
|
|
26
|
+
export declare function objectValueToNumber(o: Record<string, any>): object;
|
|
27
|
+
export declare function deleteEmptyValue(o: Record<string, any>): object;
|
|
28
|
+
export declare function quatFromXYZRotation(out: vec4 | number[], x: number, y: number, z: number): vec4;
|
|
29
|
+
export declare function rotationZYXFromQuat(out: vec3 | number[], quat: vec4): vec3;
|