Skip to content

Conversation

@imagekitio
Copy link
Collaborator

No description provided.

…L generation tests

- Enhanced the `processOverlay` function to include a new `layerMode` property for overlays.
- Updated the URL generation tests to include new transformation parameters such as `aiEdit`, `colorReplace`, and `distort`.
- Added comprehensive tests for various layer modes (multiply, cutter, cutout, displace) to ensure correct URL generation.
* See
* [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers).
*/
overlay?: Overlay;

Choose a reason for hiding this comment

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

When hovering over overlay key in transformations the jsDoc and the type inference looks like this

image

while the Overlay type in itself is composed of TextOverlay | ImageOverlay | VideoOverlay | SubtitleOverlay | SolidColorOverlay

should we specify about it in the JsDoc comment for here as well?

Copy link

@piyushryn piyushryn left a comment

Choose a reason for hiding this comment

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

One small comment, Otherwise LGTM!

@piyushryn piyushryn requested a review from Copilot January 18, 2026 17:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the SDK with new transformation parameters and modernizes the TypeScript type definitions by consolidating them into a single shared module.

Changes:

  • Adds support for new transformation parameters: layerMode, aiEdit, colorReplace, and distort
  • Consolidates TypeScript interfaces from multiple files into a unified shared.ts module
  • Updates upload-related type definitions to align with the latest API specifications
  • Adds documentation about TypeScript versioning policy

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/url-generation/overlay.js Adds test cases for the new layerMode transformation parameter
test/url-generation/basic.js Updates tests to include new transformation parameters (aiEdit, colorReplace, distort)
src/url.ts Extracts layerMode from overlay configuration and processes it during URL generation
src/responsive.ts Removes interface definitions that were moved to shared module
src/interfaces/shared.ts New consolidated file containing all shared interfaces and type definitions
src/interfaces/index.ts Updated to re-export from the new shared module
src/interfaces/UploadResponse.ts Completely restructured with enhanced type definitions and documentation
src/interfaces/UploadOptions.ts Completely restructured with enhanced type definitions and better documentation
src/interfaces/Transformation.ts Removed - content migrated to shared.ts
src/interfaces/SrcOptions.ts Removed - content migrated to shared.ts
src/index.ts Reorganized imports to use the new shared module structure
src/constants/supportedTransforms.ts Adds mappings for new transformation parameters
package.json Version bumped to 5.2.0
README.md Adds TypeScript versioning policy documentation
CHANGELOG.md Documents changes for version 5.2.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

* is especially useful if you want to add a versioning parameter to your URLs.
*/
queryParameters?: { [key: string]: string | number };

Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

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

The type definition on line 1001 is missing a trailing line to maintain consistency with the formatting of other properties in the SrcOptions interface. Additionally, there's inconsistent spacing with the type on line 1002 which has extra blank lines before and after it.

Suggested change

Copilot uses AI. Check for mistakes.
checks?: string;
webhookUrl?: string;

// JS SDK specific options
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

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

The comment on line 211 should be formatted as a JSDoc comment (/** ... */) to maintain consistency with the documentation style used throughout the file.

Suggested change
// JS SDK specific options
/**
* JS SDK specific options.
*/

Copilot uses AI. Check for mistakes.
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.

4 participants