fix: change size-changed to be in correct tense (#83)
* fix: change size-changed to be in correct tense * sdk changes
This commit is contained in:
parent
a09354bdf2
commit
ba1a27e465
1 changed files with 41 additions and 41 deletions
|
|
@ -33,7 +33,7 @@ import {
|
|||
|
||||
import {
|
||||
type McpUiSandboxResourceReadyNotification,
|
||||
type McpUiSizeChangeNotification,
|
||||
type McpUiSizeChangedNotification,
|
||||
type McpUiToolInputNotification,
|
||||
type McpUiToolInputPartialNotification,
|
||||
type McpUiToolResultNotification,
|
||||
|
|
@ -57,7 +57,7 @@ import {
|
|||
McpUiResourceTeardownResultSchema,
|
||||
McpUiSandboxProxyReadyNotification,
|
||||
McpUiSandboxProxyReadyNotificationSchema,
|
||||
McpUiSizeChangeNotificationSchema,
|
||||
McpUiSizeChangedNotificationSchema,
|
||||
} from "./types";
|
||||
export * from "./types";
|
||||
export { PostMessageTransport } from "./message-transport";
|
||||
|
|
@ -265,12 +265,12 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
|
|||
/**
|
||||
* Register a handler for size change notifications from the Guest UI.
|
||||
*
|
||||
* The Guest UI sends `ui/notifications/size-change` when its rendered content
|
||||
* The Guest UI sends `ui/notifications/size-changed` when its rendered content
|
||||
* size changes, typically via ResizeObserver. Set this callback to dynamically
|
||||
* adjust the iframe container dimensions based on the Guest UI's content.
|
||||
*
|
||||
* Note: This is for Guest UI → Host communication. To notify the Guest UI of
|
||||
* host viewport changes, use {@link app.App.sendSizeChange}.
|
||||
* host viewport changes, use {@link app.App.sendSizeChanged}.
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
|
|
@ -284,13 +284,13 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
|
|||
* };
|
||||
* ```
|
||||
*
|
||||
* @see {@link McpUiSizeChangeNotification} for the notification type
|
||||
* @see {@link app.App.sendSizeChange} for Host → Guest UI size notifications
|
||||
* @see {@link McpUiSizeChangedNotification} for the notification type
|
||||
* @see {@link app.App.sendSizeChanged} for Host → Guest UI size notifications
|
||||
*/
|
||||
set onsizechange(
|
||||
callback: (params: McpUiSizeChangeNotification["params"]) => void,
|
||||
callback: (params: McpUiSizeChangedNotification["params"]) => void,
|
||||
) {
|
||||
this.setNotificationHandler(McpUiSizeChangeNotificationSchema, (n) =>
|
||||
this.setNotificationHandler(McpUiSizeChangedNotificationSchema, (n) =>
|
||||
callback(n.params),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue