Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3.8.5] [Bug] Fix some definition errors, cherry-pick from #16471 #17008

Merged
merged 2 commits into from
May 20, 2024

Conversation

dumganhar
Copy link
Contributor

#16471

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

VisualSJ and others added 2 commits May 17, 2024 21:27
# Conflicts:
#	cocos/spine/lib/spine-core.d.ts
#	package.json
@dumganhar dumganhar requested a review from minggo May 17, 2024 13:28
Copy link

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -20121,8 +20121,32 @@
              * @param array @zh 用来拷贝的数组。@en The array to be copied from.
              * @returns @zh 数组的副本。@en A new array has the same values as `array`.
              */
             export function copy<T>(array: T[]): T[];
+            /**
+             * @example
+             * ```
+             * import { js } from 'cc';
+             * var array = [0, 1, 2, 3, 4];
+             * var iterator = new js.array.MutableForwardIterator(array);
+             * for (iterator.i = 0; iterator.i < array.length; ++iterator.i) {
+             *     var item = array[iterator.i];
+             *     ...
+             * }
+             * ```
+             */
+            export class MutableForwardIterator<T> {
+                array: T[];
+                i: number;
+                constructor(array: T[]);
+                get length(): number;
+                set length(value: number);
+                remove(value: T): void;
+                removeAt(i: number): void;
+                fastRemove(value: T): void;
+                fastRemoveAt(i: number): void;
+                push(item: T): void;
+            }
         }
         /**
          * @deprecated since v3.7.0, `js.js` is deprecated, please access `js` directly instead.
          */
@@ -51477,9 +51501,9 @@
                 event(entry: TrackEntry, event: Event): void;
             }
             export class AnimationStateData {
                 skeletonData: SkeletonData;
-                animationToMixTime: Map<number>;
+                animationToMixTime: Map<string, number>;
                 defaultMix: number;
                 constructor(skeletonData: SkeletonData);
                 setMix(fromName: string, toName: string, duration: number): void;
                 setMixWith(from: Animation, to: Animation, duration: number): void;
@@ -51499,9 +51523,9 @@
                 getToLoad(): number;
                 getLoaded(): number;
                 dispose(): void;
                 hasErrors(): boolean;
-                getErrors(): Map<string>;
+                getErrors(): Map<string, string>;
             }
             export class AtlasAttachmentLoader implements AttachmentLoader {
                 atlas: TextureAtlas;
                 constructor(atlas: TextureAtlas);
@@ -51698,9 +51722,9 @@
                 get(clientId: string, path: string): any;
                 isLoadingComplete(clientId: string): boolean;
                 dispose(): void;
                 hasErrors(): boolean;
-                getErrors(): Map<string>;
+                getErrors(): Map<string, string>;
             }
             export class Skeleton {
                 data: SkeletonData;
                 bones: Array<Bone>;
@@ -51823,9 +51847,9 @@
             export class SkeletonJson {
                 attachmentLoader: AttachmentLoader;
                 scale: number;
                 constructor(attachmentLoader: AttachmentLoader);
-                readSkeletonData(json: any): SkeletonData;
+                readSkeletonData(json: string): SkeletonData;
                 readAttachment(map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment;
                 readVertices(map: any, attachment: VertexAttachment, verticesLength: number): void;
                 readAnimation(map: any, name: string, skeletonData: SkeletonData): void;
                 readCurve(map: any, timeline: CurveTimeline, frameIndex: number): void;
@@ -51843,9 +51867,9 @@
                 constructor(slotIndex: number, name: string, attachment: Attachment);
             }
             export class Skin {
                 name: string;
-                attachments: Map<Attachment>[];
+                attachments: Map<string, Attachment>[];
                 bones: BoneData[];
                 constraints: ConstraintData[];
                 constructor(name: string);
                 setAttachment(slotIndex: number, name: string, attachment: Attachment): void;
@@ -51993,11 +52017,8 @@
             export abstract class Updatable {
                 update(): void;
                 isActive(): boolean;
             }
-            export interface Map<T> {
-                [key: string]: T;
-            }
             export class IntSet {
                 array: number[];
                 add(value: number): boolean;
                 contains(value: number): boolean;

@@ -319,7 +319,7 @@ export class PassStatesEditor implements EffectAsset.IPassStates {
@type(BlendStateEditor)
@serializable
@editable
public blendState: BlendStateEditor = new BlendStateEditor();
public blendState: any = new BlendStateEditor();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the type is any?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think he just want to avoid this error:

Property 'blendState' in type 'PassStatesEditor' is not assignable to the same property in base type 'IPassStates'.
  Type 'BlendStateEditor' is missing the following properties from type 'BlendState': _token, native, setTarget, reset, destroyts(2416)
(property) PassStatesEditor.blendState: BlendStateEditor

@minggo minggo merged commit 163d0e1 into cocos:v3.8.5 May 20, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants