@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.
Files changed (49) hide show
  1. package/README.md +28 -0
  2. package/dist/fallback/camera.d.ts +2 -0
  3. package/dist/fallback/filter.d.ts +2 -0
  4. package/dist/fallback/index.d.ts +12 -0
  5. package/dist/fallback/interact.d.ts +2 -0
  6. package/dist/fallback/migration.d.ts +5 -0
  7. package/dist/fallback/particle.d.ts +2 -0
  8. package/dist/fallback/sprite.d.ts +3 -0
  9. package/dist/fallback/utils.d.ts +29 -0
  10. package/dist/fallback.js +1664 -0
  11. package/dist/fallback.js.map +1 -0
  12. package/dist/fallback.mjs +1639 -0
  13. package/dist/fallback.mjs.map +1 -0
  14. package/dist/index.js +689 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/index.mjs +674 -0
  17. package/dist/index.mjs.map +1 -0
  18. package/dist/src/binary.d.ts +60 -0
  19. package/dist/src/composition.d.ts +111 -0
  20. package/dist/src/constants.d.ts +11 -0
  21. package/dist/src/image.d.ts +123 -0
  22. package/dist/src/index.d.ts +22 -0
  23. package/dist/src/item/base-item.d.ts +110 -0
  24. package/dist/src/item/camera-item.d.ts +69 -0
  25. package/dist/src/item/composition-item.d.ts +56 -0
  26. package/dist/src/item/filter-item.d.ts +99 -0
  27. package/dist/src/item/interact-item.d.ts +85 -0
  28. package/dist/src/item/model/binary.d.ts +85 -0
  29. package/dist/src/item/model/camera.d.ts +33 -0
  30. package/dist/src/item/model/index.d.ts +35 -0
  31. package/dist/src/item/model/light.d.ts +72 -0
  32. package/dist/src/item/model/material.d.ts +84 -0
  33. package/dist/src/item/model/mesh.d.ts +69 -0
  34. package/dist/src/item/model/render.d.ts +41 -0
  35. package/dist/src/item/model/skybox.d.ts +50 -0
  36. package/dist/src/item/model/tree.d.ts +65 -0
  37. package/dist/src/item/null-item.d.ts +46 -0
  38. package/dist/src/item/particle-item.d.ts +412 -0
  39. package/dist/src/item/particle-shape.d.ts +212 -0
  40. package/dist/src/item/plugin-item.d.ts +46 -0
  41. package/dist/src/item/spine-item.d.ts +93 -0
  42. package/dist/src/item/sprite-item.d.ts +71 -0
  43. package/dist/src/item/text-item.d.ts +172 -0
  44. package/dist/src/item.d.ts +17 -0
  45. package/dist/src/numberExpression.d.ts +279 -0
  46. package/dist/src/scene.d.ts +92 -0
  47. package/dist/src/text.d.ts +183 -0
  48. package/dist/src/type.d.ts +643 -0
  49. 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,2 @@
1
+ import type { CameraContent } from '../src/item/camera-item';
2
+ export declare function getStandardCameraContent(model: any): CameraContent;
@@ -0,0 +1,2 @@
1
+ import type { FilterParams } from '../src/item/filter-item';
2
+ export declare function getStandardFilterContent(filter: any): FilterParams;
@@ -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,2 @@
1
+ import type { InteractContent } from '../src';
2
+ export declare function getStandardInteractContent(ui: any): InteractContent;
@@ -0,0 +1,5 @@
1
+ import type { JSONScene } from '../src/scene';
2
+ /**
3
+ * 2.1 以下版本数据适配(mars-player@2.4.0 及以上版本支持 2.1 以下数据的适配)
4
+ */
5
+ export declare function version21Migration(json: JSONScene): JSONScene;
@@ -0,0 +1,2 @@
1
+ import type { ParticleContent } from '../src';
2
+ export declare function getStandardParticleContent(particle: any): ParticleContent;
@@ -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;