From 2468ca744fe4d49030c0aaa6405cc66cdb5a40d0 Mon Sep 17 00:00:00 2001 From: YukiWorks432 Date: Mon, 12 May 2025 23:40:53 +0900 Subject: [PATCH 1/3] Added definition of ElementPlacement. Changed the argument type of insertionLocation to ElementPlacement. --- Illustrator/2022/index.d.ts | 44 ++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/Illustrator/2022/index.d.ts b/Illustrator/2022/index.d.ts index 25f3c47..d02afd1 100644 --- a/Illustrator/2022/index.d.ts +++ b/Illustrator/2022/index.d.ts @@ -1,6 +1,34 @@ /// /// +/** + * Location to move element to. + * @see https://ai-scripting.docsforadobe.dev/jsobjref/scripting-constants/?h=elementplacement#elementplacement + */ +declare const ElementPlacement: { + /** + * Inside + */ + readonly INSIDE: Object + /** + * Place After + */ + readonly PLACEAFTER: Object + /** + * Place At Beginning + */ + readonly PLACEATBEGINNING: Object + /** + * Place At End + */ + readonly PLACEATEND: Object + /** + * Place Before + */ + readonly PLACEBEFORE: Object +} +declare type ElementPlacement = typeof ElementPlacement + /** * The screen mode. */ @@ -9090,7 +9118,7 @@ declare class Layer { * @param relativeObject * @param insertionLocation */ - move(relativeObject: object, insertionLocation: any): Layer + move(relativeObject: object, insertionLocation: ElementPlacement): Layer /** * Deletes this object. @@ -9583,7 +9611,7 @@ declare class Symbol { * @param relativeObject * @param insertionLocation */ - duplicate(relativeObject: object, insertionLocation: any): Symbol + duplicate(relativeObject: object, insertionLocation: ElementPlacement): Symbol /** * Deletes this object. @@ -9876,14 +9904,14 @@ declare class PageItem { * @param relativeObject * @param insertionLocation */ - duplicate(relativeObject?: object, insertionLocation?: any): PageItem + duplicate(relativeObject?: object, insertionLocation?: ElementPlacement): PageItem /** * Move the object. * @param relativeObject * @param insertionLocation */ - move(relativeObject: object, insertionLocation: any): PageItem + move(relativeObject: object, insertionLocation: ElementPlacement): PageItem /** * Deletes this object. @@ -10166,14 +10194,14 @@ declare class PathItem extends PageItem { * @param relativeObject * @param insertionLocation */ - duplicate(relativeObject?: object, insertionLocation?: any): PathItem + duplicate(relativeObject?: object, insertionLocation?: ElementPlacement): PathItem /** * Move the object. * @param relativeObject * @param insertionLocation */ - move(relativeObject: object, insertionLocation: any): PathItem + move(relativeObject: object, insertionLocation: ElementPlacement): PathItem } /** @@ -11028,14 +11056,14 @@ declare class TextRange { * @param relativeObject * @param insertionLocation */ - duplicate(relativeObject: object, insertionLocation: any): TextRange + duplicate(relativeObject: object, insertionLocation: ElementPlacement): TextRange /** * Move the object. * @param relativeObject * @param insertionLocation */ - move(relativeObject: object, insertionLocation: any): TextRange + move(relativeObject: object, insertionLocation: ElementPlacement): TextRange /** * Deletes this object. From 789711e87490eef355dc20cfadd662cc532e6468 Mon Sep 17 00:00:00 2001 From: YukiWorks432 Date: Sat, 17 May 2025 23:28:56 +0900 Subject: [PATCH 2/3] Change ElementPlacement from a constant to an enumerated type and define the value as a string --- Illustrator/2022/index.d.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Illustrator/2022/index.d.ts b/Illustrator/2022/index.d.ts index d02afd1..7811eb4 100644 --- a/Illustrator/2022/index.d.ts +++ b/Illustrator/2022/index.d.ts @@ -5,29 +5,28 @@ * Location to move element to. * @see https://ai-scripting.docsforadobe.dev/jsobjref/scripting-constants/?h=elementplacement#elementplacement */ -declare const ElementPlacement: { +declare enum ElementPlacement { /** * Inside */ - readonly INSIDE: Object + INSIDE = "INSIDE", /** * Place After */ - readonly PLACEAFTER: Object + PLACEAFTER = "PLACEAFTER", /** * Place At Beginning */ - readonly PLACEATBEGINNING: Object + PLACEATBEGINNING = "PLACEATBEGINNING", /** * Place At End */ - readonly PLACEATEND: Object + PLACEATEND = "PLACEATEND", /** * Place Before */ - readonly PLACEBEFORE: Object + PLACEBEFORE = "PLACEBEFORE", } -declare type ElementPlacement = typeof ElementPlacement /** * The screen mode. From d2e5b2611b88a4997d25491216b8a706f1aaff71 Mon Sep 17 00:00:00 2001 From: YukiWorks432 Date: Sat, 17 May 2025 23:30:23 +0900 Subject: [PATCH 3/3] Add ElementPlacement enum and update method signatures to use it --- Illustrator/2015.3/index.d.ts | 39 +++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/Illustrator/2015.3/index.d.ts b/Illustrator/2015.3/index.d.ts index 6e47d25..d3d9679 100644 --- a/Illustrator/2015.3/index.d.ts +++ b/Illustrator/2015.3/index.d.ts @@ -1,6 +1,33 @@ /// /// +/** + * Location to move element to. + * @see https://ai-scripting.docsforadobe.dev/jsobjref/scripting-constants/?h=elementplacement#elementplacement + */ +declare enum ElementPlacement { + /** + * Inside + */ + INSIDE = "INSIDE", + /** + * Place After + */ + PLACEAFTER = "PLACEAFTER", + /** + * Place At Beginning + */ + PLACEATBEGINNING = "PLACEATBEGINNING", + /** + * Place At End + */ + PLACEATEND = "PLACEATEND", + /** + * Place Before + */ + PLACEBEFORE = "PLACEBEFORE", +} + /** * The screen mode. */ @@ -9090,7 +9117,7 @@ declare class Layer { * @param relativeObject * @param insertionLocation */ - move(relativeObject: object, insertionLocation: any): Layer + move(relativeObject: object, insertionLocation: ElementPlacement): Layer /** * Deletes this object. @@ -9583,7 +9610,7 @@ declare class Symbol { * @param relativeObject * @param insertionLocation */ - duplicate(relativeObject: object, insertionLocation: any): Symbol + duplicate(relativeObject: object, insertionLocation: ElementPlacement): Symbol /** * Deletes this object. @@ -9876,14 +9903,14 @@ declare class PageItem { * @param relativeObject * @param insertionLocation */ - duplicate(relativeObject: object, insertionLocation: any): PageItem + duplicate(relativeObject: object, insertionLocation: ElementPlacement): PageItem /** * Move the object. * @param relativeObject * @param insertionLocation */ - move(relativeObject: object, insertionLocation: any): PageItem + move(relativeObject: object, insertionLocation: ElementPlacement): PageItem /** * Deletes this object. @@ -11006,14 +11033,14 @@ declare class TextRange { * @param relativeObject * @param insertionLocation */ - duplicate(relativeObject: object, insertionLocation: any): TextRange + duplicate(relativeObject: object, insertionLocation: ElementPlacement): TextRange /** * Move the object. * @param relativeObject * @param insertionLocation */ - move(relativeObject: object, insertionLocation: any): TextRange + move(relativeObject: object, insertionLocation: ElementPlacement): TextRange /** * Deletes this object.