Skip to content

SD-2261 - fix(types): expand definitions and exports to pass compilation#2463

Draft
mattConnHarbour wants to merge 4 commits intomainfrom
SD-2261
Draft

SD-2261 - fix(types): expand definitions and exports to pass compilation#2463
mattConnHarbour wants to merge 4 commits intomainfrom
SD-2261

Conversation

@mattConnHarbour
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Mar 19, 2026

@mattConnHarbour mattConnHarbour marked this pull request as draft March 19, 2026 04:45
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3860e18fa4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1112 to +1113
replaceFile(newFile: File | Blob | BinaryData): Promise<void>;

Choose a reason for hiding this comment

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

P1 Badge Remove unsupported PresentationEditor methods

The public PresentationEditor class in packages/super-editor/src/core/presentation-editor/PresentationEditor.ts does not implement replaceFile() or setToolbar() at all (a repo-wide search only finds those members on Editor), so this declaration will make TypeScript consumers compile successfully and then crash with TypeError when they call the newly advertised API.

Useful? React with 👍 / 👎.

Comment on lines +676 to +680
exportDocument(options?: {
isFinalDoc?: boolean;
commentsType?: string;
comments?: Comment[];
}): Promise<Blob | ArrayBuffer>;

Choose a reason for hiding this comment

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

P2 Badge Preserve Node Buffer in export return types

For headless/Node consumers, Editor.exportDocument() still resolves to a Buffer (Editor.ts returns Promise<Blob | Buffer>, and the Node export tests assert Buffer.isBuffer(exported)). Narrowing the declaration to Blob | ArrayBuffer breaks the common fs.writeFile(await editor.exportDocument()) flow at compile time even though runtime behavior is unchanged; exportDocx() immediately above has the same regression.

Useful? React with 👍 / 👎.

/**
* Save the document to the original source path (Node.js only).
*/
save(options?: { isFinalDoc?: boolean; commentsType?: string; comments?: Comment[] }): Promise<void>;

Choose a reason for hiding this comment

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

P2 Badge Keep save/export options aligned with SaveOptions

Editor.ts's SaveOptions already includes fieldsHighlightColor and compression, and save(), saveTo(), and exportDocument() all forward those flags into exportDocx(). After this narrowing, any TypeScript consumer using custom field highlighting or compression: 'STORE' will start failing to compile even though the feature still works at runtime.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants