From 45d94a320126cf0c29764b7b18a866c8702aac20 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Thu, 14 Aug 2025 09:05:00 +0200 Subject: [PATCH] Updated ts-def to r452. --- .../Tween/ITweenBehaviorInstance.d.ts | 2 +- .../ts-defs/editor/IPluginInfo.d.ts | 2 +- .../ts-defs/editor/model/IProject.d.ts | 8 +++++- .../plugins/9-patch/I9PatchInstance.d.ts | 22 +++++++++++++++ .../ICGSObjectType.d.ts | 28 ++++++++++++++++++- .../ts-defs/runtime/IFamily.d.ts | 2 +- .../ts-defs/runtime/IObjectType.d.ts | 2 +- .../ts-defs/runtime/IPlatformInfo.d.ts | 4 +-- .../ts-defs/runtime/IRenderer.d.ts | 2 +- .../ts-defs/runtime/IRuntime.d.ts | 10 +++++-- .../ts-defs/runtime/ITweenState.d.ts | 2 ++ 11 files changed, 73 insertions(+), 11 deletions(-) create mode 100644 spine-ts/spine-construct3/ts-defs/plugins/9-patch/I9PatchInstance.d.ts diff --git a/spine-ts/spine-construct3/ts-defs/behaviors/Tween/ITweenBehaviorInstance.d.ts b/spine-ts/spine-construct3/ts-defs/behaviors/Tween/ITweenBehaviorInstance.d.ts index 49731d54e..97959f5da 100644 --- a/spine-ts/spine-construct3/ts-defs/behaviors/Tween/ITweenBehaviorInstance.d.ts +++ b/spine-ts/spine-construct3/ts-defs/behaviors/Tween/ITweenBehaviorInstance.d.ts @@ -19,7 +19,7 @@ interface StartTweenOpts { * @see {@link https://www.construct.net/make-games/manuals/construct-3/scripting/scripting-reference/behavior-interfaces/tween | ITweenBehaviorInstance documentation } */ declare class ITweenBehaviorInstance extends IBehaviorInstance { - startTween(prop: TweenPropertyType, endValue: TweenEndValueType, time: number, ease: TweenBuiltInEaseType, opts?: StartTweenOpts): ITweenState; + startTween(prop: TweenPropertyType, endValue: TweenEndValueType, time: number, ease: TweenBuiltInEaseType | TweenCustomEaseType, opts?: StartTweenOpts): ITweenState; allTweens(): Generator; tweensByTags(tags: string | string[]): Generator; diff --git a/spine-ts/spine-construct3/ts-defs/editor/IPluginInfo.d.ts b/spine-ts/spine-construct3/ts-defs/editor/IPluginInfo.d.ts index a1d4f62d7..2f08772cf 100644 --- a/spine-ts/spine-construct3/ts-defs/editor/IPluginInfo.d.ts +++ b/spine-ts/spine-construct3/ts-defs/editor/IPluginInfo.d.ts @@ -22,7 +22,7 @@ interface PluginInfoFileDependency { fileType?: string, scriptType?: PluginInfoScriptType, type: "copy-to-output" | "external-dom-script" | "external-runtime-script" | "external-css" | "wrapper-extension", - platform?: "all" | "windows-x86" | "windows-x64" | "windows-arm64" | "xbox-uwp-x64" | "macos-universal" | "linux-x64" | "linux-arm" | "linux-arm64" + platform?: "all" | "windows-x64" | "windows-arm64" | "xbox-uwp-x64" | "macos-universal" | "linux-x64" | "linux-arm64" } declare namespace SDK { diff --git a/spine-ts/spine-construct3/ts-defs/editor/model/IProject.d.ts b/spine-ts/spine-construct3/ts-defs/editor/model/IProject.d.ts index 4fb508b48..a29b21383 100644 --- a/spine-ts/spine-construct3/ts-defs/editor/model/IProject.d.ts +++ b/spine-ts/spine-construct3/ts-defs/editor/model/IProject.d.ts @@ -15,9 +15,15 @@ declare namespace SDK { GetInstanceByUID(uid: number): SDK.IObjectInstance | null; AddOrReplaceProjectFile(blob: Blob, filename: string, kind?: EditorProjectFileKind): void; - GetProjectFileByName(name: string): SDK.IProjectFile | null; + + GetProjectFileBySID(sid: number): SDK.IProjectFile | null; GetProjectFileByExportPath(path: string): SDK.IProjectFile | null; + /** + * @deprecated Use GetProjectFileByExportPath() instead of GetProjectFileByName() as it supports files with the same name in different folders. + */ + GetProjectFileByName(name: string): SDK.IProjectFile | null; + ShowImportAudioDialog(fileList: Blob[]): void; EnsureFontLoaded(fontName: string): Promise; diff --git a/spine-ts/spine-construct3/ts-defs/plugins/9-patch/I9PatchInstance.d.ts b/spine-ts/spine-construct3/ts-defs/plugins/9-patch/I9PatchInstance.d.ts new file mode 100644 index 000000000..c4392aacd --- /dev/null +++ b/spine-ts/spine-construct3/ts-defs/plugins/9-patch/I9PatchInstance.d.ts @@ -0,0 +1,22 @@ + +type NinePatchEdgeType = "tile" | "stretch"; +type NinePatchFillType = "tile" | "stretch" | "transparent"; +type NinePatchSeamsType = "exact" | "overlap"; + +/** Represents the 9-patch object. + * @see {@link https://www.construct.net/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/9-patch | I9PatchInstance documentation } */ +declare class I9PatchInstance extends IWorldInstance +{ + leftMargin: number; + rightMargin: number; + topMargin: number; + bottomMargin: number; + + edges: NinePatchEdgeType; + fill: NinePatchFillType; + imageScaleX: number; + imageScaleY: number; + seams: NinePatchSeamsType; + + replaceImage(blob: Blob): Promise; +} diff --git a/spine-ts/spine-construct3/ts-defs/plugins/Construct Game Services/ICGSObjectType.d.ts b/spine-ts/spine-construct3/ts-defs/plugins/Construct Game Services/ICGSObjectType.d.ts index d85ad69ab..4c01e8e5b 100644 --- a/spine-ts/spine-construct3/ts-defs/plugins/Construct Game Services/ICGSObjectType.d.ts +++ b/spine-ts/spine-construct3/ts-defs/plugins/Construct Game Services/ICGSObjectType.d.ts @@ -2,9 +2,10 @@ /** Represents the Construct Game Services object. * @see {@link https://www.construct.net/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/construct-game-services | ICGSObjectType documentation } */ -type CGSSignInProvider = "Apple" | "BattleNet" | "BattleNetChina" | "Discord" | "Facebook" | "Github" | "Google" | "ItchIO" | "Microsoft" | "Reddit" | "Steam" | "X" | "Yandex"; +type CGSSignInProvider = "Apple" | "BattleNet" | "Discord" | "Facebook" | "Github" | "Google" | "ItchIO" | "Microsoft" | "Reddit" | "Steam" | "Twitch" | "X" | "Yandex"; interface CGSSignInOptions { + allowPersisting?: boolean; expiryMins?: number; popupWindowWidth?: number; popupWindowHeight?: number; @@ -36,8 +37,28 @@ interface CGSLeaderboardScoreResults { scores: CGSLeaderboardScoreResult[]; } +interface CGSCreateCloudSaveOptions { + key: string; + bucketId?: string; + name?: string; + data: string | Blob +} + +interface CGSGetCloudSaveOptions { + key: string; + bucketId: string; + type?: "text" | "blob"; +} + +interface CGSObjectTypeEventMap extends ObjectClassEventMap { + "signinpopupblocked": ConstructEvent +} + declare class ICGSObjectType extends IObjectType> { + addEventListener>(type: K, listener: (ev: CGSObjectTypeEventMap[K]) => any): void; + removeEventListener>(type: K, listener: (ev: CGSObjectTypeEventMap[K]) => any): void; + readonly isSignedIn: boolean; readonly canSignInPersistent: boolean; readonly playerId: string; @@ -46,9 +67,14 @@ declare class ICGSObjectType extends IOb readonly sessionKey: string; signInWithProvider(provider: CGSSignInProvider, gameId: string, opts?: CGSSignInOptions): Promise; + retryOpenSignInPopup(): void; signInPersistent(gameId: string): Promise; signOut(): Promise; + setPlayerName(name: string): Promise; submitScore(score: number, leaderboardId?: string): Promise; getLeaderboardScores(leaderboardId: string, opts?: CGSGetLeaderboardScoresOptions): Promise; + + createCloudSave(opts: CGSCreateCloudSaveOptions): Promise; + getCloudSave(opts: CGSGetCloudSaveOptions): Promise; } diff --git a/spine-ts/spine-construct3/ts-defs/runtime/IFamily.d.ts b/spine-ts/spine-construct3/ts-defs/runtime/IFamily.d.ts index b83e8c50a..8ce56f1d8 100644 --- a/spine-ts/spine-construct3/ts-defs/runtime/IFamily.d.ts +++ b/spine-ts/spine-construct3/ts-defs/runtime/IFamily.d.ts @@ -9,5 +9,5 @@ declare class IFamily>; /** Check if a given object type belongs to this family. */ - hasObjectType(objectType: IObjectType): boolean; + hasObjectType(objectType: IObjectType): boolean; } \ No newline at end of file diff --git a/spine-ts/spine-construct3/ts-defs/runtime/IObjectType.d.ts b/spine-ts/spine-construct3/ts-defs/runtime/IObjectType.d.ts index d33a84a06..50c76128b 100644 --- a/spine-ts/spine-construct3/ts-defs/runtime/IObjectType.d.ts +++ b/spine-ts/spine-construct3/ts-defs/runtime/IObjectType.d.ts @@ -16,5 +16,5 @@ declare class IObjectType>; /** Check if this object type belongs to a specified family. */ - isInFamily(family: IFamily): boolean; + isInFamily(family: IFamily): boolean; } \ No newline at end of file diff --git a/spine-ts/spine-construct3/ts-defs/runtime/IPlatformInfo.d.ts b/spine-ts/spine-construct3/ts-defs/runtime/IPlatformInfo.d.ts index c2471f3cf..6cf4df83a 100644 --- a/spine-ts/spine-construct3/ts-defs/runtime/IPlatformInfo.d.ts +++ b/spine-ts/spine-construct3/ts-defs/runtime/IPlatformInfo.d.ts @@ -1,7 +1,7 @@ -type PlatformInfoExportType = "preview" | "html5" | "scirra-arcade" | "cordova-android" | "cordova-ios" | "nwjs" | "windows-webview2" | "macos-wkwebview" | "xbox-uwp-webview2" | "instant-games" | "playable-ad" | "linux-cef"; +type PlatformInfoExportType = "preview" | "html5" | "scirra-arcade" | "cordova-android" | "cordova-ios" | "windows-webview2" | "macos-wkwebview" | "xbox-uwp-webview2" | "instant-games" | "playable-ad" | "linux-cef"; type PlatformInfoOSType = "windows" | "macos" | "linux" | "chrome-os" | "android" | "ios" | "unknown"; -type PlatformInfoBrowserType = "chrome" | "chromium" | "edge" | "opera" | "nwjs" | "firefox" | "safari" | "unknown"; +type PlatformInfoBrowserType = "chrome" | "chromium" | "edge" | "opera" | "firefox" | "safari" | "unknown"; type PlatformInfoBrowserEngineType = "chromium" | "gecko" | "webkit"; /** Provides details about the current platform, such as browser, operating system and environment. */ diff --git a/spine-ts/spine-construct3/ts-defs/runtime/IRenderer.d.ts b/spine-ts/spine-construct3/ts-defs/runtime/IRenderer.d.ts index 26b4c6ce3..c2e85262a 100644 --- a/spine-ts/spine-construct3/ts-defs/runtime/IRenderer.d.ts +++ b/spine-ts/spine-construct3/ts-defs/runtime/IRenderer.d.ts @@ -35,7 +35,7 @@ declare class IRenderer resetColor(): void; setCurrentZ(z: number): void; - getCurrentZ(): void; + getCurrentZ(): number; setCullFaceMode(m: RendererCullFaceMode): void; getCullFaceMode(): RendererCullFaceMode; diff --git a/spine-ts/spine-construct3/ts-defs/runtime/IRuntime.d.ts b/spine-ts/spine-construct3/ts-defs/runtime/IRuntime.d.ts index 4137f7ed0..d14d0da55 100644 --- a/spine-ts/spine-construct3/ts-defs/runtime/IRuntime.d.ts +++ b/spine-ts/spine-construct3/ts-defs/runtime/IRuntime.d.ts @@ -31,6 +31,10 @@ interface TextFragmentPositionAndSize { height: number } +type Vec2Arr = [number, number]; +type Vec3Arr = [number, number, number]; +type Vec4Arr = [number, number, number, number]; + type SDKPropertyType = number | string | boolean; type WrapperExtensionParameterType = number | string | boolean; @@ -79,6 +83,8 @@ interface RuntimeEventMap { "suspend": ConstructEvent; "resume": ConstructEvent; "resize": ConstructResizeEvent; + "windowmaximize": ConstructEvent, + "windowminimize": ConstructEvent, "pretick": ConstructEvent; "tick": ConstructEvent; "tick2": ConstructEvent; @@ -144,7 +150,7 @@ declare class IRuntime extends ConstructEventTarget getViewportSize(): Vec2Arr; readonly sampling: SamplingModeType; - readonly isPixelRoundingEnabled: boolean; + isPixelRoundingEnabled: boolean; get dt(): number; get dtRaw(): number; @@ -182,7 +188,7 @@ declare class IRuntime extends ConstructEventTarget signal(tag: string): void; waitForSignal(tag: string): Promise; - + /** When called from an event sheet, sets the current function return value, * much like the 'Set return value' action. */ setReturnValue(value: number | string): void; diff --git a/spine-ts/spine-construct3/ts-defs/runtime/ITweenState.d.ts b/spine-ts/spine-construct3/ts-defs/runtime/ITweenState.d.ts index 597d4e270..2cd57999d 100644 --- a/spine-ts/spine-construct3/ts-defs/runtime/ITweenState.d.ts +++ b/spine-ts/spine-construct3/ts-defs/runtime/ITweenState.d.ts @@ -8,4 +8,6 @@ declare class ITweenState extends ITimelineStateBase readonly instance: IWorldInstance; isDestroyOnComplete: boolean; readonly value: number; + readonly finished: Promise; + readonly released: Promise; }