-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # cocos/spine/lib/spine-core.d.ts # package.json
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;
|
minggo
reviewed
May 20, 2024
@@ -319,7 +319,7 @@ export class PassStatesEditor implements EffectAsset.IPassStates { | |||
@type(BlendStateEditor) | |||
@serializable | |||
@editable | |||
public blendState: BlendStateEditor = new BlendStateEditor(); | |||
public blendState: any = new BlendStateEditor(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
approved these changes
May 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#16471
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: